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 …