GitHub Advisoryadvisory · Maven

GHSA-r4gv-qr8j-p3pg handlebars.java FileTemplateLoader Path Traversal

HIGH Published 2026-06-17 Modified 2026-06-17 Official page ↗
Aliases
CVE-2026-55760
Ecosystem
Maven
Packages
com.github.jknack:handlebars
Severity
High
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Weaknesses
CWE-22
Reviewed
2026-06-17

Affected packages

• Maven com.github.jknack:handlebars: < 4.5.2 → fixed in 4.5.2

Description

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. ```java if (!file.getPath().startsWith(new File(prefix).getCanonicalPath())) { throw new IOException("Path traversal attempt detected: " + location); } ```

Related

Alias · CVE (1)

  • CVE-2026-55760 Handlebars.java provides logic-less and semantic Mustache templates with Java. vulnerability

Weakness · CWE (1)

  • CWE-22 Improper Limitation of a Pathname to a Restricted Directory weakness

References