chore(deps): update dependency postcss to v8.5.12 [security]#10310
Open
renovate[bot] wants to merge 1 commit into
Open
chore(deps): update dependency postcss to v8.5.12 [security]#10310renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
Coverage Report for ./frontend
File CoverageNo changed files found. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
8.5.10→8.5.12PostCSS: Arbitrary file read and information disclosure via attacker-controlled sourceMappingURL in CSS comments
CVE-2026-45623 / GHSA-6g55-p6wh-862q
More information
Details
Summary
PostCSS's
PreviousMapparses the/*# sourceMappingURL=PATH */comment from any CSS string passed toprocess()and dereferencesPATHagainst 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 resultingJSON.parseSyntaxErrormessage. 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 — nofrom, nomap, 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.).Details
The dangerous chain lives in
lib/previous-map.jsand is wired into everyInputconstruction atlib/input.js:70-77.Inputconstructor (lib/input.js:70-77):PreviousMapconstructor (lib/previous-map.js:17-29):Note
opts.map === falseis the only short-circuit. With default options (opts.map === undefined), the rest of the constructor — including the filesystem read — executes.loadAnnotation(lib/previous-map.js:72-84) extracts the URL without sanitisation:getAnnotationURL(lib/previous-map.js:59-61) only strips the/*# sourceMappingURL=prefix and trims whitespace — no scheme check, no path normalisation, no allowlist.loadMap(lib/previous-map.js:124-128) — whenprevis absent and the annotation is not an inlinedata:URI:opts.fromis unset,fileis undefined and the raw attacker-supplied path (e.g./etc/passwd) is used directly.opts.fromis set,path.join(dirname(file), attackerPath)is used.path.joindoes not block..segments, so../../../../../etc/passwdresolves outside the intended directory.loadFile(lib/previous-map.js:86-92) is the sink:The bytes are stored in
this.text.Inputimmediately invokesmap.consumer()(lib/input.js:74), which constructs aSourceMapConsumer(lib/previous-map.js:33). When the file is not valid source-map JSON (the common case),source-map-jscallsJSON.parse, and V8'sSyntaxErrormessage embeds the first ~10 bytes of the file content:This error is propagated back to the caller. Any application that surfaces PostCSS errors (logs, HTTP 500 responses, build-tool output, debug pages) discloses those bytes to the attacker.
Trust-boundary analysis:
postcss().process(css, opts?)./etc/passwd,/proc/self/environ, etc.startWith(annotation, 'data:')) routes inline URIs todecodeInline; everything else hitsloadFile.Primitives obtained:
JSON.parseSyntaxErrormessage.loadFile(existsSyncis false → returns undefined → no map text → no consumer call → no error). Existent non-JSON paths throw. Existent JSON paths succeed silently. Three distinguishable states./dev/zero, very large files, or device files can stall or crash the process.PoC
All commands executed against this repository's HEAD (postcss 8.5.10) on Node v22.12.0.
Vector 1 — Absolute path, default options (no
from, nomap):The first 10 bytes of
/etc/passwd(root:x:0:0) are leaked.Vector 2 — Relative
..traversal withopts.fromset (simulates a build pipeline that pinsfromto the source file):path.join('/var/www/html/styles', '../../../../../etc/passwd')resolves to/etc/passwd.Vector 3 — File-existence oracle:
Vector 4 — Custom file-content leak:
The first 10 bytes of
/tmp/server-secret.env(API_KEY=sk) are leaked — sufficient to confirm a token's presence and, in many cases, recover its prefix.Filesystem-call trace (proves the read happens with no opts at all):
Impact
postcss-loader, vite, parcel, Next.js, Gatsby, etc.) and for runtime CSS-handling libraries (CSS Modules tools, CSS minifiers, theme processors). Any pipeline that runs untrusted user CSS — CMS theme uploads, user-styled blog posts, browser-extension/userstyle services, multi-tenant build farms, third-party-package build pipelines — is exposed.JSON.parseSyntaxError. This is enough to recover SSH-key headers, environment-variable prefixes (API_KEY=sk…),/etc/passwdrecords, the start of/proc/self/environ, and other high-value secrets, and to fingerprint the host (Debian-tri…from/etc/hostname).JSON.parseerror, no-such-file silence), enabling reconnaissance of the host filesystem layout and confirmation of installed software, user accounts, and configuration files./dev/zero,/proc/kcore, very large files, or named pipes —readFileSyncis a synchronous, unbounded read.postcss().process(css)and no options. The only configuration that disables the bug is the explicit, undocumented-for-this-purpose{ map: false }.Recommended Fix
The root cause is that
loadFileaccepts any path the attacker supplies inside a CSS comment. The annotation is meant for tooling, not for production CSS processing of untrusted input. Two layered fixes:Refuse traversal/absolute paths in
loadMap(defence-in-depth):Require explicit opt-in to follow on-disk source-map annotations: gate the
loadFile(map)call inloadMapbehind an option such asopts.map.annotation === trueoropts.map.followAnnotation === true. Today, the only way to opt out is{ map: false }, which also disables in-memory previous-map handling. Inverting the default — only follow disk-resident annotations when explicitly asked — eliminates the entire attack surface for callers that pass untrusted CSS, while preserving build-tool use cases where the annotation is trusted.A user-facing changelog entry should warn that
postcss().process(untrustedCss)previously read attacker-controlled paths, and recommend auditing applications that surfaced PostCSS errors to end users.Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
postcss/postcss (postcss)
v8.5.12Compare Source
opts.unsafeMapto disable checks.v8.5.11Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.