CVE-2026-45623

PostCSS: Arbitrary file read and information disclosure via attacker-controlled sourceMappingURL in CSS comments

Published Jul 27, 2026 CVSS 3.1 · 7.5 High EPSS < 1% KEV · Not listed
Description
PostCSS takes a CSS file and provides an API to analyze and modify its rules by transforming the rules into an Abstract Syntax Tree. In versions 8.5.11 and prior, the PreviousMap parses the /*# sourceMappingURL=PATH */ comment from any CSS string passed to process() and dereferences PATH against the local filesystem with no scheme, allowlist, or traversal check. An attacker who controls the CSS input can cause the host process to read any file readable by Node and leak the first ~10 bytes of its content through the resulting JSON.parse SyntaxError message. The bug also yields a precise file-existence oracle and a controllable-read primitive that may be combined with large-file targets for DoS. The behaviour is triggered with PostCSS's default options — no from, no map, no plugins required — and is therefore reachable from any pipeline that runs untrusted CSS through PostCSS (CMS themes, user-uploaded styles, browser-extension/userstyle processors, build pipelines for third-party packages, blog comment renderers, etc.). This issue has been fixed in version 8.5.12.

Analysis

AI-generated

Technical impact

PostCSS version 8.5.11 and earlier allow an attacker who controls CSS input to embed a sourceMappingURL comment that is parsed and dereferenced against the local file system without validation. The resulting syntax error leaks the first ten bytes of the target file, providing both an information disclosure and a file‑existence oracle. This weakness is classified as CWE‑200 and CWE‑22.

Affected Systems

The vulnerability affects the PostCSS library from the postcss:postcss vendor, specifically all releases 8.5.11 and older. The flaw was introduced before 8.5.12 and was fixed in that release.

Risk and Exploitability

With a CVSS score of 7.5 the vulnerability is considered high severity, and the EPSS score is < 1%, indicating a very low but non‑zero probability of exploitation. It is not listed in the CISA KEV catalog. An attacker can exploit the flaw by supplying crafted CSS to any pipeline that uses PostCSS with default options, such as CMS theme rendering, user‑style processors, or build systems. The lack of input validation and file‑system checks makes the attack straightforward for an attacker with access to supply CSS, and the resulting read primitive could be combined with large files to trigger a denial‑of‑service.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade PostCSS to 8.5.12 or later, which removes the unsafe sourceMappingURL parsing logic.
  • Validate and sanitize all CSS input before passing it to PostCSS, ensuring that no sourceMappingURL comment containing arbitrary paths is accepted.
  • Restrict the file system permissions of the Node process or run PostCSS in a sandboxed environment to limit its ability to read arbitrary files if an immediate upgrade is not possible.

Generated by OpenCVE AI on August 3, 2026 at 17:06 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Github GHSA Github GHSA GHSA-6g55-p6wh-862q PostCSS: Arbitrary file read and information disclosure via attacker-controlled sourceMappingURL in CSS comments
History
Type Values Removed Values Added
First Time appeared Postcss
Postcss postcss
Vendors & Products Postcss
Postcss postcss
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description PostCSS takes a CSS file and provides an API to analyze and modify its rules by transforming the rules into an Abstract Syntax Tree. In versions 8.5.11 and prior, the PreviousMap parses the /*# sourceMappingURL=PATH */ comment from any CSS string passed to process() and dereferences PATH against the local filesystem with no scheme, allowlist, or traversal check. An attacker who controls the CSS input can cause the host process to read any file readable by Node and leak the first ~10 bytes of its content through the resulting JSON.parse SyntaxError message. The bug also yields a precise file-existence oracle and a controllable-read primitive that may be combined with large-file targets for DoS. The behaviour is triggered with PostCSS's default options — no from, no map, no plugins required — and is therefore reachable from any pipeline that runs untrusted CSS through PostCSS (CMS themes, user-uploaded styles, browser-extension/userstyle processors, build pipelines for third-party packages, blog comment renderers, etc.). This issue has been fixed in version 8.5.12.
Title PostCSS: Arbitrary file read and information disclosure via attacker-controlled sourceMappingURL in CSS comments
Weaknesses CWE-200
CWE-22
References
Metrics cvssV3_1

{'score': 7.5, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N'}

Weaknesses
  • CWE-200

    Exposure of Sensitive Information to an Unauthorized Actor

  • CWE-22

    Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 27, 2026, 5:44 PM
Reserved
May 12, 2026, 8:31 PM
Status
Analyzed
Published
Jul 27, 2026, 6:16 PM
Modified
Aug 7, 2026, 12:13 AM
Severity
Moderate
Public date
Jul 27, 2026, 5:23 PM