/

CVE-2026-63490

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Handlebars Spring MVC Loader

CVE-2026-63490

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-23, CWE-552

Impact:

Local File Read and Information Disclosure

Severity:

HIGH RISK

(7.5)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A path traversal and local file disclosure vulnerability in Handlebars.java allows attacker-influenced Spring MVC view names to resolve resources outside the intended template location. When an application exposes a controller with a user-influenced view name, an unauthenticated remote attacker may read files accessible to the JVM.

Affected context

The issue occurs in applications that use the Handlebars Spring MVC integration and allow external input to influence view names. Risk is higher when the Spring template loader accepts file or classpath resource URLs without validating that the resolved resource remains within an approved template directory.

Exploit preconditions

  • Attack surface: An HTTP-accessible Spring MVC controller or view-resolution path
  • Required access: Typically no authentication when the affected endpoint is publicly reachable
  • Trigger point: Resolution and compilation of an attacker-influenced view name
  • Why exploitation is possible: Resource resolution can accept alternate URL schemes and bypass intended suffix or path restrictions, allowing access to files outside the permitted template location

Why this happens

The underlying bug is insufficient path-containment validation during template resource resolution. The Spring MVC loader passes attacker-influenced view names to a general-purpose resource resolver without consistently confirming that the canonicalized result belongs to an approved template directory.

This maps primarily to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, with related characteristics of CWE-23: Relative Path Traversal and CWE-552: Files or Directories Accessible to External Parties. URL parsing behavior can cause validation and resource access to evaluate different portions of the supplied name.

Potential impact

  • An attacker may read sensitive files accessible to the JVM
  • Application secrets, configuration data, or credentials could be disclosed
  • Source code and deployment details may be exposed
  • The application may face follow-on compromise if disclosed secrets enable access to other systems

General mitigation guidance

Mitigation generally focuses on enforcing a strict trust boundary between user-controlled view identifiers and filesystem or classpath resources.

Common defensive patterns include:

  • Resolving templates only from a fixed, allowlisted base directory
  • Canonicalizing resources before applying path-containment checks
  • Rejecting unexpected URL schemes, fragments, absolute paths, and traversal segments
  • Mapping external values to predefined view identifiers instead of treating them as resource paths
  • Applying strict template-name validation before resource resolution and compilation
  • Running the application with least-privilege filesystem permissions and limiting access to sensitive files
  • Preferencing secure-by-default loader APIs that enforce containment and restrict resource types

How teams detect issues like this

Organizations can look for this issue through:

  • Static analysis rules identifying user-controlled values passed to view resolvers, template loaders, or resource APIs
  • Code review checks for missing canonicalization and path-containment validation
  • Detection of file, classpath, absolute-path, fragment, or traversal syntax accepted in view names
  • Policy enforcement requiring allowlisted template identifiers and fixed resource roots
  • Runtime monitoring for abnormal template resolution attempts and access to sensitive filesystem paths
  • Automated security review tools that flag uncontrolled resource loading and path traversal patterns

Sources

SourceLink
github.comgithub.com/jknack/handlebars.java/commit/61f43423a337b87db5fec1fe59f0725aaaa38df5
github.comgithub.com/jknack/handlebars.java/releases/tag/v4.5.3
github.comgithub.com/jknack/handlebars.java/security/advisories/GHSA-g29j-rwfv-h99w

Frequently asked

questions

It can be remotely exploitable when an application exposes a Spring MVC endpoint that allows unauthenticated users to influence the view name. Applications with fixed, allowlisted view mappings may not expose the same attack path.

Not necessarily. The described attack may be performed without authentication when a publicly reachable controller passes attacker-controlled input into view resolution.

Use fixed or allowlisted view identifiers and enforce canonical path-containment checks before resolving any resource. Resource loaders should reject unsupported schemes and paths outside approved template roots.

Treat view names as identifiers rather than paths, minimize filesystem permissions, validate resource locations consistently, and use static analysis and code-review policies for resource-loading APIs.

Find out what's already
exploitable in your codebase.