CVE-2026-55760: handlebars.java FileTemplateLoader Path Traversal
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.
Published Jun 17, 2026
Affected packages
com.github.jknack:handlebars
- Ecosystem
- Maven
- Affected
- < 4.5.2
- Fixed in
- 4.5.2
- Check
mvn dependency:tree -Dincludes=com.github.jknack:handlebars
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
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);
}Credited to dyingman1.
References
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
