/

CVE-2026-71215

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in art-template Directives

CVE-2026-71215

Received

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Arbitrary File Read

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

art-template contains a path traversal vulnerability in the resolution of files referenced by the include() and extend() directives. When an application allows external input to influence a sub-template name, an attacker may read arbitrary files accessible to the Node.js process.

Affected context

The vulnerability may occur in applications using art-template's include() or extend() directives when a sub-template path is derived from user-controlled or otherwise untrusted input. The risk is greatest when the application passes values such as request parameters into template resolution without constraining them to an approved set of files.

Exploit preconditions

  • Attack surface: Template rendering functionality using include() or extend()
  • Required access: Ability to influence the sub-template name or resolved filename
  • Trigger point: Sub-template resolution followed by file loading and compilation
  • Why exploitation is possible: The resolved path is used without verifying that it remains within the intended template root, allowing absolute paths or traversal sequences to escape that directory

Why this happens

The underlying bug is insufficient path containment validation. The resolver combines a trusted root with a filename using path.resolve() but does not verify that the resulting canonical path remains beneath the intended root. Absolute filenames can replace the root, while parent-directory segments can move the result outside it. This behavior maps to CWE-22, Improper Limitation of a Pathname to a Restricted Directory.

Potential impact

  • An attacker may read application configuration files
  • Secrets, credentials, or environment-related data could be exposed
  • Source code and template contents may be disclosed
  • Information obtained from the host could support further compromise
  • Sensitive data may be rendered through an application response or error path

General mitigation guidance

Mitigation generally focuses on reducing trust in template names and enforcing

path containment before any file is opened.

Common defensive patterns include:

  • Restricting sub-template selection to an explicit allowlist or fixed mapping
  • Resolving and canonicalizing candidate paths before access
  • Verifying that the canonical result is within the designated template root
  • Rejecting absolute paths and parent-directory traversal components
  • Keeping template directories separate from secrets and sensitive application files
  • Running the Node.js process with least-privilege filesystem permissions
  • Avoiding dynamic template inclusion when a static template reference is sufficient

How teams detect issues like this

Organizations can look for this vulnerability through:

  • Static analysis rules identifying user-controlled data flowing into

include() or extend() template names

  • Code review checks for path.resolve() or similar path joins without a

subsequent containment check

  • Tests covering absolute paths, parent-directory components, symlinks, and

encoded path representations

  • Runtime policies that limit template access to approved directories
  • Monitoring for unexpected file reads during template rendering

Automated code review and security scanning tools may help identify unsafe

data flows and missing path-boundary validation.

Sources

SourceLink
github.comgithub.com/aui/art-template

Frequently asked

questions

It can be remotely exploitable when a web application exposes a template

selection value to an attacker and uses that value during server-side

rendering. Applications using only fixed, trusted template names may not have

the same exposure.

The attacker generally needs access to an application endpoint or workflow

that lets them influence the sub-template name. They do not necessarily need

filesystem access or local operating-system privileges.

Use fixed template mappings or an allowlist, and validate that every resolved

canonical path remains inside the intended template directory before opening

the file.

Treat template paths as untrusted input, avoid combining them directly with

filesystem operations, test path-boundary conditions, and apply least-

privilege filesystem permissions to the rendering process.

Find out what's already
exploitable in your codebase.