Skip to content

← Public intelligence

PyPI package

soupsieve

Open actionable advisories and recorded vendor fixes. This public package view has no inventory attached and cannot establish whether your deployment is affected. A vendor fix never resolves your finding; verify your installed version and the source guidance.

Open advisories

4 actionable advisories, newest first. Withdrawn advisories and news are excluded. Coverage is partial.

  1. Medium, CVSS 5.3PyPIAmendedPublished

    Soup Sieve: Polynomial-time ReDoS (O(n²)) in the IDENTIFIER / VALUE selector sub-patterns

    CVE-2026-86000 · GHSA-gjv8-xp57-g29c

    Affected
    • PyPI soupsieve < 2.9.0
    Fixed in
    2.9.0· Vendor fix available
    Issue
    soupsieve compiles CSS selector strings with a set of hand-written regular expressions. The shared IDENTIFIER sub-pattern (also embedded in VALUE, and therefore in attribute selectors) places two adjacent quantified groups over overlapping character classes: (?:[classA]|ESC)+(?:[classB]|ESC), where both classes match ordinary identifier characters such as a. When a selector contains a long identifier/value run that must ultimately fail to match (e.g. an attribute value with no closing ], or an identifier followed by an invalid character), the regex engine backtracks across all O(n) ways to split the run between the + group and the group, giving O(n²) parse time. A single attacker-controlled selector of a few kilobytes stalls the interpreter for many seconds of CPU; tens of kilobytes reach minutes. Trust model (Q0) The selector string is the input. It reaches this code via soupsieve.compile(), soupsieve.select/iselect/match/filter, and — most commonly — BeautifulSoup's…

    Recommended action: Upgrade to 2.9.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  2. Medium, CVSS 5.3PyPIAmendedPublished

    Soup Sieve: Polynomial-time ReDoS (O(n²)) in the whitespace/comment trimming regex RE_WS_END (triggers on VALID selectors)

    CVE-2026-85999 · GHSA-j934-xhv5-fg8f

    Affected
    • PyPI soupsieve < 2.9.0
    Fixed in
    2.9.0· Vendor fix available
    Issue
    Before tokenizing, selectoriter trims leading/trailing whitespace and comments by running two regexes over the whole raw selector with .search(). The trailing one, REWSEND = re.compile(r'{WSC}$'), is anchored only at the end ($), not the start. Because .search() retries the pattern at every offset, a long run of whitespace or CSS comments that is not sitting exactly at the end of the string makes each retry greedily consume the run and then fail $, producing O(n²) time. This triggers on perfectly valid selectors — e.g. a descendant combinator with a long whitespace gap, a + " "n + b — so no malformed input is required. A single valid ~20 KB selector stalls the interpreter for ~10 s of CPU. Trust model (Q0) The selector string is the input, reaching this code via soupsieve.compile(), the soupsieve.select/iselect/match/filter helpers, and BeautifulSoup's soup.select(selector) / soup.selectone(selector). Exploitable wherever an application passes a user-controlled CSS selector…

    Recommended action: Upgrade to 2.9.0 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:github.com (1)osv.dev (2)Source checked Evidence →
  3. High, CVSS 7.5PyPIAmendedPublished

    Soup Sieve: Regular Expression Denial of Service (ReDoS) via Selector Parser

    CVE-2026-49477 · GHSA-836r-79rf-4m37

    Affected
    • PyPI soupsieve <= 2.8.3
    Fixed in
    2.8.4· Vendor fix available
    Issue
    The CSS selector parser in soupsieve (the CSS selector engine for Beautiful Soup 4) contains a regular expression vulnerable to catastrophic backtracking. When processing an attribute selector with an unterminated quoted value, the VALUE regex pattern in cssparser.py enters exponential backtracking. A payload of only 300 bytes causes the regex engine to hang for over 3 seconds, enabling a trivial Regular Expression Denial of Service (ReDoS) attack. To be completely transparent, AI tools helped surface this issue. However, this was independently reproduced and carefully validated. Any application that passes untrusted CSS selector strings to soupsieve.compile() or Beautiful Soup's .select() / .selectone() is affected. Details Affected code: soupsieve/cssparser.py, line ~121 - REVALUES / VALUE regex pattern The soupsieve CSS parser uses a compiled regular expression to tokenise attribute selector values. This pattern matches both quoted strings ("value" or 'value') and unquoted…

    Recommended action: Upgrade to 2.8.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →
  4. High, CVSS 7.5PyPIAmendedPublished

    Soup Sieve has Memory Exhaustion via Large Comma-Separated Selector Lists

    CVE-2026-49476 · GHSA-2wc2-fm75-p42x

    Affected
    • PyPI soupsieve <= 2.8.3
    Fixed in
    2.8.4· Vendor fix available
    Issue
    The CSS selector parser in soupsieve (the CSS selector engine for Beautiful Soup 4) allocates unbounded memory when compiling large comma-separated selector lists. An attacker who can supply a crafted CSS selector string to soupsieve.compile() or Beautiful Soup's .select() / .selectone() can cause the application to allocate hundreds of megabytes of heap memory from a relatively small input, leading to memory exhaustion and denial of service. To be completely transparent, AI tools helped surface this issue. However, it was independently reproduced and carefully validated. Researchers follow responsible disclosure practices and originally shared this report privately. A 500 KB selector string triggers allocation of approximately 244 MB of heap memory - a 488x— amplification ratio. Details Affected code: soupsieve/cssparser.py, lines ~204, 925, 1106 The soupsieve CSS parser splits comma-separated selector lists and creates one CSSSelector object per list item. Each CSSSelector…

    Recommended action: Upgrade to 2.8.4 or later, then redeploy and verify.A vendor fix does not resolve your finding until you verify it in your own systems.

    Sources:osv.dev (1)github.com (2)Source checked Evidence →