PyPI
CVE-2026-126192
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
- Severity
- Medium
- Published
- 13 Nov 2026
- Last changed
- 13 Nov 2026
- Added to UpHeron
- 23 Nov 2026
- Fixed in
- 2.10.0
- Exploit chance
- 0.5% in the next 30 daysHigher than 41% of CVEs. EPSS by FIRST, 24 Nov 2026
- Also known as
- GHSA-4j63-6c4x-wfg4
- Sources
- OSV.dev and GitHub
Description
Matching a selector that puts a general-sibling combinator inside :has(), such as div:has(a ~ b), against untrusted HTML runs in O(n²) time in the number of sibling elements. A single small document with a few thousand siblings ties the process up for a minute of CPU, so an application that runs a fixed selector of this shape over HTML it doesn't control can be stalled by one request.
:has is powerful, but much in the same way poor regular expressions can be crafted to cause catastrophic backtracking with greedy capturing, has can be used to create non-ideal scenarios that can cause large portions of the tree to be evaluated for one or many elements if not used thoughtfully.
This behavior is not exclusive to Soup Sieve, but browsers make note of these potential performance issues themselves: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:has#performance_considerations.
Workarounds
Quadratic time for :has in some circumstances is expected and not a bug. While we've made optimizations and there may be more in the future, the way :has is designed to operate will never perform in linear time in all circumstances. Users should thoughtfully apply the use of :has.
The anchor selector (the A in A:has(B)) should not be an element that has too many children. Additionally, too general an anchor, such as *, can cause :has() to be applied to every element.
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-126190Soup Sieve: Polynomial-time denial of service in the descendant combinatorHigh 7.5 13 Nov 2026
References
- CVE.org https://www.cve.org/CVERecord?id=CVE-2026-126192
- GitHub Advisory Database https://github.com/advisories/GHSA-4j63-6c4x-wfg4