CVE-2026-126192
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
CVE-2026-126192 is a medium vulnerability (CVSS 6.3) in Facelessuser Soupsieve, published November 12, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.48%, the 41st percentile. Fixed in soupsieve 2.10.0.
- Severity
- 6.3 MediumCVSS 4.0, CVE List
- Exploit chance
- 0.48%EPSS, 41st percentile
- Exploitation
- None knownNot on CISA’s or ENISA’s lists
- Fixed in
2.10.0soupsieve +16 more
Description
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
Attack profile
How easy it is to exploit
- Attack vector
- Network
- Complexity
- Low
- Privileges needed
- None
- User interaction
- None
What an attacker can affect
- Confidentiality
- None
- Integrity
- None
- Availability
- Low
Exploit likelihood
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
soupsievePyPI | through 2.9.2 | 2.10.0 |
python-soupsieveAzure Linux:3 | through 2.6-3 | None known |
soupsieveDebian:12 | All versions, plus listed versions 2.3.2-12.4-12.4.1-12.4.1-22.5-1 Show 7 moreShow less2.6-12.7-12.7-22.8.1-12.8.3-12.8.4-14.1-1 | None known |
soupsieveDebian:13 | All versions, plus listed versions 2.7-12.7-22.8.1-12.8.3-12.8.4-14.1-1 | None known |
soupsieveDebian:14 | before 4.1-1, plus listed versions 2.7-12.7-22.8.1-12.8.3-12.8.4-1 | 4.1-1 |
duckduckgo-mcp-serverDocker Hardened Images:Alpine:3.24 | Listed versions 0.6.1-r100.6.1-r110.6.1-r30.6.1-r40.6.1-r5 Show 20 moreShow less0.6.1-r70.6.1-r80.6.1-r90.7.0-r00.7.0-r10.7.0-r100.7.0-r110.7.0-r120.7.0-r130.7.0-r140.7.0-r150.7.0-r160.7.0-r20.7.0-r30.7.0-r40.7.0-r50.7.0-r60.7.0-r70.7.0-r80.7.0-r9 | None known |
fetch-mcpDocker Hardened Images:Alpine:3.24 | Listed versions 2026.7.10-r02026.7.10-r12026.7.10-r22026.7.10-r32026.7.10-r4 Show 26 moreShow less2026.7.10-r52026.8.18-r02026.8.18-r12026.8.18-r22026.8.31-r02026.8.31-r12026.8.31-r102026.8.31-r112026.8.31-r122026.8.31-r132026.8.31-r142026.8.31-r152026.8.31-r162026.8.31-r172026.8.31-r182026.8.31-r192026.8.31-r22026.8.31-r202026.8.31-r212026.8.31-r32026.8.31-r42026.8.31-r52026.8.31-r62026.8.31-r72026.8.31-r82026.8.31-r9 | None known |
datahub-ingestionDocker Hardened Images:Debian:13 | Listed versions 1.5.0.7-01.6.0.1-01.6.0.1-11.6.0.1-21.6.0.1-3 Show 24 moreShow less1.6.0.2-01.6.0.2-11.7.0.10-01.7.0.12-01.7.0.13-01.7.0.14-01.7.0.14-11.7.0.14-21.7.0.16-01.7.0.16-11.7.0.17-01.7.0.17-11.7.0.17-21.7.0.17-31.7.0.18-01.7.0.19-01.7.0.19-11.7.0.19-21.7.0.19-31.7.0.19-41.7.0.19-51.7.0.19-61.7.0.20-61.7.0.20-7 | None known |
datascience-notebookDocker Hardened Images:Debian:13 | Listed versions 2026.07.28-02026.07.28-12026.07.28-102026.07.28-112026.07.28-12 Show 16 moreShow less2026.07.28-132026.07.28-142026.07.28-152026.07.28-162026.07.28-172026.07.28-182026.07.28-192026.07.28-22026.07.28-202026.07.28-32026.07.28-42026.07.28-52026.07.28-62026.07.28-72026.07.28-82026.07.28-9 | None known |
duckduckgo-mcp-serverDocker Hardened Images:Debian:13 | Listed versions 0.6.1-100.6.1-110.6.1-20.6.1-30.6.1-4 Show 24 moreShow less0.6.1-50.6.1-60.6.1-70.6.1-80.6.1-90.7.0-00.7.0-10.7.0-100.7.0-110.7.0-120.7.0-130.7.0-140.7.0-150.7.0-160.7.0-170.7.0-180.7.0-20.7.0-30.7.0-40.7.0-50.7.0-60.7.0-70.7.0-80.7.0-9 | None known |
Show 7 moreShow less
| Package | Affected | Fixed |
|---|---|---|
fetch-mcpDocker Hardened Images:Debian:13 | Listed versions 2026.7.10-02026.7.10-12026.7.10-22026.7.10-32026.7.10-4 Show 31 moreShow less2026.7.10-52026.8.18-02026.8.18-12026.8.18-22026.8.31-02026.8.31-12026.8.31-102026.8.31-112026.8.31-122026.8.31-132026.8.31-142026.8.31-152026.8.31-162026.8.31-172026.8.31-182026.8.31-192026.8.31-22026.8.31-202026.8.31-212026.8.31-222026.8.31-232026.8.31-242026.8.31-252026.8.31-262026.8.31-32026.8.31-42026.8.31-52026.8.31-62026.8.31-72026.8.31-82026.8.31-9 | None known |
soupsievePyPI | before 2.10.0, plus listed versions 0.40.50.5.10.5.20.5.3 Show 45 moreShow less0.61.01.0.11.0.21.0b11.0b21.11.21.2.11.31.3.11.41.51.61.6.11.6.21.71.7.11.7.21.7.31.81.91.9.11.9.21.9.31.9.41.9.51.9.62.02.0.12.12.22.2.12.32.3.12.3.22.3.2.post12.42.4.12.52.62.72.82.8.12.8.2 | 2.10.0 |
soupsieveUbuntu:20.04:LTS | All versions, plus listed versions 1.9.2+dfsg-2ubuntu11.9.4+dfsg-11.9.5+dfsg-1 | None known |
soupsieveUbuntu:22.04:LTS | All versions, plus listed versions 2.2.1-22.3-12.3.1-1 | None known |
soupsieveUbuntu:24.04:LTS | All versions, plus listed versions 2.4.1-22.5-1 | None known |
soupsieveUbuntu:26.10 | All versions, plus listed versions 2.8.3-12.8.4-1 | None known |
soupsieveUbuntu:26.04:LTS | All versions, plus listed versions 2.7-22.8.1-12.8.3-1 | None known |
What each source reports
CVE List Score used 6.3
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
CVE-2026-126192- CVSS 4.0
- 6.3 Medium
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 - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-13
EUVDEUVD-2026-124557 6.3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
EUVD-2026-124557- CVSS 4.0
- 6.3 Medium
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 - Updated
- 2026-11-13
GitHub AdvisoriesGHSA-4j63-6c4x-wfg4 6.3
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
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 question with a nested scan: match_future_child walks every candidate a under the scope, and for each one the general-sibling branch of match_future_relations walks all of that a's following siblings looking for b. With n siblings that is (n-1) + (n-2) + ... + 1 comparisons, i.e. O(n²).
The adjacent-sibling form div:has(a + b) stays linear, because its branch checks only the one immediately following sibling per candidate. So the cost is specific to the general-sibling ~ (and ~ nested inside :has), and it shows up on the common case where the right-hand side simply isn't there.
Proof of concept
Installed from PyPI: pip install soupsieve==2.9.2 beautifulsoup4.
import time
import soupsieve
from bs4 import BeautifulSoup
selector = "div:has(a ~ b)"
for n in (1000, 2000, 4000, 8000):
html = "<div>" + ("<a></a>" * n) + "</div>"
soup = BeautifulSoup(html, "html.parser")
start = time.perf_counter()
soupsieve.select(selector, soup)
print(n, round((time.perf_counter() - start) * 1000), "ms")
Measured:
n=1000 837 ms
n=2000 3667 ms
n=4000 14797 ms
n=8000 59746 ms
Time quadruples for each doubling of n. The n=8000 input is a ~56 KB HTML fragment.
Impact
Availability. Any caller that evaluates a fixed selector containing a general sibling under :has() over attacker-controlled markup can be forced to spend minutes of CPU on a small input. The selector is developer-authored and ordinary; the untrusted part is the HTML, which is soupsieve's normal input.
A single-pass evaluation of the sibling run (remember whether an a has been seen while scanning the siblings once) would make this case linear.
Mitigation
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.
Further, it is recommended that the inner selector (the B in A:has(B)) should use combinators like > or + to limit traversal. When the selector inside :has() is not tightly constrained, Soup Sieve might need to traverse the entire subtree of the anchor
element to check the condition.
If the risk for a given project is too great, user input can be scanned for usage of :has and be denied. Calls can also be wrapped in a timeout to prevent long-running processes as well.
- Record
GHSA-4j63-6c4x-wfg4- CVSS 4.0
- 6.3 Medium
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 - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-13
NVD 6.3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
CVE-2026-126192- CVSS 4.0
- 6.3 Medium
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-13
OSV 6.3
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
CVE-2026-126192- CVSS 4.0
- 6.3 Medium
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 - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-14
OSVDEBIAN-CVE-2026-126192 6.3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
DEBIAN-CVE-2026-126192- CVSS 4.0
- 6.3 Medium
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-15
Show 4 moreShow less
OSVDHI-5qjy-vfgi-pa4u-s4fg 6.3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a…
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
DHI-5qjy-vfgi-pa4u-s4fg- CVSS 4.0
- 6.3 Medium
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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X - Updated
- 2026-11-16
OSVGHSA-4j63-6c4x-wfg4 6.3
Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
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 question with a nested scan: match_future_child walks every candidate a under the scope, and for each one the general-sibling branch of match_future_relations walks all of that a's following siblings looking for b. With n siblings that is (n-1) + (n-2) + ... + 1 comparisons, i.e. O(n²).
The adjacent-sibling form div:has(a + b) stays linear, because its branch checks only the one immediately following sibling per candidate. So the cost is specific to the general-sibling ~ (and ~ nested inside :has), and it shows up on the common case where the right-hand side simply isn't there.
Proof of concept
Installed from PyPI: pip install soupsieve==2.9.2 beautifulsoup4.
import time
import soupsieve
from bs4 import BeautifulSoup
selector = "div:has(a ~ b)"
for n in (1000, 2000, 4000, 8000):
html = "<div>" + ("<a></a>" * n) + "</div>"
soup = BeautifulSoup(html, "html.parser")
start = time.perf_counter()
soupsieve.select(selector, soup)
print(n, round((time.perf_counter() - start) * 1000), "ms")
Measured:
n=1000 837 ms
n=2000 3667 ms
n=4000 14797 ms
n=8000 59746 ms
Time quadruples for each doubling of n. The n=8000 input is a ~56 KB HTML fragment.
Impact
Availability. Any caller that evaluates a fixed selector containing a general sibling under :has() over attacker-controlled markup can be forced to spend minutes of CPU on a small input. The selector is developer-authored and ordinary; the untrusted part is the HTML, which is soupsieve's normal input.
A single-pass evaluation of the sibling run (remember whether an a has been seen while scanning the siblings once) would make this case linear.
Mitigation
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.
Further, it is recommended that the inner selector (the B in A:has(B)) should use combinators like > or + to limit traversal. When the selector inside :has() is not tightly constrained, Soup Sieve might need to traverse the entire subtree of the anchor
element to check the condition.
If the risk for a given project is too great, user input can be scanned for usage of :has and be denied. Calls can also be wrapped in a timeout to prevent long-running processes as well.
- Record
GHSA-4j63-6c4x-wfg4- CVSS 4.0
- 6.3 Medium
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 - Weakness
- CWE-400, CWE-407
- Updated
- 2026-11-13
OSVUBUNTU-CVE-2026-126192 6.3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
UBUNTU-CVE-2026-126192- CVSS 4.0
- 6.3 Medium
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 - Updated
- 2026-11-13
OSVAZL-113914No score
CVE-2026-126192 affecting package python-soupsieve 2.6-3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.10, matching a developer-authored selector that places the general sibling combinator inside :has() repeatedly scans each candidate element's following siblings when the right-hand side is absent, producing quadratic work on attacker-controlled HTML. Applications that evaluate a fixed selector such as div:has(a ~ b) over untrusted markup can have a worker occupied for minutes by a small document, while the adjacent sibling form and trusted-only document processing are not affected in the same way. This issue is fixed in version 2.10.
- Record
AZL-113914- Updated
- 2026-11-15
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| affected, aliases, references | OSV | |
| affected, aliases, references | OSV | |
| affected, aliases, references | NVD, OSV | |
| published | EUVD | |
| references | OSV | |
| published | EUVD | |
| references | CVE List | |
| affected, aliases, facts, references | GitHub Advisories, OSV | |
| first indexed | CVE List, EUVD, NVD |
Dates are when Every CVE recorded each change. Upstream dates may differ.
References
github.com/facelessuser/soupsieve/security/advisories/GHSA-4j63-6c4x-wfg4
github.com/facelessuser/soupsieve/pull/304
github.com/facelessuser/soupsieve/commit/ffb88cca745c591224f74a8e86414a85e8f35fc0
github.com/facelessuser/soupsieve/releases/tag/2.10
nvd.nist.gov/vuln/detail/CVE-2026-126192
github.com/advisories/GHSA-4j63-6c4x-wfg4
Show 7 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2026/126xxx/CVE-2026-126192.json
security-tracker.debian.org/tracker/CVE-2026-126192
scout.docker.com/v/DHI-5qjy-vfgi-pa4u-s4fg
ubuntu.com/security/CVE-2026-126192
people.ubuntu.com/~ubuntu-security/cve/CVE-2026-126192
github.com/facelessuser/soupsieve
cve.org/CVERecord?id=CVE-2026-126192
Left out here: 5 versions. The JSON record has them.