CVE-2026-85999 Soup Sieve: Polynomial-time ReDoS (O(n²)) in the whitespace/comment trimming regex `RE_WS_END` (triggers on VALID selectors)

Medium 5.3 Published Updated

An attacker can cause a denial of service in applications using Soup Sieve by providing crafted CSS selectors that trigger quadratic CPU consumption during parsing.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-85999?

CVE-2026-85999 is a medium-severity denial of service vulnerability in facelessuser soupsieve, published on 17 Sep 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 2.9, selector_iter in src/soupsieve/css_parser.py trims the raw selector with RE_WS_END, an end-anchored WSC whitespace-and-comment expression used with search(), so the regular expression engine retries a greedy scan at every starting offset. An attacker-controlled valid selector containing a long internal whitespace run, or a selector containing a long CSS comment run followed by another token, causes quadratic CPU work before tokenization. User-controlled selectors can reach the path through soupsieve.compile() and BeautifulSoup.select(), while applications using only hard-coded selectors are unaffected. This root cause is separate from the IDENTIFIER and VALUE backtracking vulnerability because the cost occurs in RE_WS_END.search during trimming rather than token matching. The resulting CPU consumption can hold the Python GIL, exhaust workers, and stall a service without causing memory corruption or code execution. The issue is fixed in version 2.9.

Weakness: CWE-400, CWE-1333

Which versions are affected by CVE-2026-85999?

3 open source packages ship an affected version, including soupsieve.

PackageAffectedFixed in
soupsieve PyPIAll versions2.9.0
soupsieve PyPIAll versions2.9.0
soupsieve PyPIAll versions2.9.0

How do I fix CVE-2026-85999?

Upgrade soupsieve to 2.9.0 or later.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2026-85999 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-85999 exists.

Sources

Also known as AZL-103322, CLEANSTART-2026-IA02205, CLEANSTART-2026-RB27894, DEBIAN-CVE-2026-85999, ECHO-dfdf-dd36-a3ed, GHSA-j934-xhv5-fg8f and 9 more.

Is CVE-2026-85999 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free