/

CVE-2026-53598

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in Prompty File Include Handling

CVE-2026-53598

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22, CWE-200

Impact:

Local File Disclosure via Path Traversal

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

Prompty loaders expanded ${file:...} references in .prompty frontmatter without validating that referenced paths remained within the intended prompt directory or other allowed roots.

In environments where attackers can supply or influence .prompty files, this behavior can be abused to read arbitrary local files via absolute paths, directory traversal, or symlink escapes.

Affected context

The vulnerability appears in Prompty-based workflows that automatically load and expand .prompty files containing ${file:...} references.

It is most relevant where:

  • Prompt definitions are loaded from user-controlled or workspace-shared locations, and
  • The Prompty loader runs on a host that has access to sensitive local files, configuration, or secrets.

In such setups, the loader trusts the ${file:...} paths embedded in frontmatter without restricting them to a safe prompt directory or explicit allowlist.

Exploit preconditions

  • Attack surface: The Prompty loading mechanism that parses .prompty frontmatter and expands ${file:...} references.
  • Required access: Ability to create, modify, or supply .prompty files that the application or tooling will load (e.g., via repository contribution, plugin input, or shared workspace).
  • Trigger point: Loading or rendering of a malicious .prompty file that contains ${file:...} directives pointing outside the intended prompt directory.
  • Why exploitation is possible: The loader resolves file references without enforcing a canonical path check or root constraint, allowing absolute paths, .. traversal, or symlinks to escape the expected directory and access arbitrary readable files.

Why this happens

The underlying issue is an insufficient validation of file paths derived from partially untrusted metadata, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.

Prompty's loader accepts ${file:...} references in frontmatter and resolves them directly against the filesystem, without normalizing the resulting paths and confirming they remain under a designated root.

Because the abstraction treats frontmatter as configuration and assumes the embedded paths are safe, it fails to enforce directory boundaries or an allowlist, effectively turning prompt metadata into a primitive for local file inclusion and information exposure, which also relates to CWE-200: Information Exposure.

Potential impact

  • An attacker-controlled .prompty file could read arbitrary local files that the Prompty process can access.
  • Sensitive configuration files, API keys, or credentials may be exposed through prompt expansion or logs.
  • Proprietary prompt libraries, system prompts, and internal documentation can be disclosed.
  • Local environment details (paths, OS-specific files, or application configs) can be revealed and used to support further attacks.

General mitigation guidance

Mitigation focuses on reducing trust in file-based references and constraining filesystem access:

  • Normalize and canonicalize all ${file:...} paths, then enforce that resolved paths stay within a configured root directory (e.g., the prompt project root or an explicit allowlist of directories).
  • Treat frontmatter as untrusted input; apply strict validation rules to file-reference fields and reject or sanitize unsafe patterns such as absolute paths or .. segments.
  • Run prompt-loading tools with least-privilege file access so that even if traversal occurs, accessible data is limited.
  • Provide secure configuration defaults that restrict file includes to a known safe set of locations rather than requiring users to opt in to safety.

How teams detect issues like this

Detection can be approached through both code-centric and operational views:

  • Use static analysis or code search to identify file-include logic that concatenates user- or metadata-controlled paths without canonicalization and root checks.
  • During code review, flag any ${file:...} or similar include features that resolve filesystem paths, and verify that they enforce directory constraints and handle symlinks safely.
  • Add unit and integration tests that attempt to include files via .. traversal, absolute paths, and symlink escapes, and assert that such references are rejected.
  • Employ security scanning or SAST tools configured to detect CWE-22 patterns, such as unsanitized path resolution in file-reading APIs.

Sources

SourceLink
github.comgithub.com/microsoft/prompty/commit/88ac9948d7d37995edbb2f6d36913436626c39e1
github.comgithub.com/microsoft/prompty/security/advisories/GHSA-wxhm-2mq7-7697

Frequently asked

questions

Exploitability depends on how .prompty files are sourced; it becomes significant when untrusted or semi-trusted parties can contribute or influence prompt files that are automatically loaded on systems with access to sensitive local data.

No direct system-level access is required, but the attacker must be able to introduce or modify .prompty files consumed by the Prompty loader, such as via a shared repository, plugin mechanism, or collaborative workspace.

Enforce strict root-directory constraints on all file references, normalize paths before comparison, and reject any reference that resolves outside the configured safe roots, while also avoiding reliance on user-controlled metadata for direct filesystem access.

Design file-include features with the assumption that configuration and metadata may be hostile: apply canonicalization, allowlisting, least-privilege filesystem permissions, and security-focused code review for any functionality that resolves user-influenced paths.

Find out what's already
exploitable in your codebase.