PyPI
CVE-2026-126190
Soup Sieve: Polynomial-time denial of service in the descendant combinator
- Severity
- High 7.5
- Published
- 13 Nov 2026
- Last changed
- 13 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 4.0.0
- Exploit chance
- 0.5% in the next 30 daysHigher than 45% of CVEs. EPSS by FIRST, 24 Nov 2026
- Attack
- Over the network · No login needed · No user action needed
- Attacker can
- Take it down
- CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H- Also known as
- GHSA-mmhr-3c5m-f64f
- Sources
- OSV.dev and GitHub
Description
Matching a selector that uses the descendant combinator (a b) takes time that grows polynomially with how deeply the document is nested, and each extra descendant combinator in the selector raises the degree by one. A selector with k descendant combinators takes O(n^(k+1)) time on a chain of n nested elements.
An attacker who controls the HTML or XML that an application passes to Soup Sieve (directly, or through Beautiful Soup's select(), select_one(), css.select(), etc.) can send a very small, deeply nested document that keeps a CPU busy for seconds to minutes against an ordinary selector such as section div div.
To match a b, Soup Sieve checks each element against b and then walks up through its ancestors looking for one that matches a. When the selector has more descendant combinators, the rest of the selector is tried again from each ancestor on that walk, and so on for every combinator.
Workarounds
If users can't upgrade:
- Use as few descendant combinators as they can in selectors that run on untrusted documents. Where the structure of the document is known, the child combinator (a > b) only looks at the parent and is not affected.
- Limit the size and nesting depth of untrusted documents before selecting on them.
- Run selection on untrusted input with a time limit, for example in a worker process that can be stopped.
Affected software
| Software | Affected versions |
|---|---|
soupsievePyPI · osv:PyPI:soupsieve |
|
About soupsieve
Vulnerabilities in soupsieve
- In our list
- 4
- Published in the last 12 months
- 4
- Critical, last 12 months
- 0
- High, last 12 months
- 2
- Known exploited
- 0
- CVE-2026-126191Soup Sieve: Exponential ReDoS in selector compilation via \9-run in CSS_ESCAPES/IDENTIFIERHigh 7.5 13 Nov 2026
- CVE-2026-126193Soup Sieve: Uncontrolled recursion in CSS parser lets nested pseudo-class selectors exhaust the Python call stackMedium 5.3 13 Nov 2026
- CVE-2026-126192Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic timeMedium 13 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-126190
- GitHub Advisory Database https://github.com/advisories/GHSA-mmhr-3c5m-f64f