CVE-2026-55760
JSON

7.5high

handlebars.java FileTemplateLoader Path Traversal

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.53% (higher than 38% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-r4gv-qr8j-p3pg

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.

Affected

Product or packageVersionsReported by
jknack handlebars.java< 4.5.2CVE List
com.github.jknack:handlebars (Maven)before 4.5.2GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Classification

CWE-22

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

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.

GitHub Advisory Database
Impact

Any application that passes user-controlled input to Handlebars.compile() using a FileTemplateLoader (or ClassPathTemplateLoader) is vulnerable to arbitrary file read. This is a realistic attack surface for web applications that use template names from URL path parameters, request parameters, or other user-controlled sources.

Patches

com.github.jknack:handlebars:4.5.2

Workarounds

Validate template name is derived from user input.

if (!file.getPath().startsWith(new File(prefix).getCanonicalPath())) {
        throw new IOException("Path traversal attempt detected: " + location);
}
NVD (es)

Handlebars.java proporciona plantillas Mustache sin lógica y semánticas con Java. Antes de la versión 4.5.2, las aplicaciones que pasan entradas controladas por el usuario a Handlebars.compile() usando FileTemplateLoader o ClassPathTemplateLoader son vulnerables a salto de ruta, permitiendo la lectura arbitraria de archivos a través de nombres de plantillas derivados de parámetros de ruta de URL, parámetros de solicitud u otras fuentes controladas por el usuario. Este problema está solucionado en la versión 4.5.2.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-55760 changed 2026-07-09CVE Terms of Use
GitHub Advisory DatabaseGHSA-r4gv-qr8j-p3pg changed 2026-06-17CC-BY-4.0
NVDCVE-2026-55760 changed 2026-10-25Public domain