CVE-2026-126190
Soup Sieve: Polynomial-time denial of service in the descendant combinator
CVE-2026-126190 is a high vulnerability (CVSS 7.5) 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.54%, the 45th percentile. Fixed in soupsieve 4.0.0.
- Severity
- 7.5 HighCVSS 3.1, CVE List
- Exploit chance
- 0.54%EPSS, 45th percentile
- Exploitation
- None knownNot on CISA’s or ENISA’s lists
- Fixed in
4.0.0soupsieve +31 more
Description
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
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
- High
Exploit likelihood
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
soupsievePyPI | before 4.0.0 | 4.0.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 |
airflowDocker Hardened Images:Debian:13 | Listed versions 3.3.0-03.3.0-13.3.0-23.3.0-33.3.1-0 Show 43 moreShow less3.3.1-13.3.1-103.3.1-113.3.1-123.3.1-133.3.1-143.3.1-153.3.1-23.3.1-33.3.1-43.3.1-53.3.1-63.3.1-73.3.1-83.3.1-93.3.2-03.3.2-13.3.2-103.3.2-113.3.2-123.3.2-133.3.2-143.3.2-153.3.2-163.3.2-173.3.2-183.3.2-193.3.2-23.3.2-33.3.2-43.3.2-53.3.2-63.3.2-73.3.2-83.3.2-93.4.0-03.4.0-13.4.0-23.4.0-33.4.0-43.4.0-53.4.0-63.4.0-7 | None known |
datadog-agent-core-7-fipsDocker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-core-7Docker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
Show 22 moreShow less
| Package | Affected | Fixed |
|---|---|---|
datadog-agent-devDocker Hardened Images:Debian:13 | Listed versions 7.80.2-07.80.2-17.80.2-107.80.2-117.80.2-12 Show 29 moreShow less7.80.2-137.80.2-147.80.2-157.80.2-27.80.2-37.80.2-47.80.2-57.80.2-67.80.2-77.80.2-87.80.2-97.84.4-07.84.6-07.84.6-17.84.6-27.85.0-07.85.1-07.85.1-17.85.2-07.85.2-17.85.2-27.85.3-07.85.4-07.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-fips-devDocker Hardened Images:Debian:13 | Listed versions 7.80.2-07.80.2-17.80.2-107.80.2-117.80.2-12 Show 28 moreShow less7.80.2-137.80.2-147.80.2-27.80.2-37.80.2-47.80.2-57.80.2-67.80.2-77.80.2-87.80.2-97.84.4-07.84.6-07.84.6-17.84.6-27.85.0-07.85.1-07.85.1-17.85.2-07.85.2-17.85.2-27.85.3-07.85.4-07.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-fipsDocker Hardened Images:Debian:13 | Listed versions 7.80.2-07.80.2-17.80.2-107.80.2-117.80.2-12 Show 28 moreShow less7.80.2-137.80.2-147.80.2-27.80.2-37.80.2-47.80.2-57.80.2-67.80.2-77.80.2-87.80.2-97.84.4-07.84.6-07.84.6-17.84.6-27.85.0-07.85.1-07.85.1-17.85.2-07.85.2-17.85.2-27.85.3-07.85.4-07.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-integrations-7Docker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.1-17.85.2-07.85.2-17.85.3-0 Show 5 moreShow less7.85.4-07.85.4-17.85.4-27.85.4-37.85.4-4 | None known |
datadog-agent-jmxfetch-7Docker Hardened Images:Debian:13 | Listed versions 0.52.0-00.52.0-10.52.0-20.52.0-30.52.0-40.52.0-5 | None known |
datadog-agent-process-7-fipsDocker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-process-7Docker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-security-7-fipsDocker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-security-7Docker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-trace-7-fipsDocker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agent-trace-7Docker Hardened Images:Debian:13 | Listed versions 7.85.1-07.85.2-07.85.2-17.85.3-07.85.4-0 Show 6 moreShow less7.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | None known |
datadog-agentDocker Hardened Images:Debian:13 | Listed versions 7.80.2-07.80.2-17.80.2-107.80.2-117.80.2-12 Show 29 moreShow less7.80.2-137.80.2-147.80.2-157.80.2-27.80.2-37.80.2-47.80.2-57.80.2-67.80.2-77.80.2-87.80.2-97.84.4-07.84.6-07.84.6-17.84.6-27.85.0-07.85.1-07.85.1-17.85.2-07.85.2-17.85.2-27.85.3-07.85.4-07.85.4-17.85.4-27.85.4-37.85.4-47.85.4-57.85.4-6 | 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 |
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 4.0.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.102.22.2.12.32.3.12.3.22.3.2.post12.42.4.12.52.62.72.82.8.1 | 4.0.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 7.5
Soup Sieve: Polynomial-time denial of service in the descendant combinator
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
CVE-2026-126190- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-12
EUVDEUVD-2026-124549 7.5
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
EUVD-2026-124549- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-13
GitHub AdvisoriesGHSA-mmhr-3c5m-f64f 7.5
Soup Sieve: Polynomial-time denial of service in the descendant combinator
Summary
Matching a selector that uses the descendant combinator (a b) takes time that grows polynomially with how deeply the document is nested, and each extra descendant combinator in the selector raises the degree by one. A selector with k descendant combinators takes O(n^(k+1)) time on a chain of n nested elements.
An attacker who controls the HTML or XML that an application passes to Soup Sieve (directly, or through Beautiful Soup's select(), select_one(), css.select(), etc.) can send a very small, deeply nested document that keeps a CPU busy for seconds to minutes against an ordinary selector such as section div div.
Details
To match a b, Soup Sieve checks each element against b and then walks up through its ancestors looking for one that matches a. When the selector has more descendant combinators, the rest of the selector is tried again from each ancestor on that walk, and so on for every combinator. Nothing was reused between walks, so the same ancestors were matched against the same part of the selector over and over.
The worst case is when the leftmost part of the selector never matches, as in section div div against a document of nested <div> with no <section>: every walk goes all the way to the root and no search can stop early.
Timings
Example timings with html.parser on Soup Sieve 3.0.4 and 4.0, using a document of nested <div> (5 bytes each) and no matches:
| Nesting depth | Input size | Selector | 3.0.4 | 4.0 |
| --- | --- | --- | --- | --- |
| 2,000 | 10 KB | section div | 1.6 s | 0.05 s |
| 4,000 | 20 KB | section div | 5.1 s | 0.01 s |
| 400 | 2 KB | section div div | 6.7 s | < 0.01 s |
| 800 | 4 KB | section div div | 53.0 s | < 0.01 s |
| 100 | 0.5 KB | section div div div | 2.5 s | < 0.01 s |
| 200 | 1 KB | section div div div | 40.9 s | < 0.01 s |
None of these selectors use unusual syntax.
Proof of concept
import time
import bs4
import soupsieve as sv
soup = bs4.BeautifulSoup('<div>' * 200, 'html.parser')
t = time.process_time()
sv.select('section div div div', soup)
print(time.process_time() - t)
On affected versions, doubling the nesting depth multiplies the time by about 2^(k+1), where k is the number of descendant combinators: about 4x for section div, 8x for section div div, and 16x for section div div div.
Impact
Applications are affected if they run selectors with descendant combinators against documents that untrusted users can influence, such as scrapers, HTML sanitizers or filters, and services that process uploaded or fetched markup. Descendant combinators are among the most common parts of CSS selectors, and a document of about 1 KB is enough to tie up a worker for close to a minute. Applications that only run selectors against trusted documents are not affected.
Patches
Fixed in 4.0 by facelessuser/soupsieve#351. Whether an element is, or has an ancestor that is, a match for part of a selector depends only on its parent, so Soup Sieve now caches that result per element and relation for every element visited on the walk. Each descendant combinator is then linear in the size of the document. Results are unchanged, and ordinary documents are no slower.
Caching is enabled by default, so no changes are needed beyond upgrading. The NOCACHE flag is a temporary fallback for users who run into problems with caching, and it is planned for removal. It uses the old uncached matching, so selectors compiled with NOCACHE are still subject to polynomial time and shouldn't be used with descendant combinators on untrusted input.
Workarounds
If users can't upgrade:
- Use as few descendant combinators as they can in selectors that run on untrusted documents. Where the structure of the
document is known, the child combinator (
a > b) only looks at the parent and is not affected. - Limit the size and nesting depth of untrusted documents before…
- Record
GHSA-mmhr-3c5m-f64f- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-13
NVD 7.5
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
CVE-2026-126190- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-12
OSV 7.5
Soup Sieve: Polynomial-time denial of service in the descendant combinator
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
CVE-2026-126190- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-14
OSVDEBIAN-CVE-2026-126190 7.5
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
DEBIAN-CVE-2026-126190- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-15
Show 4 moreShow less
OSVDHI-ihf5-jpok-bozg-kgyb 7.5
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly…
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
DHI-ihf5-jpok-bozg-kgyb- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-16
OSVGHSA-mmhr-3c5m-f64f 7.5
Soup Sieve: Polynomial-time denial of service in the descendant combinator
Summary
Matching a selector that uses the descendant combinator (a b) takes time that grows polynomially with how deeply the document is nested, and each extra descendant combinator in the selector raises the degree by one. A selector with k descendant combinators takes O(n^(k+1)) time on a chain of n nested elements.
An attacker who controls the HTML or XML that an application passes to Soup Sieve (directly, or through Beautiful Soup's select(), select_one(), css.select(), etc.) can send a very small, deeply nested document that keeps a CPU busy for seconds to minutes against an ordinary selector such as section div div.
Details
To match a b, Soup Sieve checks each element against b and then walks up through its ancestors looking for one that matches a. When the selector has more descendant combinators, the rest of the selector is tried again from each ancestor on that walk, and so on for every combinator. Nothing was reused between walks, so the same ancestors were matched against the same part of the selector over and over.
The worst case is when the leftmost part of the selector never matches, as in section div div against a document of nested <div> with no <section>: every walk goes all the way to the root and no search can stop early.
Timings
Example timings with html.parser on Soup Sieve 3.0.4 and 4.0, using a document of nested <div> (5 bytes each) and no matches:
| Nesting depth | Input size | Selector | 3.0.4 | 4.0 |
| --- | --- | --- | --- | --- |
| 2,000 | 10 KB | section div | 1.6 s | 0.05 s |
| 4,000 | 20 KB | section div | 5.1 s | 0.01 s |
| 400 | 2 KB | section div div | 6.7 s | < 0.01 s |
| 800 | 4 KB | section div div | 53.0 s | < 0.01 s |
| 100 | 0.5 KB | section div div div | 2.5 s | < 0.01 s |
| 200 | 1 KB | section div div div | 40.9 s | < 0.01 s |
None of these selectors use unusual syntax.
Proof of concept
import time
import bs4
import soupsieve as sv
soup = bs4.BeautifulSoup('<div>' * 200, 'html.parser')
t = time.process_time()
sv.select('section div div div', soup)
print(time.process_time() - t)
On affected versions, doubling the nesting depth multiplies the time by about 2^(k+1), where k is the number of descendant combinators: about 4x for section div, 8x for section div div, and 16x for section div div div.
Impact
Applications are affected if they run selectors with descendant combinators against documents that untrusted users can influence, such as scrapers, HTML sanitizers or filters, and services that process uploaded or fetched markup. Descendant combinators are among the most common parts of CSS selectors, and a document of about 1 KB is enough to tie up a worker for close to a minute. Applications that only run selectors against trusted documents are not affected.
Patches
Fixed in 4.0 by facelessuser/soupsieve#351. Whether an element is, or has an ancestor that is, a match for part of a selector depends only on its parent, so Soup Sieve now caches that result per element and relation for every element visited on the walk. Each descendant combinator is then linear in the size of the document. Results are unchanged, and ordinary documents are no slower.
Caching is enabled by default, so no changes are needed beyond upgrading. The NOCACHE flag is a temporary fallback for users who run into problems with caching, and it is planned for removal. It uses the old uncached matching, so selectors compiled with NOCACHE are still subject to polynomial time and shouldn't be used with descendant combinators on untrusted input.
Workarounds
If users can't upgrade:
- Use as few descendant combinators as they can in selectors that run on untrusted documents. Where the structure of the
document is known, the child combinator (
a > b) only looks at the parent and is not affected. - Limit the size and nesting depth of untrusted documents before…
- Record
GHSA-mmhr-3c5m-f64f- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Weakness
- CWE-407
- Updated
- 2026-11-13
OSVUBUNTU-CVE-2026-126190 7.5
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
UBUNTU-CVE-2026-126190- CVSS 3.1
- 7.5 High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H - Updated
- 2026-11-13
OSVAZL-113911No score
CVE-2026-126190 affecting package python-soupsieve 2.6-3
Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0, Soup Sieve repeatedly walks the same ancestors while matching descendant combinators, and each additional descendant combinator raises the polynomial degree of the work on deeply nested attacker-influenced HTML or XML. Applications using selectors such as section div div through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while trusted-only document processing is not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.
- Record
AZL-113911- Updated
- 2026-11-15
History
| Recorded | Changed | Sources |
|---|---|---|
| affected, aliases, references | OSV | |
| affected, aliases, references | OSV | |
| affected, aliases, references | OSV | |
| published | EUVD | |
| affected, aliases, references | OSV | |
| references | OSV | |
| published | EUVD | |
| affected, aliases, facts, references | GitHub Advisories, OSV | |
| aliases, published | EUVD, NVD | |
| first indexed | CVE List |
Dates are when Every CVE recorded each change. Upstream dates may differ.
References
github.com/facelessuser/soupsieve/security/advisories/GHSA-mmhr-3c5m-f64f
github.com/facelessuser/soupsieve/pull/351
github.com/facelessuser/soupsieve/commit/ff1a5ce7e5addc31626d7b6053511fecdb4f6320
github.com/facelessuser/soupsieve/releases/tag/4.0
nvd.nist.gov/vuln/detail/CVE-2026-126190
github.com/advisories/GHSA-mmhr-3c5m-f64f
Show 7 moreShow less
github.com/CVEProject/cvelistV5/tree/main/cves/2026/126xxx/CVE-2026-126190.json
security-tracker.debian.org/tracker/CVE-2026-126190
scout.docker.com/v/DHI-ihf5-jpok-bozg-kgyb
ubuntu.com/security/CVE-2026-126190
people.ubuntu.com/~ubuntu-security/cve/CVE-2026-126190
github.com/facelessuser/soupsieve
cve.org/CVERecord?id=CVE-2026-126190
Left out here: 11 versions and the rest of 2 source descriptions. The JSON record has them.