CVE-2026-126192: Soup Sieve: General sibling combinator inside :has() matches untrusted HTML in quadratic time
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.
References
- github.com/advisories/GHSA-4j63-6c4x-wfg4
- github.com/facelessuser/soupsieve/commit/ffb88cca745c591224f74a8e86414a85e8f35fc0
- github.com/facelessuser/soupsieve/pull/304
- github.com/facelessuser/soupsieve/releases/tag/2.10
- github.com/facelessuser/soupsieve/security/advisories/GHSA-4j63-6c4x-wfg4
- nvd.nist.gov/vuln/detail/CVE-2026-126192
Code Behaviors & Features
Detect and mitigate CVE-2026-126192 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →