CVE-2026-126190
## 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 ```py import time import bs4 import soupsieve as sv soup = bs4.Beauti
Properties
- Severity
- high
- Summary
- Soup Sieve: Polynomial-time denial of service in the descendant combinator
- Nvd fetched at
- 2026-11-14T00:40:25.638091+00:00
- Epss score
- 0.00538
- Cvss severity
- HIGH
- Cvss score
- 7.5
- Retrieved at
- 2026-11-14T00:51:03+00:00
- Ghsa published
- 2026-11-13T00:49:46Z
- Source url
- https://github.com/advisories/GHSA-mmhr-3c5m-f64f
- Ghsa updated
- 2026-11-13T00:49:47Z
- Ghsa id
- GHSA-mmhr-3c5m-f64f
- Last source
- FIRST EPSS
- Score
- 7.5
- Cvss version
- 3.1
- Cve id
- CVE-2026-126190
- Cvss vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- First seen by Signal
- 2026-11-12T19:59:23+00:00
- Name
- CVE-2026-126190
- Is ghsa only
- false
- Vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Related Entities (3)
AFFECTS (1)
HAS_WEAKNESS (1)
VULNERABLE_TO (1)
Related research
Explore deeper with Ninja Signal's threat intelligence graph