{"id":"CVE-2026-126191","aliases":["CVE-2026-126191","GHSA-6655-6qjp-jx7x"],"related":[],"kind":"vulnerability","state":"published","title":"Soup Sieve: Exponential ReDoS in selector compilation via \\9-run in CSS_ESCAPES/IDENTIFIER","summary":"Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 3.0, the CSS_ESCAPES and IDENTIFIER regular-expression subpatterns can backtrack exponentially on runs of ambiguous digit escapes in an attribute-name or tag position of an otherwise valid selector. The failure occurs during selector compilation through soupsieve.compile() or Beautiful Soup select() before SELECTOR_LIMIT is applied, so an application that accepts untrusted selector strings can have a worker stalled by a short input. This issue is fixed in version 3.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Soup Sieve is a CSS selector library designed to be used with Beautiful Soup 4. Prior to 3.0, the CSS_ESCAPES and IDENTIFIER regular-expression subpatterns can backtrack exponentially on runs of ambiguous digit escapes in an attribute-name or tag position of an otherwise valid selector. The failure occurs during selector compilation through soupsieve.compile() or Beautiful Soup select() before SELECTOR_LIMIT is applied, so an application that accepts untrusted selector strings can have a worker stalled by a short input. This issue is fixed in version 3.0.","source":"cvelist"},{"lang":"en","text":"### 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.","format":"markdown","source":"ghsa"}],"published":"2026-11-12T16:57:01.566Z","modified":"2026-11-13T19:19:23.660Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-1333"],"affected":[{"ranges":[{"version":"< 3.0","status":"affected"}],"vendor":"facelessuser","product":"soupsieve","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.0.2"}],"ecosystem":"PyPI","package":"soupsieve","purl":"pkg:pypi/soupsieve","source":"ghsa"}],"references":[{"url":"https://github.com/facelessuser/soupsieve/security/advisories/GHSA-6655-6qjp-jx7x","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/facelessuser/soupsieve/pull/300","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/facelessuser/soupsieve/commit/dbfa2854ff31a863326bd6660d4e55c6f068db9e","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/facelessuser/soupsieve/releases/tag/3.0","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126191","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/facelessuser/soupsieve","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-11-13T18:52:59.234Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-126191","url":"https://www.cve.org/CVERecord?id=CVE-2026-126191","licence":"CVE Terms of Use","modified":"2026-11-13T18:54:06.385Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-6655-6qjp-jx7x","url":"https://github.com/advisories/GHSA-6655-6qjp-jx7x","licence":"CC-BY-4.0","modified":"2026-11-13T16:45:03.387Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-126191","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-126191","licence":"Public domain","modified":"2026-11-13T19:19:23.660Z"}],"updatedAt":"2026-11-25T22:59:50.539Z","epss":{"score":0.00569,"percentile":0.4849,"date":"2026-12-01T12:00:22.000Z"}}