CVE-2026-126192
Medium 6.3No known exploitationFix availableSoup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
Vendor advisory: GHSA-4j63-6c4x-wfg4
Record last updated
CVSS score
Medium on a 0 to 10 scale
EPSS, chance of exploitation in 30 days
No EPSS score available
CISA remediation deadline
Not in the KEV catalog
Description
## Summary 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. With all of that said, there is room for improvements that can in some cases greatly improve performance. ## Details `:has(a ~ b)` asks "does this element contain an `a` that has a later sibling `b`?". When no `b` is present, soupsieve can't short-circuit, and it answers the q…
Weakness: CWE-400, CWE-407
Patching and mitigation
- Patch status
- Fix available (source: Microsoft MSRC)
- Fix documented (source date)
- Mitigation
- None documented
- Vendor guidance
- msrc.microsoft.com (opens in a new tab)
Affected products
| Vendor | Product | Affected versions | Fixed in | Per |
|---|---|---|---|---|
| Microsoft | azl4 python-soupsieve 2.8.2-4.azl4 on Azure Linux 4.0 | Not documented | Not documented | Microsoft MSRC |
| pip | soupsieve | all versions up to and including 2.9.2 | 2.10.0 | GitHub Advisory Database |
Timeline
Advisory
Microsoft advisory published
Patch
Fix documented by Microsoft MSRC
Vendor guidance and references
- Microsoft Security Update Guide (opens in a new tab)vendor-advisory
- GitHub Advisory GHSA-4j63-6c4x-wfg4 (opens in a new tab)github-advisory