Read the docs

Soup Sieve: Quadratic-time denial of service when matching :has()

Priority MEDIUM 63CWE-407Published · Updated

Key facts

Attack vector
Network
Privileges required
None
User interaction
None
Attack complexity
Low
Impact type
Denial of service
Confidentiality · integrity · availability
None · None · Low
Fix status
Fixed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-407.

Summary

Soup Sieve, a CSS selector library used with Beautiful Soup 4, is affected before 4.0.1. Its :has() matching repeatedly searches descendant subtrees and reevaluates parent elements for each child, which is an inefficient algorithmic complexity flaw (CWE-407). An unauthenticated remote attacker can supply crafted deeply nested or wide HTML or XML so that matching takes quadratic time and occupies a worker for seconds or minutes. Applications that process only trusted documents are not affected, and selectors compiled with NOCACHE keep the old uncached behavior.

Written with Claude Haiku 5.5 from the sources below · 2026-11-16

Description from the CNA

Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 4.0.1, Soup Sieve repeatedly searches descendant subtrees for each candidate evaluated by :has() and repeatedly reevaluates a parent containing :has(> ...) for each child, causing quadratic matching on deeply nested or wide attacker-influenced HTML or XML. Applications using ordinary fixed selectors through select(), select_one(), or Beautiful Soup CSS APIs against untrusted documents can have a worker occupied for seconds or minutes, while applications that process only trusted documents are not affected. Selectors compiled with NOCACHE continue to use the old uncached behavior. This issue is fixed in version 4.0.1.

Why it matters now

Exploitation Proof of concept CISA SSVC · not in CISA KEV
EPSS 0.00301 23rd percentileScored 2026-11-16
Fix Fixed soupsieve (facelessuser): 4.0.1

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
Poc
Automatable
Yes
Technical impact
Partial

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
facelessusersoupsievebefore 4.0.14.0.1Patch availableCNA
  • soupsieve Vendorfacelessuser Affected before 4.0.1 Fixed in 4.0.1 Patch available CNA

Remediation

Upgrade facelessuser soupsieve to version 4.0.1, which fixes the issue.

Written with Claude Haiku 5.5 from the sources below · 2026-11-16

  • Fix · CNA soupsieve (facelessuser) Fixed in 4.0.1

Timeline

  1. 2026-11-12 Threatist record created from CVE-2026-126189
  2. 2026-11-16 CISA SSVC decision points changed

References

  • TI-2026-90415 Soup Sieve exponential ReDoS in selector compilation via \9-run CVSS 3.1HIGH 7.5
  • TI-2026-47703 pymdown-extensions: Exponential-backtracking ReDoS in caret, tilde, betterem, and magiclink inline processors CVSS 3.1HIGH 7.5
  • TI-2026-36631 Soup Sieve: Regular Expression Denial of Service (ReDoS) in soupsieve Selector Parser CVSS 3.1HIGH 7.5
  • TI-2026-36630 Soup Sieve: Memory Exhaustion via Large Comma-Separated Selector Lists in soupsieve CVSS 3.1HIGH 7.5
  • TI-2023-15603 Arbitrary file inclusion with the pymdowm-snippets extension CVSS 3.1HIGH 7.5
  • TI-2026-90424 Uncontrolled recursion in Soup Sieve lets selectors exhaust stack CVSS 3.1MEDIUM 5.3
See all 13 →

Sources

This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences