Advisories for Npm/Postcss-Selector-Parser package

2026

PostCSS: Quadratic complexity in flat selector parsing allows CPU exhaustion

. and # are not word delimiters in the tokenizer, so a flat selector such as .a.a.a… reaches splitWord() as a single word token carrying n class or id indexes. Three passes scanned those index arrays linearly for every index, making the parse O(n^2) in the number of indexes rather than in input length: uniqs(), the indices.forEach loop, and the Sass-interpolation filter. Parsing a 400 KB flat selector took ~34 …

postcss-selector-parser allows denial of service through uncontrolled AST recursion

A vulnerability was determined in postcss-selector-parser before 6.1.3 and 7.1.1. Affected is the function toString of the file src/selectors/container.js of the component AST Serialization. Executing a manipulation can lead to uncontrolled recursion. It is possible to launch the attack remotely. The exploit has been publicly disclosed and may be utilized. The vendor explains, that according to his definition "DoS on server-side on user-generated CSS is low risk for us (since …