CVE-2026-126190: 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(), selectone(), 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.
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Soup Sieveto a version that resolves this vulnerability.Fixed in 4.0
Event History
Frequently Asked Questions
Which applications are realistically exposed to this issue?
Applications are exposed when they process attacker-influenced HTML or XML with Soup Sieve CSS selection APIs, including select(), select_one(), or Beautiful Soup CSS APIs, using selectors with descendant combinators such as "section div div". Processing trusted documents only is not affected.
What does an attacker need to do to trigger the issue?
An attacker needs to supply deeply nested HTML or XML that the application processes with an affected descendant-combinator selector. No authentication or user interaction is required according to the provided severity vector.
What is the impact of successful exploitation?
Repeated ancestor traversal can occupy a worker for seconds or minutes, causing a denial-of-service condition. The provided vector indicates availability impact without confidentiality or integrity impact.
What should be done if upgrading is not immediately possible?
Avoid applying descendant-combinator selectors to untrusted documents, especially against deeply nested input, and restrict processing to trusted documents where feasible. Selectors compiled with NOCACHE continue to use the old uncached behavior.
How can teams determine whether they remain affected after remediation?
Soup Sieve versions prior to 4.0 are affected. Upgrading to version 4.0 addresses the issue, but use of selectors compiled with NOCACHE continues to invoke the old uncached behavior.