GHSA-2wc2-fm75-p42x: Soup Sieve has Memory Exhaustion via Large Comma-Separated Selector Lists
A vulnerability in soupsieve's CSS selector parser allows unbounded memory allocation when processing large comma-separated selector lists. An attacker can supply a crafted CSS selector string to soupsieve.compile() or Beautiful Soup's .select()/.select_one() methods, causing excessive heap memory use and potential denial of service. The issue arises because no limit is enforced on the number of selectors parsed, leading to linear scaling of memory usage with a high amplification ratio. This can cause out-of-memory conditions, process termination, or degraded server performance. The vulnerability affects soupsieve versions prior to 2.8.4.
AI Analysis
Technical Summary
The soupsieve CSS parser allocates approximately 976 bytes of heap memory per selector when compiling comma-separated selector lists. It does not limit the number of selectors, so a large input string with many selectors (e.g., 250,000 'a' selectors separated by commas) causes the parser to allocate hundreds of megabytes of memory from a relatively small input (~500 KB). This unbounded memory allocation can lead to memory exhaustion and denial of service in applications using soupsieve.compile() or Beautiful Soup's .select() and .select_one() methods with user-supplied selectors. The attack surface includes any server-side Python application that accepts user input for CSS selectors. The amplification ratio of memory allocated to input size is approximately 488x. The vulnerability is tracked as CVE-2026-49476 and affects soupsieve versions before 2.8.4.
Potential Impact
An attacker can cause denial of service by exhausting available memory on servers running vulnerable soupsieve versions. This can lead to container OOM kills, swap thrashing on physical servers, or Python process termination via MemoryError exceptions. The attack requires no authentication or user interaction and can be tuned to exhaust specific memory limits. Multiple concurrent exploit attempts can amplify the impact. This affects any application that compiles user-supplied CSS selectors using soupsieve or Beautiful Soup's selector methods.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing untrusted or user-supplied CSS selectors to soupsieve.compile() or Beautiful Soup's .select()/.select_one() methods. Implement input validation or limits on selector list size to mitigate memory exhaustion risks.
GHSA-2wc2-fm75-p42x: Soup Sieve has Memory Exhaustion via Large Comma-Separated Selector Lists
Description
A vulnerability in soupsieve's CSS selector parser allows unbounded memory allocation when processing large comma-separated selector lists. An attacker can supply a crafted CSS selector string to soupsieve.compile() or Beautiful Soup's .select()/.select_one() methods, causing excessive heap memory use and potential denial of service. The issue arises because no limit is enforced on the number of selectors parsed, leading to linear scaling of memory usage with a high amplification ratio. This can cause out-of-memory conditions, process termination, or degraded server performance. The vulnerability affects soupsieve versions prior to 2.8.4.
CVSS v3.1
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
The soupsieve CSS parser allocates approximately 976 bytes of heap memory per selector when compiling comma-separated selector lists. It does not limit the number of selectors, so a large input string with many selectors (e.g., 250,000 'a' selectors separated by commas) causes the parser to allocate hundreds of megabytes of memory from a relatively small input (~500 KB). This unbounded memory allocation can lead to memory exhaustion and denial of service in applications using soupsieve.compile() or Beautiful Soup's .select() and .select_one() methods with user-supplied selectors. The attack surface includes any server-side Python application that accepts user input for CSS selectors. The amplification ratio of memory allocated to input size is approximately 488x. The vulnerability is tracked as CVE-2026-49476 and affects soupsieve versions before 2.8.4.
Potential Impact
An attacker can cause denial of service by exhausting available memory on servers running vulnerable soupsieve versions. This can lead to container OOM kills, swap thrashing on physical servers, or Python process termination via MemoryError exceptions. The attack requires no authentication or user interaction and can be tuned to exhaust specific memory limits. Multiple concurrent exploit attempts can amplify the impact. This affects any application that compiles user-supplied CSS selectors using soupsieve or Beautiful Soup's selector methods.
Mitigation Recommendations
Patch status is not yet confirmed — check the vendor advisory for current remediation guidance. Until a fix is available, avoid passing untrusted or user-supplied CSS selectors to soupsieve.compile() or Beautiful Soup's .select()/.select_one() methods. Implement input validation or limits on selector list size to mitigate memory exhaustion risks.
Technical Details
- Gcve Source
- db.gcve.eu
- Osv Id
- GHSA-2wc2-fm75-p42x
- Osv Schema Version
- 1.4.0
- Aliases
- ["CVE-2026-49476"]
- Ecosystems
- ["PyPI"]
- Database Specific Severity
- HIGH
- Cvss Version
- 3.1
Threat ID: 6a4fa9a168715ace437d3dd0
Added to database: 07/09/2026, 14:01:05 UTC
Last enriched: 07/09/2026, 14:02:45 UTC
Last updated: 07/09/2026, 17:36:06 UTC
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.