Skip to main content

soupsieve CVE-2026-49476

HIGH
Uncontrolled Resource Consumption (CWE-400)
2026-07-09 https://github.com/facelessuser/soupsieve GHSA-2wc2-fm75-p42x
7.5
CVSS 3.1 · Vendor: https://github.com/facelessuser/soupsieve
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Identify endpoint accepting user CSS selectors
  2. Delivery
    Craft ~500 KB comma-separated selector list
  3. Exploit
    Submit to trigger soupsieve.compile()
  4. Execution
    Parser allocates ~244 MB object graph
  5. Persist
    Repeat concurrently to exhaust memory
  6. Impact
    OOM kill / MemoryError denial of service

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A06:2025 - Insecure Design
ASVS 5.0
V2 - Validation and Business Logic Resource consumption limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires that the target application pass attacker-controlled CSS selector strings into soupsieve.compile() or Beautiful Soup's .select()/.select_one() - the concrete precondition is a user-facing feature that accepts a selector (web scraping APIs, content filtering, CMS preview). Given that condition, the CVSS vector AV:N/AC:L/PR:N/UI:N confirms no authentication and no user interaction are needed and the payload works against default soupsieve behavior, since no selector-count limit exists in any configuration. The key limiting factor is exposure: applications that use only hardcoded/internal selectors are not exploitable regardless of the vulnerable code being present, and impact is confined to availability (C:N/I:N) - no data disclosure or code execution. Payloads must be sized to the target's memory ceiling, and single requests may be absorbed by generous memory limits, so sustained or concurrent requests increase reliability.

Impact

The CVSS 3.1 vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H (7.5, High) captures a pure availability impact reachable over the network with low complexity and no authentication or user interaction - consistent with the DoS-only nature of the flaw (C:N/I:N). No EPSS score, KEV entry, or SSVC decision data was provided in the input, so real-world exploitation likelihood cannot be quantified from these sources; the absence of a KEV listing means there is no evidence of active exploitation. A functional proof-of-concept exists in the advisory, which raises practical risk, but the true blast radius is gated by a deployment condition the CVSS base score does not express: the application must pass attacker-controlled CSS selectors into soupsieve. Most consumers of beautifulsoup4 use hardcoded selectors and are not exposed; the genuinely at-risk population is the narrower set of services (scraping APIs, content-filtering tools, CMS preview features) that accept selectors from users. Net: a real and easily weaponized DoS for the exposed subset, but not a broad remote-code-execution-class emergency - prioritize by whether your app forwards user input to soupsieve rather than by the 7.5 alone.

Exploit ScenarioDerived

