Soup Sieve: Quadratic-time denial of service when matching :has()
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- None
- Attack complexity
- Low
- Impact type
- Denial of service
- Confidentiality · integrity · availability
- None · None · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-407.
Summary
Soup Sieve, a CSS selector library used with Beautiful Soup 4, is affected before 4.0.1. Its :has() matching repeatedly searches descendant subtrees and reevaluates parent elements for each child, which is an inefficient algorithmic complexity flaw (CWE-407). An unauthenticated remote attacker can supply crafted deeply nested or wide HTML or XML so that matching takes quadratic time and occupies a worker for seconds or minutes. Applications that process only trusted documents are not affected, and selectors compiled with NOCACHE keep the old uncached behavior.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
Description from the CNA
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0.1, Soup Sieve repeatedly searches descendant subtrees for each candidate evaluated by :has() and repeatedly reevaluates a parent containing :has(> ...) for each child, causing quadratic matching on deeply nested or wide attacker-influenced HTML or XML. Applications using ordinary fixed selectors through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while applications that process only trusted documents are not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.1.
Why it matters now
SSVC decision points
CISA ADP · SSVC 2.0.3
- Exploitation
- Poc
- Automatable
- Yes
- Technical impact
- Partial
The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| facelessuser | soupsieve | before 4.0.1 | 4.0.1 | Patch available | CNA |
- soupsieve Vendorfacelessuser Affected before 4.0.1 Fixed in 4.0.1 Patch available CNA
Remediation
Upgrade facelessuser soupsieve to version 4.0.1, which fixes the issue.
Written with Claude Haiku 5.5 from the sources below · 2026-11-16
- Fix · CNA soupsieve (facelessuser) Fixed in 4.0.1
Timeline
- 2026-11-12 Threatist record created from CVE-2026-126189
- 2026-11-16 CISA SSVC decision points changed
References
Other 5
- https://github.com/facelessuser/soupsieve/security/advisories/GHSA-8jvp-3x96-xpqw
- https://github.com/facelessuser/soupsieve/pull/352
- https://github.com/facelessuser/soupsieve/commit/0469c148f5501ec2127e0d65b77c2a1c395fa379
- https://github.com/facelessuser/soupsieve/commit/305fbf6b8c1f6ff05fec55d1e5bb28d80d22de44
- https://github.com/facelessuser/soupsieve/releases/tag/4.0.1
More facelessuser vulnerabilities
- TI-2026-90415 Soup Sieve exponential ReDoS in selector compilation via \9-run CVSS 3.1HIGH 7.5
- TI-2026-47703 pymdown-extensions: Exponential-backtracking ReDoS in caret, tilde, betterem, and magiclink inline processors CVSS 3.1HIGH 7.5
- TI-2026-36631 Soup Sieve: Regular Expression Denial of Service (ReDoS) in soupsieve Selector Parser CVSS 3.1HIGH 7.5
- TI-2026-36630 Soup Sieve: Memory Exhaustion via Large Comma-Separated Selector Lists in soupsieve CVSS 3.1HIGH 7.5
- TI-2023-15603 Arbitrary file inclusion with the pymdowm-snippets extension CVSS 3.1HIGH 7.5
- TI-2026-90424 Uncontrolled recursion in Soup Sieve lets selectors exhaust stack CVSS 3.1MEDIUM 5.3
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences