{"id":"CVE-2026-85999","published":"2026-09-17T15:23:37Z","modified":"2026-09-22T20:29:44Z","title":"Soup Sieve: Polynomial-time ReDoS (O(n²)) in the whitespace/comment trimming regex `RE_WS_END` (triggers on VALID…","vendor":"facelessuser","product":"soupsieve","tier":"tail","description":{"text":"Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.9, selector_iter in src/soupsieve/css_parser.py trims the raw selector with RE_WS_END, an end-anchored WSC whitespace-and-comment expression used with search(), so the regular expression engine retries a greedy scan at every starting offset. An attacker-controlled valid selector containing a long internal whitespace run, or a selector containing a long CSS comment run followed by another token, causes quadratic CPU work before tokenization. User-controlled selectors can reach the path through soupsieve.compile() and BeautifulSoup.select(), while applications using only hard-coded selectors are unaffected. This root cause is separate from the IDENTIFIER and VALUE backtracking vulnerability because the cost occurs in RE_WS_END.search during trimming rather than token matching. The resulting CPU consumption can hold the Python GIL, exhaust workers, and stall a service without causing memory corruption or code execution. The issue is fixed in version 2.9.","provenance":"source","from":"CVE.org"},"cvss":{"score":5.3,"severity":"MEDIUM","version":"3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00609,"percentile":0.43292,"provenance":"source"},"cwes":[{"id":"CWE-400","name":"Uncontrolled Resource Consumption"},{"id":"CWE-1333","name":"Inefficient Regular Expression Complexity"}],"references":[{"url":"https://github.com/facelessuser/soupsieve/security/advisories/GHSA-j934-xhv5-fg8f","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/facelessuser/soupsieve/commit/cf198fcddc9230f06ed39f974eba0ce076b85cda","tags":["x_refsource_MISC"]},{"url":"https://github.com/facelessuser/soupsieve/releases/tag/2.9","tags":["x_refsource_MISC"]}],"priority":{"score":12.4,"factors":[{"name":"EPSS percentile","points":8.66},{"name":"CVSS severity","points":3.71}]},"vendorSlug":"facelessuser","affectedVersions":[{"vendor":"facelessuser","product":"soupsieve","versions":["< 2.9"]}],"ssvc":{"exploitation":"poc","automatable":"yes","technicalImpact":"partial","timestamp":"2026-09-22T16:55:16.479978Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"soupsieve","vulnerableRanges":["<2.9.0"],"patched":["2.9.0"],"from":["GHSA-j934-xhv5-fg8f","PYSEC-2026-4171"],"provenance":"source"}],"summary":{"text":"Soup Sieve, a CSS selector library used with Beautiful Soup 4, contains a regular expression in its selector trimming step (RE_WS_END within selector_iter in css_parser.py) that scales quadratically on crafted input, causing excessive CPU consumption. An attacker who can supply a selector string over the network without authentication or user interaction can trigger it through soupsieve.compile() or BeautifulSoup.select() when an application passes user-controlled selectors, with applications using only hard-coded selectors unaffected.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:43:54Z"},"euvd":{"id":"EUVD-2026-81690","exploited":false,"provenance":"source"},"lineage":{"familyId":"fam-facelessuser-soupsieve-cve-2026-49476","parents":[{"from":"CVE-2026-49476","to":"CVE-2026-85999","relation":"successor","confidence":"high","kind":"lineage","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:soupsieve","fromFixed":"2.8.4","toFixed":"2.9.0","daysApart":65},{"kind":"same-code","provenance":"machine","files":["soupsieve/css_parser.py"],"commits":["https://github.com/facelessuser/soupsieve/commit/28108ab805818c832d9568142a99844fd95a0d39","https://github.com/facelessuser/soupsieve/commit/cf198fcddc9230f06ed39f974eba0ce076b85cda"],"basis":"rarely changed file"}]}],"children":[{"from":"CVE-2026-85999","to":"CVE-2026-86000","relation":"related","confidence":"medium","kind":"lineage","evidence":[{"kind":"same-code","provenance":"machine","files":["soupsieve/css_parser.py"],"commits":["https://github.com/facelessuser/soupsieve/commit/cf198fcddc9230f06ed39f974eba0ce076b85cda","https://github.com/facelessuser/soupsieve/commit/ce44e4996e6632871c18cdd7a7fb641be8ef34ef"],"basis":"rarely changed file"},{"kind":"similar","provenance":"machine","score":0.38,"basis":"same product + CWE + description similarity"}]}],"packageHistory":[{"cve":"CVE-2026-49476","published":"2026-07-14","fixed":"2.8.4","kev":false},{"cve":"CVE-2026-49477","published":"2026-07-14","fixed":"2.8.4","kev":false},{"cve":"CVE-2026-85999","published":"2026-09-17","fixed":"2.9.0","kev":false},{"cve":"CVE-2026-86000","published":"2026-09-17","fixed":"2.9.0","kev":false},{"cve":"CVE-2026-126192","published":"2026-11-12","fixed":"2.10.0","kev":false,"link":{"from":"CVE-2026-85999","to":"CVE-2026-126192","relation":"successor","confidence":"low","kind":"sequence","evidence":[{"kind":"version-step","provenance":"source","package":"PyPI:soupsieve","fromFixed":"2.9.0","toFixed":"2.10.0","daysApart":56}]}},{"cve":"CVE-2026-126191","published":"2026-11-12","fixed":"3.0.2","kev":false}],"package":"PyPI:soupsieve"}}