Skip to content
Threat Brief

← All advisories

CVE-2026-126192

Medium 6.3No known exploitationFix available

Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time

Vendor advisory: GHSA-4j63-6c4x-wfg4

Record last updated

CVSS score

6.3

Medium on a 0 to 10 scale

EPSS, chance of exploitation in 30 days

None

No EPSS score available

CISA remediation deadline

None

Not in the KEV catalog

Description

## Summary Matching a selector that puts a general-sibling combinator inside `:has()`, such as `div:has(a ~ b)`, against untrusted HTML runs in O(n²) time in the number of sibling elements. A single small document with a few thousand siblings ties the process up for a minute of CPU, so an application that runs a fixed selector of this shape over HTML it doesn't control can be stalled by one request. `:has` is powerful, but much in the same way poor regular expressions can be crafted to cause catastrophic backtracking with greedy capturing, has can be used to create non-ideal scenarios that can cause large portions of the tree to be evaluated for one or many elements if not used thoughtfully. This behavior is not exclusive to Soup Sieve, but browsers make note of these potential performance issues themselves: https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Selectors/:has#performance_considerations. With all of that said, there is room for improvements that can in some cases greatly improve performance. ## Details `:has(a ~ b)` asks "does this element contain an `a` that has a later sibling `b`?". When no `b` is present, soupsieve can't short-circuit, and it answers the q…

Weakness: CWE-400, CWE-407

Patching and mitigation

Patch status
Fix available (source: Microsoft MSRC)
Fix documented (source date)
Mitigation
None documented
Vendor guidance
msrc.microsoft.com (opens in a new tab)

Affected products

VendorProductAffected versionsFixed inPer
Microsoftazl4 python-soupsieve 2.8.2-4.azl4 on Azure Linux 4.0Not documentedNot documentedMicrosoft MSRC
pipsoupsieveall versions up to and including 2.9.22.10.0GitHub Advisory Database

Timeline

  1. Advisory

    Microsoft advisory published

    Source: Microsoft MSRC (opens in a new tab)

  2. Patch

    Fix documented by Microsoft MSRC

    Source: Microsoft MSRC (opens in a new tab)

Vendor guidance and references