{"schema":"threatline.record/2","record":{"id":"CVE-2026-104844","aliases":["GHSA-rj75-hqrm-r3gf"],"summary":"PostCSS: Quadratic complexity in flat selector parsing allows CPU exhaustion","details":"### Impact\n\n`.` and `#` are not word delimiters in the tokenizer, so a flat selector such as\n`.a.a.a...` reaches `splitWord()` as a single word token carrying n class or id\nindexes. Three passes scanned those index arrays linearly for every index,\nmaking the parse O(n^2) in the number of indexes rather than in input length:\n`uniqs()`, the `indices.forEach` loop, and the Sass-interpolation filter.\nParsing a 400 KB flat selector took ~34 s on a modern laptop, fully occupying a\nsingle thread. A benign selector of identical byte size parses in tens of\nmilliseconds, so the cost is driven by the index count, not the input size.\nThe nesting depth of such a selector is 0, so the `maxNestingDepth` guard added\nin 7.1.3 offers no protection.\n\nReachability is deployment dependent. Only consumers that parse untrusted,\nattacker-supplied selectors synchronously in a request path are exposed, for\nexample CSS sanitizers, CSS-in-JS services and online playgrounds. Ordinary\nbuild-time use on trusted sources is not affected.\n\n### Patches\n\nFixed in 7.1.6. The three passes now use Set membership tests, making parsing\nlinear in the number of indexes. There is no behaviour change: parsing is\nbyte-identical on a differential corpus of 8413 selectors.\n\n### Workarounds\n\nCap the size of selectors accepted from untrusted sources before parsing.","categories":["Libraries & packages"],"product":"postcss-selector-parser","vendor":"postcss","ecosystem":"npm","affected_ranges":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rj75-hqrm-r3gf","source_modified_at":"2026-10-05T22:53:57Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"postcss-selector-parser"},"range":"< 7.1.6"},{"source":"CVE List","source_url":"https://www.cve.org/CVERecord?id=CVE-2026-104844","source_modified_at":"2026-10-02T16:16:45.990Z","fetched_at":"2026-10-23T18:45:31.882637Z","product":"postcss-selector-parser","vendor":"postcss","versions":[{"status":"affected","version":"< 7.1.6"}],"defaultStatus":null},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rj75-hqrm-r3gf","source_modified_at":"2026-10-05T23:00:05.308008424Z","fetched_at":"2026-10-23T18:55:00.935475Z","package":{"name":"postcss-selector-parser","ecosystem":"npm","purl":"pkg:npm/postcss-selector-parser"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"7.1.6"}]}],"versions":[]}],"fixed_versions":[{"source":"GitHub Advisory Database","source_url":"https://github.com/advisories/GHSA-rj75-hqrm-r3gf","source_modified_at":"2026-10-05T22:53:57Z","fetched_at":"2026-10-23T18:42:43.628194Z","package":{"ecosystem":"npm","name":"postcss-selector-parser"},"version":"7.1.6"},{"source":"OSV","source_url":"https://osv.dev/vulnerability/GHSA-rj75-hqrm-r3gf","source_modified_at":"2026-10-05T23:00:05.308008424Z","fetched_at":"2026-10-23T18:55:00.935475Z","package":{"name":"postcss-selector-parser","ecosystem":"npm","purl":"pkg:npm/postcss-selector-parser"},"version":"7.1.6"}],"cvss":5.9,"severity":"Medium","kev":{"listed":false},"epss":{"probability":0.00394,"percentile":0.32391,"score_date":"2026-10-23"},"published_at":"2026-10-02T15:43:14.082Z","modified_at":"2026-10-05T23:00:05.308008424Z","provenance":[{"source":"GitHub Advisory Database","url":"https://github.com/advisories/GHSA-rj75-hqrm-r3gf","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-05T22:53:57Z"},{"source":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2026-104844","fetched_at":"2026-10-23T18:45:31.882637Z","source_modified_at":"2026-10-02T16:16:45.990Z"},{"source":"OSV","url":"https://osv.dev/vulnerability/GHSA-rj75-hqrm-r3gf","fetched_at":"2026-10-23T18:55:00.935475Z","source_modified_at":"2026-10-05T23:00:05.308008424Z"},{"source":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2026-104844","fetched_at":"2026-10-23T18:42:43.628194Z","source_modified_at":"2026-10-23"}],"sources":["GitHub Advisory Database","CVE List","OSV","EPSS"],"references":[{"source":"CVE List","url":"https://github.com/postcss/postcss-selector-parser/security/advisories/GHSA-rj75-hqrm-r3gf","tags":["x_refsource_CONFIRM"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-104844","source":"GitHub Advisory Database"},{"source":"CVE List","url":"https://github.com/postcss/postcss-selector-parser/commit/62b191792df0a0bc56062e5a875bc74aae2a51cd","tags":["x_refsource_MISC"]},{"source":"CVE List","url":"https://github.com/postcss/postcss-selector-parser/releases/tag/7.1.6","tags":["x_refsource_MISC"]},{"url":"https://github.com/advisories/GHSA-rj75-hqrm-r3gf","source":"GitHub Advisory Database"}],"locations":[],"motoko_assessment":{"status":"requires_architecture_review","automatic_remediation":false},"cve_state":"PUBLISHED","ssvc":{"exploitation":"none","automatable":"no","technical_impact":"partial","assessed_at":"2026-10-02T16:16:26.803770Z"},"classification":{"method":"product-first software-layer rules","rules_version":"2.1","matched_on":"ecosystem","confidence":"heuristic","reviewed":false},"change_timestamp":"2026-10-05T23:00:05.308008424Z","content_hash":"9917a5bd0cfe77afefa6722394bba2cf8bf816b9e69c1c1e5570a855db199d67"}}
