MEDIUMCVSS v3.1 5.3Vulnerability

CVE-2026-126193

## Summary The Soup Sieve CSS selector parser recurses once per level of nested pseudo-class selector (`:is()`, `:not()`, `:where()`, `:has()`) without any limit on nesting depth. An unauthenticated attacker who can supply a CSS selector string to `soupsieve.compile()`, `soupsieve.select()`, or Beautiful Soup's `soup.select()` / `soup.select_one()` can force the parser to exceed Python's recursion limit with a small crafted input (about 1.6 KB, roughly 330 nesting levels), raising an uncontrolled `RecursionError`. Because this exception is not part of the parser's documented error contract, applications that catch only `ValueError` or `SelectorSyntaxError` see an unexpected failure of the request or task that parsed the selector. ## Root Cause The parser dispatches each opening pseudo-class token to `parse_pseudo_open`, which calls back into `parse_selectors` to parse the pseudo-class body. Every nesting level therefore adds Python stack frames, and no counter, depth guard, or `RecursionError` handler bounds this descent. The token-count guard `SELECTOR_LIMIT = 8192` (added for the earlier comma-separated-list memory issue) counts parsed tokens, not recursion depth; at the failing nesting depth the token count is only about 330, roughly four percent of that limit, so the guard never fires. The security invariant that untrusted selector input must not be able to exhaust interpreter resources is not enforced for nesting depth. ```text soupsieve/css_parser.py CSSParser.parse_pseudo_open (line 985): sel.selectors.append(self.parse_selectors(iselector, index, flags)) CSSParser.parse_selectors (line 1137): recursive target; dispatches pseudo-class tokens back into parse_pseudo_class -> parse_pseudo_open CSSParser.increment_count (lines 707-712): SELECTOR_LIMIT token guard; increments once per nesting level, cannot bound depth ``` ## Impact Any application that compiles or evaluates untrusted CSS selectors through Soup Sieve (directly or via Beautiful Soup) i

Properties

Severity
medium
Summary
Soup Sieve: Uncontrolled recursion in CSS parser lets nested pseudo-class selectors exhaust the Python call stack
Nvd fetched at
2026-11-14T00:40:25.638091+00:00
Epss score
0.00308
Cvss severity
MEDIUM
Cvss score
5.3
Retrieved at
2026-11-14T00:51:03+00:00
Ghsa published
2026-11-13T16:34:59Z
Source url
https://github.com/advisories/GHSA-7g44-g9rc-x53w
Ghsa updated
2026-11-13T16:34:59Z
Ghsa id
GHSA-7g44-g9rc-x53w
Last source
FIRST EPSS
Score
5.3
Cvss version
3.1
Cve id
CVE-2026-126193
Cvss vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L
First seen by Signal
2026-11-12T19:59:23+00:00
Name
CVE-2026-126193
Is ghsa only
false
Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L

Related Entities (3)

AFFECTS (1)

→[Software]pip/soupsieve

HAS_WEAKNESS (1)

VULNERABLE_TO (1)

←[Software]pip/soupsieve

Related research

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-126193 (CVSS v3.1 5.3) — Ninja Signal Threat Intelligence | Ninja Signal