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

- Severity: Medium 5.3 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.45%, higher than 41% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-11-12T16:53:00.822Z
- Modified: 2026-11-16T19:17:31.160Z
- Weaknesses: CWE-407
- SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- facelessuser soupsieve: < 4.0.1

## References

- <https://github.com/facelessuser/soupsieve/security/advisories/GHSA-8jvp-3x96-xpqw> (exploit)
- <https://github.com/facelessuser/soupsieve/pull/352>
- <https://github.com/facelessuser/soupsieve/commit/0469c148f5501ec2127e0d65b77c2a1c395fa379>
- <https://github.com/facelessuser/soupsieve/commit/305fbf6b8c1f6ff05fec55d1e5bb28d80d22de44>
- <https://github.com/facelessuser/soupsieve/releases/tag/4.0.1>

## Sources

- CVE List: [CVE-2026-126189](https://www.cve.org/CVERecord?id=CVE-2026-126189), CVE Terms of Use, modified 2026-11-16
- NVD: [CVE-2026-126189](https://nvd.nist.gov/vuln/detail/CVE-2026-126189), Public domain, modified 2026-11-16

---

Page: https://cve.day/CVE-2026-126189 · Whole record: https://cve.day/CVE-2026-126189.json · Rebuilt by cve.day 2026-11-25T22:59:50.538Z
