CVE-2026-126192: Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
Published 2026-11-13 · Updated 2026-11-13 · Also known as GHSA-4j63-6c4x-wfg4
Summary
Soup Sieve contains a quadratic time complexity vulnerability when evaluating general sibling combinators inside the :has() pseudo-class against untrusted HTML. Engineering teams using soupsieve with untrusted markup should update their dependencies.
Who is affected
Deployments evaluating developer-authored selectors containing general sibling combinators within a :has() clause (such as div:has(a ~ b)) against attacker-controlled HTML are affected. An attacker can supply a small crafted HTML document with numerous sibling elements to cause excessive CPU consumption, resulting in application stalls and denial of service.
Exploitability
The vulnerability is remotely exploitable over a network with low attack complexity, requiring no privileges or user interaction, but has a low availability impact and a low attack preparedness requirement. The EPSS score is 0.005 and CISA KEV active exploitation is no.
Remediation
- Upgrade PyPI package soupsieve to version 2.10.0 or later.
- Review selectors containing :has() to avoid general sibling combinators over untrusted markup with high numbers of children.
How to check your project
- Check dependency files (e.g., requirements.txt, pyproject.toml, poetry.lock) for soupsieve versions prior to 2.10.0.
- Inspect application codebase for CSS selectors utilizing the :has() pseudo-class combined with general sibling combinators (~).
Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.
Affected packages
| Ecosystem | Package | Affected versions | Fixed in | Upgrade |
|---|---|---|---|---|
| PyPI | soupsieve |
>= 0, < 2.10.0 | 2.10.0 | python -m pip install 'soupsieve>=2.10.0' |
CVSS 4.0 vector
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
| Attack vector | Network |
|---|---|
| Attack complexity | Low |
| Attack requirements | Present |
| Privileges required | None |
| User interaction | None |
| Confidentiality (vulnerable system) | None |
| Integrity (vulnerable system) | None |
| Availability (vulnerable system) | Low |
| Confidentiality (subsequent systems) | None |
| Integrity (subsequent systems) | None |
| Availability (subsequent systems) | None |
Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.
FAQ
What causes the quadratic time complexity in Soup Sieve?
When evaluating a general-sibling combinator inside :has() (like div:has(a ~ b)) without a matching right-hand side present, Soup Sieve performs a nested scan resulting in O(n²) time complexity relative to the number of sibling elements.
Are adjacent-sibling combinators affected by this issue?
No, the adjacent-sibling form (like div:has(a + b)) stays linear because its branch checks only the immediately following sibling per candidate.
Which version of soupsieve fixes the vulnerability?
Soup Sieve version 2.10.0 addresses the performance issue.
Original advisory description
References
- WEB https://github.com/facelessuser/soupsieve/security/advisories/GHSA-4j63-6c4x-wfg4
- ADVISORY https://nvd.nist.gov/vuln/detail/CVE-2026-126192
- WEB https://github.com/facelessuser/soupsieve/pull/304
- WEB https://github.com/facelessuser/soupsieve/commit/ffb88cca745c591224f74a8e86414a85e8f35fc0
- PACKAGE https://github.com/facelessuser/soupsieve
- WEB https://github.com/facelessuser/soupsieve/releases/tag/2.10
Source records: GHSA-4j63-6c4x-wfg4 (OSV.dev) · EPSS by FIRST, 2026-11-21.