Advisory Database
  • Advisories
  • Dependency Scanning
  1. maven
  2. ›
  3. com.github.jknack/handlebars-springmvc
  4. ›
  5. CVE-2026-63490

CVE-2026-63490: Handlebars.java: Arbitrary file read in `SpringTemplateLoader` via URL-fragment suffix bypass

September 2, 2026

com.github.jknack.handlebars.springmvc.SpringTemplateLoader resolves Spring MVC view names into URLs via Spring’s ResourceLoader without applying the path-containment check that protects every other URL-based loader in the project (ClassPathTemplateLoader, FileTemplateLoader, ServletContextTemplateLoader - all hardened by commit d177cdee).

The only remaining defense for file: / classpath: view names is the unconditional .hbs suffix appended by AbstractTemplateLoader.resolve(...). This suffix is the load-bearing security boundary that prevents a request like view=file:/etc/passwd from reading /etc/passwd instead of /etc/passwd.hbs.

This boundary is bypassed by a single character: # (the URL fragment delimiter).

When the view name ends with #, the appended .hbs lands inside the URL fragment. Both Spring’s FileUrlResource.exists() (via URI.getSchemeSpecificPart()) and the JDK’s URL.openStream() (via URL.getFile()) silently discard the fragment, so the file actually opened is the bare path the attacker specified - for example /etc/passwd rather than /etc/passwd.hbs. The compiled “template” is then parsed and rendered into the HTTP response body.

Result: unauthenticated, network-reachable, arbitrary file read of any file readable by the JVM process on any Spring MVC application that uses a default-configured HandlebarsViewResolver and exposes a controller that returns a (fully or partly) user-influenced view name.

References

  • github.com/advisories/GHSA-g29j-rwfv-h99w
  • github.com/jknack/handlebars.java/commit/61f43423a337b87db5fec1fe59f0725aaaa38df5
  • github.com/jknack/handlebars.java/releases/tag/v4.5.3
  • github.com/jknack/handlebars.java/security/advisories/GHSA-g29j-rwfv-h99w
  • nvd.nist.gov/vuln/detail/CVE-2026-63490

Code Behaviors & Features

Detect and mitigate CVE-2026-63490 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 4.5.3

Fixed versions

  • 4.5.3

Solution

Upgrade to version 4.5.3 or above.

Impact 7.5 HIGH

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N

Learn more about CVSS

Weakness

  • CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
  • CWE-23: Relative Path Traversal
  • CWE-552: Files or Directories Accessible to External Parties

Source file

maven/com.github.jknack/handlebars-springmvc/CVE-2026-63490.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Tue, 22 Sep 2026 12:19:29 +0000.