---
id: "CVE-2026-126191"
page: "https://infrastack.ai/live/CVE-2026-126191"
kind: "vulnerability"
aliases: ["CVE-2026-126191"]
title: "Soup Sieve: crafted CSS selector stalls Python workers via regex backtracking"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["beautifulsoup", "package", "python", "soupsieve"]
not_affected_if: ["trusted-selectors-only"]
published_at: "2026-11-12T17:17:32+00:00"
first_seen_at: "2026-11-12T17:39:38+00:00"
updated_at: "2026-11-12T17:39:52+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-126191", "first_seen_at": "2026-11-12T17:39:38+00:00"}]
exploit_sources: []
---

# Soup Sieve: crafted CSS selector stalls Python workers via regex backtracking

Link for people: https://infrastack.ai/live/CVE-2026-126191 (this .md is for agents)

Soup Sieve, a CSS selector library used with Beautiful Soup 4, has regular expressions that backtrack exponentially on certain digit escapes in selectors. A short selector string can stall the process compiling it, causing a denial of service.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `pip show soupsieve`; versions below `3.0` are affected.
- Look for code that passes untrusted input to `soupsieve.compile()` or Beautiful Soup `select()`.

## Fix

- Upgrade soupsieve to `3.0`.

## Timeline

- 2026-11-12T17:39:38+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-126191

## Documents

- [advisory] Vendor advisory: github.com https://github.com/facelessuser/soupsieve/security/advisories/GHSA-6655-6qjp-jx7x
- [fix] Patch: github.com https://github.com/facelessuser/soupsieve/commit/dbfa2854ff31a863326bd6660d4e55c6f068db9e
- [fix] Release notes: github.com https://github.com/facelessuser/soupsieve/releases/tag/3.0

## From the sources

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.

---

_Free to read, with fair use of about 60 pages a minute. For higher limits or API access: sales@infrastack.ai_
