GHSA-8jvp-3x96-xpqw: 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 OSV·04:53 PM
Data Sourced
via OSV·04:53 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed to this denial-of-service risk?

Applications that run Soup Sieve selectors containing :has() against attacker-influenced HTML or XML are exposed, including use through select(), select_one(), or Beautiful Soup CSS APIs. Processing only trusted documents is not affected.

2

What input and selector conditions are needed to trigger the issue?

An attacker needs to supply deeply nested or wide HTML or XML that is evaluated with a selector using :has(). Ordinary fixed selectors can be affected; the selector does not need to be attacker-controlled.

3

What is the operational impact of successful exploitation?

Quadratic selector matching can occupy a worker for seconds or minutes, causing a denial of service. The reported impact is availability only, with no confidentiality or integrity impact.

4

Does the fix apply when selectors are compiled with NOCACHE?

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

5

How can I determine whether an application is affected?

Review whether the application uses Soup Sieve versions before 4.0.1 and evaluates :has() selectors against untrusted HTML or XML. Also check for selectors compiled with NOCACHE, which retain the old behavior.

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