Vulnerabilities in pkg:pypi/soupsieve

PACKAGE
Advisory Identifier: GHSA-6655-6qjp-jx7x
Advisory Summary

CVE-2026-126191 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Soup Sieve libraries in the PyPI ecosystem. The issue involves exponential redos in selector compilation via \9-run in css_escapes/identifier. Remediation is available by upgrading affected packages to version 3.0.2.

6 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/soupsieve

6 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/soupsieve. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6655-6qjp-jx7x CVE-2026-126191 HIGH Soup Sieve: Exponential ReDoS in selector compilation via \9-run in CSS_ESCAPES/IDENTIFIER
GHSA-7g44-g9rc-x53w CVE-2026-126193 MODERATE Soup Sieve: Uncontrolled recursion in CSS parser lets nested pseudo-class selectors exhaust the Python call stack
GHSA-gjv8-xp57-g29c CVE-2026-86000 MODERATE Soup Sieve: Polynomial-time ReDoS (O(n²)) in the `IDENTIFIER` / `VALUE` selector sub-patterns
GHSA-j934-xhv5-fg8f CVE-2026-85999 MODERATE Soup Sieve: Polynomial-time ReDoS (O(n²)) in the whitespace/comment trimming regex `RE_WS_END` (triggers on VALID selectors)
GHSA-836r-79rf-4m37 CVE-2026-49477 HIGH Soup Sieve: Regular Expression Denial of Service (ReDoS) via Selector Parser
GHSA-2wc2-fm75-p42x CVE-2026-49476 HIGH Soup Sieve has Memory Exhaustion via Large Comma-Separated Selector Lists

CVE-2026-126191 at a Glance

CVE Identifier CVE-2026-126191
GHSA Identifier GHSA-6655-6qjp-jx7x
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Soup Sieve
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-126191

To remediate this vulnerability, upgrade all affected Soup Sieve dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

soupsieve fixed: 3.0.2
pip install soupsieve>=3.0.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

pip show soupsieve

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2026-126191, inspect your installed packages using pip:

pip show soupsieve

Analyze the terminal output to locate any version of Soup Sieve in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.2), your application is affected.

Note: The pip show soupsieve command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Soup Sieve, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary The IDENTIFIER/CSS_ESCAPES regex (css_parser.py:119-124) exhibits exponential backtracking on a run of ambiguous digit-escapes (`\9`) in an attribute-name or tag position of an otherwise well-formed selector. It fires at compile time (before the SELECTOR_LIMIT guard) via the public `soupsieve.compile()` and BeautifulSoup `.select()`. ### PoC (verified on soupsieve 2.9.2) import soupsieve as sv sv.compile('[a' + '\\9'*26 + '=x]') # ~57 bytes -> ~10s; ~16x time per +4 chars ### Novelty Distinct from the patched GHSA-836r-... (VALUE regex) and GHSA-2wc2-... (comma-list) advisories, which are fixed in 2.9.2; this is a different regex/vector. ### Reachability CSS selectors are usually developer-controlled, so exposure requires an application that compiles UNTRUSTED selector strings (web-scraping-as-a-service, no-code/query builders, user-defined extraction rules). Where selectors are user-supplied, a ~60-byte string hangs the worker. ### Note This issue was fixed in version 3.0.0, which has been yanked from the PyPI registry. Use versions 3.0.2 and above to upgrade.

CVE-2026-126191 Affected Soup Sieve Versions

1 component(s)
Fixed Versions:
3.0.2
Product / Package Ecosystem Affected Versions Fixed Version
soupsieve
PyPI
< 3.0.2
3.0.2

References

Frequently Asked Questions

What is CVE-2026-126191?
CVE-2026-126191 is a security vulnerability in Soup Sieve involving Exponential ReDoS in selector compilation via \9-run in CSS_ESCAPES/IDENTIFIER under CWE-1333: Inefficient Regular Expression Complexity.
Which Soup Sieve versions are affected?
Affected versions include releases prior to 3.0.2 across affected packages: soupsieve.
What version fixes CVE-2026-126191?
Upgrading to 3.0.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is soupsieve affected?
Yes, soupsieve is affected in releases prior to 3.0.2. Upgrade your dependency to 3.0.2 or later.
What is the CVSS score of CVE-2026-126191?
CVE-2026-126191 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-126191?
CVE-2026-126191 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check PyPI dependencies for CVE-2026-126191?
Run the dependency tree command: 'pip show soupsieve'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6655-6qjp-jx7x",
  "modified" : "2026-11-13T16:39:43Z",
  "published" : "2026-11-13T16:39:43Z",
  "aliases" : [ "CVE-2026-126191" ],
  "summary" : "Soup Sieve: Exponential ReDoS in selector compilation via \\9-run in CSS_ESCAPES/IDENTIFIER",
  "details" : "### Summary\nThe IDENTIFIER/CSS_ESCAPES regex (css_parser.py:119-124) exhibits exponential backtracking on a run of ambiguous digit-escapes (`\\9`) in an attribute-name or tag position of an otherwise well-formed selector. It fires at compile time (before the SELECTOR_LIMIT guard) via the public `soupsieve.compile()` and BeautifulSoup `.select()`.\n\n### PoC (verified on soupsieve 2.9.2)\n\n    import soupsieve as sv\n    sv.compile('[a' + '\\\\9'*26 + '=x]')   # ~57 bytes -> ~10s; ~16x time per +4 chars\n\n### Novelty\nDistinct from the patched GHSA-836r-... (VALUE regex) and GHSA-2wc2-... (comma-list) advisories, which are fixed in 2.9.2; this is a different regex/vector.\n\n### Reachability\nCSS selectors are usually developer-controlled, so exposure requires an application that compiles UNTRUSTED selector strings (web-scraping-as-a-service, no-code/query builders, user-defined extraction rules). Where selectors are user-supplied, a ~60-byte string hangs the worker.\n\n### Note\nThis issue was fixed in version 3.0.0, which has been yanked from the PyPI registry. Use versions 3.0.2 and above to upgrade.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "soupsieve"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.2"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 2.10"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/facelessuser/soupsieve/security/advisories/GHSA-6655-6qjp-jx7x"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-126191"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/facelessuser/soupsieve/pull/300"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/facelessuser/soupsieve/commit/dbfa2854ff31a863326bd6660d4e55c6f068db9e"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/facelessuser/soupsieve"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/facelessuser/soupsieve/releases/tag/3.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-13T16:39:43Z",
    "nvd_published_at" : "2026-11-12T17:17:32Z"
  }
}