CodeVetter · Repo Unpack · Risk map
postcss/postcss
These are source observations and explicitly labeled hypotheses, not confirmed vulnerabilities. Sensitive boundaries include annotation-driven filesystem reads, caller-provided executable plugins, HTML embedding, and serialized AST hydration. The implementation contains concrete protections, but their scope and bypass options matter. Testing and documentation also have limits that future work should preserve or examine without assuming whole-repository coverage.
- PreviousMap performs synchronous filesystem reads; annotation-derived paths require a .map suffix, from, and realpath-based containment under the CSS directory, while unsafeMap and map.prev callbacks deliberately bypass these restrictions.
- Hypothesis: realpath containment checks and the subsequent existsSync/readFileSync operate separately on pathname state, so an attacker able to change relevant filesystem entries between those operations could warrant race-condition investigation; no exploit was reproduced. (inferred)
- Plugin creators, prepare hooks, root callbacks, and visitors execute directly in the caller's process with the live Result and API helpers; the inspected execution path provides no isolation boundary around those callbacks.
- HTML delimiter escaping is scoped to Roots serialized by the default SafeStringifier; custom Stringifier use, individual-node output, and Document markup raws have different guarantees, and escaping modified chunks reduces source-map precision.
- NoWorkResult returns its retained CSS without routing it through SafeStringifier and delays parsing until root access; reading css or awaiting an untouched result therefore does not establish parser validation or default Root escaping.
- Visitor processing loops until isClean; the plugin guide explicitly warns that unconditional insertion can create an infinite loop, so convergence depends on plugin guards or processed markers.
- Document is a public AST type and inherits Node.toJSON, but fromJSON's type dispatch only accepts root, decl, rule, comment, and atrule; Document hydration reaches the unknown-type error branch.
- Validation limits include map-generator.js being excluded from coverage enforcement and fuzz reparsing accepting CssSyntaxError; the fuzz processor branch cannot test plugin visitor execution because it constructs postcss() without plugins.