Executive brief
PostCSS is a popular tool used by developers to transform CSS styles. A vulnerability exists where an attacker can provide a specially crafted CSS file that forces the tool to read sensitive files (source maps) from the server's filesystem. This could lead to the exposure of source code or internal file paths, particularly in environments like online CSS editors or automated build services.
Technical details
An incomplete fix for a previous path traversal vulnerability (GHSA-6g55-p6wh-862q) allows arbitrary file reads of .map files. In `lib/previous-map.js`, the `loadFile()` function contains a security guard that rejects absolute paths and directory traversal; however, this guard is only executed if the `from` option is set. If PostCSS is invoked without the `from` option, an attacker-controlled `sourceMappingURL` in a CSS comment can specify an absolute path or use `../` to traverse the filesystem. If the target file ends in `.map` and contains valid JSON, PostCSS will read it and disclose its `sources` and `sourcesContent` in the resulting output. This is fixed in version 8.5.23.
Affected products
- postcss postcss <= 8.5.22
Timeline
- 2026-07-24: disclosed
- 2026-08-03: advisory