An attacker targets a web-scraping or content-filtering API that lets users specify a CSS selector, and submits a ~500 KB payload of 250,000 comma-separated 'a' selectors; when the service calls soupsieve.compile() (directly or via Beautiful Soup's .select()), it allocates ~244 MB of heap, and a few concurrent requests exhaust the container's memory limit and trigger an OOM kill. The published proof-of-concept demonstrates the ~488x amplification exactly, and the network attack vector with low complexity and no authentication (AV:N/AC:L/PR:N) makes this trivial to script and repeat.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.6% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 09, 2026

Memory-exhaustion denial of service in soupsieve, the CSS selector engine bundled with Beautiful Soup 4 (beautifulsoup4), lets remote unauthenticated attackers crash Python services by submitting a large comma-separated CSS selector to soupsieve.compile() or Beautiful Soup's .select()/.select_one(). Each comma-delimited item is parsed into a ~976-byte object graph with no cap on list length, so a ~500 KB selector string of 'a,a,a,...' expands to roughly 244 MB of heap (a ~488x amplification), triggering OOM kills or MemoryError. A working proof-of-concept is published in the advisory; no CISA KEV listing or in-the-wild exploitation is reported.

RemediationAI

No vendor-released patch version was identified in the available data - upgrade to the fixed soupsieve release once published and tracked in the GitHub Security Advisory GHSA-2wc2-fm75-p42x (https://github.com/facelessuser/soupsieve/security/advisories/GHSA-2wc2-fm75-p42x); pin and update beautifulsoup4's soupsieve dependency accordingly. Until a fixed version is available, the most effective compensating control is to stop passing untrusted CSS selectors into soupsieve.compile()/.select()/.select_one(): enforce an input-length cap and a maximum comma-separated selector count on any user-supplied selector before compilation (e.g. reject strings over a few kilobytes or lists exceeding a small item count), which blocks the amplification with negligible impact on legitimate selectors. Additionally, run selector compilation under a per-request memory or time cap (subprocess/cgroup memory limit, resource.RLIMIT_AS, or a worker with restart-on-OOM) so a single request cannot exhaust the whole process, and set container memory limits with automatic restart to contain OOM kills - the trade-off is that a malicious request may still fail its own operation, but co-located processes and the parent service stay available. Where feasible, restrict the selector-accepting endpoint to authenticated or rate-limited callers to reduce the ability to send repeated concurrent payloads.

Affected Packages

pypi soupsieve fix: 2.8.4

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

soupsieve translates CSS selector strings into compiled matcher objects for Beautiful Soup document traversal. The parser in soupsieve/css_parser.py (around lines 204, 925, and 1106) tokenizes a selector list, splits it on commas, and instantiates one CSSSelector per segment, each carrying SelectorList, Selector, and associated tag/attribute/pseudo-class metadata. This maps to CWE-400 (Uncontrolled Resource Consumption): the number of selectors in a comma-separated list is never bounded, so allocation grows linearly with input list length while the per-item object overhead (~976 bytes for a single 'a') drives an extreme output-memory-to-input-byte amplification ratio. The affected package is identified by CPE pkg:pip/soupsieve; because soupsieve is an automatic dependency of beautifulsoup4, the vulnerable code is present in a very large number of Python environments.

Know when Python gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/facelessuser/soupsieve) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 7.5 HIGH

Network-reachable, low-complexity, unauthenticated selector input with no user interaction yields availability-only impact (A:H, C:N/I:N); scope unchanged as only the parsing process is affected.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 5.9 HIGH

Primary rating from Vendor (https://github.com/facelessuser/soupsieve).

CVSS VectorVendor: https://github.com/facelessuser/soupsieve

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

Summary

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() / .select_one() 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/css_parser.py, lines ~204, 925, 1106

The soupsieve CSS parser splits comma-separated selector lists and creates one CSSSelector object per list item. Each CSSSelector object contains parsed selector data structures including SelectorList, Selector, and associated tag/attribute/pseudo-class metadata.

When a selector string such as a,a,a,... (with 250,000 comma-separated items) is passed to sv.compile(), the parser:

  1. Tokenises the entire string and identifies each comma-delimited segment (line ~1106)
  2. Parses each segment into a full Selector object with all associated metadata (line ~925)
  3. Stores all parsed selectors in a SelectorList (line ~204)

Root cause: No limit is enforced on the number of selectors in a comma-separated list. The parser will attempt to parse and store an arbitrary number of selectors, with each selector object consuming approximately 976 bytes of heap memory. The total allocation scales linearly with the number of list items, but the amplification ratio (output memory / input bytes) is extremely high because each single-character selector like a expands into a complex object graph.

Attack surface: Any application that passes user-supplied CSS selectors to soupsieve.compile() or Beautiful Soup's .select() / .select_one().

Proof of Concept

python
import tracemalloc
import soupsieve as sv

tracemalloc.start()
# Build a 500 KB selector string: "a,a,a,...,a" (250,000 items)
count = 250_000
selector = ",".join("a" for _ in range(count))
print(f"Selector string size: {len(selector):,} bytes ({len(selector) / 1024:.0f} KB)")
# Compile the selector — this allocates ~244 MB
compiled = sv.compile(selector)

current, peak = tracemalloc.get_traced_memory()
tracemalloc.stop()

print(f"Compiled selector count: {len(compiled.selectors):,}")
print(f"Current memory: {current / 1024 / 1024:.1f} MB")
print(f"Peak memory: {peak / 1024 / 1024:.1f} MB")
print(f"Amplification ratio: {peak / len(selector):.0f}x")
# Expected output:
# Selector string size: 499,999 bytes (488 KB)
# Compiled selector count: 250,000
# Current memory: ~244 MB
# Peak memory: ~244 MB
# Amplification ratio: ~488x

Impact

Severity: High

An attacker can exhaust available memory on any server-side Python application that compiles user-supplied CSS selectors via soupsieve. This can cause:

  • OOM kills in containerised deployments (Kubernetes pods, Docker containers) with memory limits
  • Swap thrashing on bare-metal servers, degrading performance for all co-located processes
  • Process termination via Python's MemoryError exception if the system runs out of addressable memory
ParameterValue
Input size~500 KB selector string
Memory allocated~244 MB
Amplification ratio~488Ã-
Per-object overhead~976 bytes per selector
Authentication requiredNone
User interaction requiredNone

Scalability of attack: The memory allocation scales linearly - doubling the selector count doubles memory usage. An attacker can tune the payload to exactly exhaust a target's memory limits. Multiple concurrent requests multiply the effect.

Downstream exposure: soupsieve is an automatic dependency of beautifulsoup4, one of the most widely installed Python packages. Any web application accepting CSS selectors from users (e.g., web scraping APIs, content filtering tools, CMS preview features) is potentially affected.

---

Credit

Discovered by a security research team from the University of Sydney, focused on detecting open source software vulnerabilities. Liyi Zhou: https://lzhou1110.github.io/ Ziyue Wang: https://zyy0530.github.io/ Strick: https://str1ckl4nd.github.io/ Maurice: https://maurice.busystar.org/ Chenchen Yu: https://7thparkk.github.io/

Executive ViewAI

Why It Matters

Beautiful Soup 4's soupsieve CSS selector parser is vulnerable to remote denial-of-service attacks via memory exhaustion, allowing unauthenticated attackers to crash Python applications. Organizations using Beautiful Soup 4 for web scraping, data parsing, or HTML processing face potential service unavailability; a 500 KB malicious selector can consume 244 MB of heap memory. No patch is currently available.

Business Impact: High
Compensating Controls

Until a vendor patch is released: (1) Enforce strict input validation-reject CSS selectors exceeding 1 KB and limit comma-separated item count to under 100; (2) Set application-level memory limits and heap thresholds to trigger graceful degradation before OOM; (3) Implement request-size caps (e.g., max 10 KB POST body) at the load balancer or API gateway; (4) Apply rate limiting to parsing endpoints to slow payload submission; (5) Monitor application logs and memory usage for anomalous selector patterns. These mitigations reduce attack surface but do not eliminate risk-patch deployment is required for full remediation.

Threat Intelligence Overview

EPSS Score
0.6%
Top 55% exploitable
Prevalence
High
transitive dependency of beautifulsoup4, among the most-installed Python packages
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

59
Low Medium High Critical
KEV: 0
EPSS: +1
CVSS: +38
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

Affected Products (CPE)CVE.org

pkg:pip/soupsieve

More in Python

View all
CVE-2025-24016 CRITICAL POC
9.9 Feb 10

Wazuh SIEM platform versions 4.4.0 through 4.9.0 contain an unsafe deserialization vulnerability in the DistributedAPI t

CVE-2025-27520 CRITICAL POC
9.8 Apr 04

BentoML version 1.4.2 and earlier contains an unauthenticated remote code execution vulnerability through insecure deser

CVE-2025-2945 CRITICAL POC
9.9 Apr 03

pgAdmin 4 contains critical remote code execution vulnerabilities in the Query Tool download and Cloud Deployment endpoi

CVE-2013-5093 MEDIUM POC
6.8 Sep 27

The renderLocalView function in render/views.py in graphite-web in Graphite 0.9.5 through 0.9.10 uses the pickle Python

CVE-2025-32375 CRITICAL POC
9.8 Apr 09

BentoML is a Python library for building online serving systems optimized for AI apps and model inference. Rated critica

CVE-2014-0224 HIGH POC
7.4 Jun 05

OpenSSL before 0.9.8za, 1.0.0 before 1.0.0m, and 1.0.1 before 1.0.1h does not properly restrict processing of ChangeCiph

CVE-2024-21644 HIGH POC
7.5 Jan 08

pyLoad download manager version prior to 0.5.0b3.dev77 exposes the Flask SECRET_KEY through an unauthenticated endpoint.

CVE-2026-33017 CRITICAL POC
9.3 Mar 17

Langflow (a visual LLM pipeline builder) contains a critical unauthenticated code execution vulnerability (CVE-2026-3301

CVE-2017-9462 HIGH POC
8.8 Jun 06

In Mercurial before 4.1.3, "hg serve --stdio" allows remote authenticated users to launch the Python debugger, and conse

CVE-2026-49869 CRITICAL POC
10.0 Jun 26

Unauthenticated remote code execution affects Kestra OSS (the open-source event-driven orchestration platform) prior to

CVE-2026-39987 CRITICAL POC
9.3 Apr 08

Unauthenticated remote code execution in Marimo ≤0.20.4 allows attackers to execute arbitrary system commands via the `/

CVE-2024-21645 MEDIUM POC
5.3 Jan 08

pyLoad is the free and open-source Download Manager written in pure Python. Rated medium severity (CVSS 5.3), this vulne

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 SUSE Linux Enterprise High Performance Computing 15 SP7 SUSE Linux Enterprise Server 15 SP7 SUSE Linux Enterprise Server for SAP Applications 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Fixed
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Fixed
SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy