CVE-2026-126189: Soup Sieve: Quadratic-time denial of service when matching `:has()`

Published Nov 12, 2026
·
Updated

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(), selectone(), 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.

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Soup Sieve to a version that resolves this vulnerability.

    Fixed in 4.0.1

Event History

Nov 12, 2026
CVE Published
via MITRE·04:53 PM
Data Sourced
via MITRE·04:53 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·05:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are realistically exposed to this issue?

Applications that run Soup Sieve selectors containing :has() against attacker-influenced HTML or XML are exposed, including when using select(), select_one(), or Beautiful Soup CSS APIs with ordinary fixed selectors. Applications that process only trusted documents are not affected.

2

What does an attacker need to do to trigger the denial of service?

An attacker needs to supply a deeply nested or wide HTML or XML document that is processed with a selector using :has(). No authentication or user interaction is required according to the provided vector.

3

What should be done if upgrading cannot happen immediately?

Avoid applying selectors containing :has() to untrusted documents until Soup Sieve can be updated. Restricting processing to trusted documents also avoids the affected scenario.

4

Are selectors compiled with NOCACHE protected by the fix?

No. Selectors compiled with NOCACHE continue to use the old uncached behavior.

5

What version fixes the issue?

The issue is fixed in Soup Sieve version 4.0.1.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203