Description
Handlebars.java provides logic-less and semantic Mustache templates with Java. Prior to 4.5.2, applications that pass user-controlled input to Handlebars.compile() using FileTemplateLoader or ClassPathTemplateLoader are vulnerable to path traversal, allowing arbitrary file read through template names derived from URL path parameters, request parameters, or other user-controlled sources. This issue is fixed in version 4.5.2.
Published: 2026-07-08
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

bars.java provides logic-less and semantic Mustache templates with Java. Prior to 4.5.2, applications that pass user-controlled input to Handlebars.compile() using FileTemplateLoader or ClassPathTemplateLoader are vulnerable to path traversal, allowing arbitrary file read through template names derived from URL path parameters, request parameters, or other user-controlled sources. This vulnerability permits an attacker to include traversal characters such as "../" or forward slashes in the template name, causing the loader to resolve to an arbitrary file on the filesystem. The file contents are then returned in the rendered template, enabling disclosure of sensitive files or configuration data. This flaw is evaluated with a CVSS score of 7.5.

Affected Systems

The vulnerability affects all releases of jknack Handlebars.java earlier than version 4.5.2 that use FileTemplateLoader or ClassPathTemplateLoader to compile templates from names that can be influenced by user input. Application developers who supply template names derived from URL parameters, form fields, or other externally controllable sources are at risk. Systems that use hard‑coded template names or omit the described loaders are not affected.

Risk and Exploitability

The CVSS score of 7.5 marks the flaw as high severity, but the EPSS score of less than 1 % and the that public exploitation is unlikely at present. Nevertheless, the flaw can be triggered remotely by sending a request that includes a traversal string as the template name. Once invoked, the loader delivers the contents of the targeted file back to the application’s response, exposing confidential data. An attacker with firewall access to the application network could exercise this vector without needing elevated privileges on the host beyond those granted to the Java process.

Generated by OpenCVE AI on July 28, 2026 at 09:09 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Handlebars.java to version 4.5.2 or newer, where the path traversal issue is fixed.
  • Replace or configure the loader so that it never accepts user‑controlled template names; for example, switch to a loader that only serves packaged resources and disallows filesystem paths.
  • If an upgrade is not immediately possible, validate or whitelist template names before passing them to compile(), rejecting any that contain path separators or traversal sequences.

Generated by OpenCVE AI on July 28, 2026 at 09:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-r4gv-qr8j-p3pg handlebars.java FileTemplateLoader Path Traversal
History

Fri, 10 Jul 2026 10:15:00 +0000

Type Values Removed Values Added
First Time appeared Jknack
Jknack handlebars.java
Vendors & Products Jknack
Jknack handlebars.java

Thu, 09 Jul 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 08 Jul 2026 19:45:00 +0000

Type Values Removed Values Added
Description Handlebars.java provides logic-less and semantic Mustache templates with Java. Prior to 4.5.2, applications that pass user-controlled input to Handlebars.compile() using FileTemplateLoader or ClassPathTemplateLoader are vulnerable to path traversal, allowing arbitrary file read through template names derived from URL path parameters, request parameters, or other user-controlled sources. This issue is fixed in version 4.5.2.
Title handlebars.java FileTemplateLoader Path Traversal
Weaknesses CWE-22
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}


Subscriptions

Jknack Handlebars.java
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-09T14:37:41.666Z

Reserved: 2026-06-17T14:34:51.880Z

Link: CVE-2026-55760

cve-icon Vulnrichment

Updated: 2026-07-09T14:37:38.827Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-28T09:15:06Z

Weaknesses
  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')