Skip to content

Commit 1bbb296

Browse files
Merge pull request #10457 from github/mikael-mattsson-GHSA-rj75-hqrm-r3gf
2 parents f2723a8 + 39d3686 commit 1bbb296

1 file changed

Lines changed: 34 additions & 3 deletions

File tree

‎advisories/github-reviewed/2026/10/GHSA-rj75-hqrm-r3gf/GHSA-rj75-hqrm-r3gf.json‎

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-rj75-hqrm-r3gf",
4-
"modified": "2026-10-05T22:53:54Z",
4+
"modified": "2026-10-05T22:53:57Z",
55
"published": "2026-10-05T22:53:54Z",
66
"aliases": [
77
"CVE-2026-104844"
88
],
99
"summary": "PostCSS: Quadratic complexity in flat selector parsing allows CPU exhaustion",
10-
"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.",
10+
"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, and for the 6.x line in 6.1.5 (backport of the same change,\npostcss/postcss-selector-parser#346). 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.",
1111
"severity": [
1212
{
1313
"type": "CVSS_V3",
@@ -25,14 +25,33 @@
2525
"type": "ECOSYSTEM",
2626
"events": [
2727
{
28-
"introduced": "0"
28+
"introduced": "7.0.0"
2929
},
3030
{
3131
"fixed": "7.1.6"
3232
}
3333
]
3434
}
3535
]
36+
},
37+
{
38+
"package": {
39+
"ecosystem": "npm",
40+
"name": "postcss-selector-parser"
41+
},
42+
"ranges": [
43+
{
44+
"type": "ECOSYSTEM",
45+
"events": [
46+
{
47+
"introduced": "0"
48+
},
49+
{
50+
"fixed": "6.1.5"
51+
}
52+
]
53+
}
54+
]
3655
}
3756
],
3857
"references": [
@@ -44,6 +63,10 @@
4463
"type": "ADVISORY",
4564
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-104844"
4665
},
66+
{
67+
"type": "WEB",
68+
"url": "https://github.com/postcss/postcss-selector-parser/pull/346"
69+
},
4770
{
4871
"type": "WEB",
4972
"url": "https://github.com/postcss/postcss-selector-parser/commit/62b191792df0a0bc56062e5a875bc74aae2a51cd"
@@ -52,9 +75,17 @@
5275
"type": "PACKAGE",
5376
"url": "https://github.com/postcss/postcss-selector-parser"
5477
},
78+
{
79+
"type": "WEB",
80+
"url": "https://github.com/postcss/postcss-selector-parser/releases/tag/6.1.5"
81+
},
5582
{
5683
"type": "WEB",
5784
"url": "https://github.com/postcss/postcss-selector-parser/releases/tag/7.1.6"
85+
},
86+
{
87+
"type": "WEB",
88+
"url": "https://www.npmjs.com/package/postcss-selector-parser/v/6.1.5"
5889
}
5990
],
6091
"database_specific": {

0 commit comments

Comments
 (0)