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 package | Versions | Reported by |
|---|---|---|
| jknack handlebars.java | < 4.5.2 | CVE List |
| com.github.jknack:handlebars (Maven) | before 4.5.2 | GitHub Advisory Database |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N |
Classification
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
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-55760 changed 2026-07-09 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-r4gv-qr8j-p3pg changed 2026-06-17 | CC-BY-4.0 |
| NVD | CVE-2026-55760 changed 2026-10-25 | Public domain |