/

CVE-2026-73646

Severity:

HIGH RISK

(7.5)

Path Traversal (CWE-22) in PostCSS Source Map Loader

CVE-2026-73646

Awaiting Analysis

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Source Code and Sensitive File 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 issue in PostCSS can cause attacker-controlled source map references in untrusted CSS to resolve to unintended local or absolute .map files. When source maps are enabled and the processed result is exposed, an attacker may disclose embedded sourcesContent from reachable files.

Affected context

The issue occurs in PostCSS deployments that process CSS containing attacker-controlled sourceMappingURL annotations and allow source map loading. Risk increases when map generation or loading is enabled, the referenced paths can reach files outside the intended source directory, and result.map or equivalent output is returned to an untrusted party.

Exploit preconditions

  • Attack surface: CSS processing through the PostCSS API
  • Required access: Ability to submit or influence CSS content and receive the resulting source map output
  • Trigger point: Source map resolution during CSS parsing or transformation
  • Required environment: Source map loading must be enabled, rather than disabled with an appropriate configuration
  • Why exploitation is possible: Attacker-controlled source map references can influence path construction, including traversal or absolute path resolution, allowing reachable .map files to be read

Why this happens

The vulnerable behavior passes an attacker-controlled sourceMappingURL annotation into path-joining logic and permits resolved paths that are traversed or absolute. This fails to enforce that source map references remain within an intended trusted directory.

The behavior maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). The insecure pattern is treating a path derived from untrusted document content as a trusted local file reference without canonicalization, containment checks, or an equivalent restricted resolver.

Potential impact

  • Source map contents may be disclosed to an attacker
  • Embedded sourcesContent may reveal application source code or sensitive configuration
  • Internal filesystem structure may be exposed through file resolution behavior
  • Downstream systems may unintentionally publish sensitive source data in generated artifacts

General mitigation guidance

Mitigation generally focuses on reducing trust in source map references and restricting filesystem access during CSS processing.

Common defensive patterns include:

  • Disable source map loading when it is not required for the processing workflow
  • Resolve source map paths only within an explicitly permitted directory
  • Canonicalize candidate paths and enforce directory containment before reading files
  • Reject absolute paths, traversal segments, and unexpected path forms from document annotations
  • Avoid exposing generated source maps or embedded sourcesContent to untrusted consumers
  • Run processing with least-privilege filesystem permissions and minimal readable data
  • Use isolated temporary workspaces for files that must be processed

How teams detect issues like this

Organizations can detect this class of issue through:

  • Static analysis for tainted sourceMappingURL values flowing into filesystem path APIs
  • Code review checks for path joins that lack canonicalization and containment validation
  • Tests covering traversal segments, absolute paths, symlinked locations, and unexpected URL-like values
  • Runtime monitoring for CSS processing components reading .map files outside approved directories
  • Policy enforcement requiring source map loading to be explicitly enabled and restricted
  • Automated code review or dependency analysis tools that flag path traversal and unsafe file access patterns

Sources

SourceLink
github.comgithub.com/postcss/postcss/commit/95663d3eb7ba26f4854dd19d3b4f4425760cf56c
github.comgithub.com/postcss/postcss/releases/tag/8.5.18
github.comgithub.com/postcss/postcss/security/advisories/GHSA-r28c-9q8g-f849

Frequently asked

questions

It may be remotely exploitable when an application accepts untrusted CSS, enables source map loading, and returns source map results or otherwise exposes the loaded contents.

An attacker generally needs the ability to submit or influence CSS containing a source map reference and a way to observe the resulting map data. The referenced files must also be reachable by the processing process.

Disable source map loading when it is unnecessary. Where it is required, restrict resolution to a trusted directory using canonicalization and strict containment checks.

Treat paths derived from document content as untrusted, apply allowlisted filesystem boundaries, minimize process permissions, and test path-handling logic against traversal and absolute-path inputs.

Find out what's already
exploitable in your codebase.