CVE-2026-126191: Soup Sieve: Exponential ReDoS in selector compilation via \9-run in CSS_ESCAPES/IDENTIFIER
Summary The IDENTIFIER/CSSESCAPES regex (cssparser.py:119-124) exhibits exponential backtracking on a run of ambiguous digit-escapes (\9) in an attribute-name or tag position of an otherwise well-formed selector. It fires at compile time (before the SELECTORLIMIT guard) via the public soupsieve.compile() and BeautifulSoup .select().
Published Nov 13, 2026
Affected packages
soupsieve
- Ecosystem
- PyPI
- Affected
- <= 2.10
- Fixed in
- 3.0.2
- Check
pip show soupsieve
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
The IDENTIFIER/CSS_ESCAPES regex (css_parser.py:119-124) exhibits exponential backtracking on a run of ambiguous digit-escapes (\9) in an attribute-name or tag position of an otherwise well-formed selector. It fires at compile time (before the SELECTOR_LIMIT guard) via the public soupsieve.compile() and BeautifulSoup .select().
PoC (verified on soupsieve 2.9.2)
import soupsieve as sv sv.compile('[a' + '\\9'*26 + '=x]') # ~57 bytes -> ~10s; ~16x time per +4 chars
Novelty
Distinct from the patched GHSA-836r-... (VALUE regex) and GHSA-2wc2-... (comma-list) advisories, which are fixed in 2.9.2; this is a different regex/vector.
Reachability
CSS selectors are usually developer-controlled, so exposure requires an application that compiles UNTRUSTED selector strings (web-scraping-as-a-service, no-code/query builders, user-defined extraction rules). Where selectors are user-supplied, a ~60-byte string hangs the worker.
Note
This issue was fixed in version 3.0.0, which has been yanked from the PyPI registry. Use versions 3.0.2 and above to upgrade.
Credited to Mucahic.
References
- https://github.com/facelessuser/soupsieve/security/advisories/GHSA-6655-6qjp-jx7x
- https://nvd.nist.gov/vuln/detail/CVE-2026-126191
- https://github.com/facelessuser/soupsieve/pull/300
- https://github.com/facelessuser/soupsieve/commit/dbfa2854ff31a863326bd6660d4e55c6f068db9e
- https://github.com/facelessuser/soupsieve/releases/tag/3.0
- https://github.com/advisories/GHSA-6655-6qjp-jx7x
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More PyPI vulnerabilities
All PyPI entriesCVE-2026-126190
Soup Sieve: Polynomial-time denial of service in the descendant combinator
high7.5Nov 13, 2026CVE-2026-126192
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
medium6.3Nov 13, 2026CVE-2026-126193
Soup Sieve: Uncontrolled recursion in CSS parser lets nested pseudo-class selectors exhaust the Python call stack
medium5.3Nov 13, 2026CVE-2026-85999
Soup Sieve: Polynomial-time ReDoS (O(n²)) in the whitespace/comment trimming regex `RE_WS_END` (triggers on VALID selectors)
medium5.3Sep 17, 2026CVE-2026-86000
Soup Sieve: Polynomial-time ReDoS (O(n²)) in the `IDENTIFIER` / `VALUE` selector sub-patterns
medium5.3Sep 17, 2026CVE-2026-49476
Soup Sieve has Memory Exhaustion via Large Comma-Separated Selector Lists
high7.5Jul 9, 2026
