<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Beautiful Soup Project - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/vendors/beautiful-soup-project/</link><description>Trending threats, MITRE ATT&amp;CK coverage, and detection metadata. Fed continuously.</description><generator>Hugo</generator><language>en</language><managingEditor>hello@craftedsignal.io</managingEditor><webMaster>hello@craftedsignal.io</webMaster><lastBuildDate>Thu, 09 Jul 2026 13:38:51 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/vendors/beautiful-soup-project/feed.xml" rel="self" type="application/rss+xml"/><item><title>Soup Sieve Memory Exhaustion via Large Comma-Separated Selector Lists (CVE-2026-49476)</title><link>https://feed.craftedsignal.io/briefs/2026-07-soup-sieve-memory-exhaustion/</link><pubDate>Thu, 09 Jul 2026 13:38:51 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-soup-sieve-memory-exhaustion/</guid><description>A memory exhaustion vulnerability (CVE-2026-49476) in the soupsieve CSS selector parser, an indirect dependency of Beautiful Soup 4, allows an unauthenticated attacker to cause a denial of service by supplying a crafted, large comma-separated CSS selector string to applications using `soupsieve.compile()` or Beautiful Soup's `.select()`/`.select_one()`, leading to unbounded memory allocation and system resource exhaustion.</description><content:encoded><![CDATA[<p>A critical memory exhaustion vulnerability, tracked as CVE-2026-49476, has been identified in soupsieve versions up to and including 2.8.3. Soupsieve is a CSS selector engine widely used by <code>beautifulsoup4</code>, a popular Python library for parsing HTML and XML documents. This vulnerability allows an unauthenticated attacker to trigger a denial of service (DoS) by providing a specially crafted, large comma-separated CSS selector string to applications that process user-supplied selectors through <code>soupsieve.compile()</code> or Beautiful Soup's <code>.select()</code>/<code>.select_one()</code>. A relatively small input of 500 KB can lead to approximately 244 MB of heap memory allocation, representing a 488x amplification ratio. This can result in out-of-memory (OOM) kills in containerized environments, severe performance degradation due to swap thrashing on bare-metal systems, or Python <code>MemoryError</code> exceptions, affecting any server-side Python application accepting external CSS selectors.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a large CSS selector string containing numerous comma-separated items, such as &quot;a,a,a,...&quot; with hundreds of thousands of repetitions.</li>
<li>The attacker delivers this crafted selector string to a vulnerable Python application that incorporates <code>soupsieve</code> or <code>beautifulsoup4</code> and processes user-supplied CSS selectors.</li>
<li>The application passes the malicious string to <code>soupsieve.compile()</code> or to Beautiful Soup's <code>.select()</code> or <code>.select_one()</code> methods.</li>
<li>The <code>soupsieve</code> parser tokenizes the entire string and identifies each comma-delimited segment of the selector list.</li>
<li>For each segment, <code>soupsieve</code> attempts to parse it into a <code>Selector</code> object, including associated tag, attribute, and pseudo-class metadata.</li>
<li>All parsed <code>Selector</code> objects are stored in a <code>SelectorList</code> structure.</li>
<li>Due to the unbounded parsing, each <code>Selector</code> object consumes approximately 976 bytes of heap memory, leading to a linear increase in memory consumption for each item in the comma-separated list.</li>
<li>This massive, unintended memory allocation exhausts available system resources, resulting in a denial of service for the target application.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability poses a high risk of denial of service (DoS) for any server-side Python application that processes user-supplied CSS selectors using <code>soupsieve</code> (versions &lt;= 2.8.3) or <code>beautifulsoup4</code>. Successful exploitation can cause severe operational disruptions, including OOM kills in containerized deployments (such as Kubernetes or Docker containers), leading to application crashes and unavailability. On bare-metal servers, the intense memory demands can trigger swap thrashing, significantly degrading overall system performance for all co-located processes. In other cases, Python's <code>MemoryError</code> exception will terminate the affected process. The attack's scalability is linear, meaning an attacker can precisely tune the input payload to exhaust a target's specific memory limits, and concurrent requests can multiply the effect.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li><strong>Patch <code>soupsieve</code></strong>: Immediately upgrade <code>soupsieve</code> to a patched version greater than 2.8.3 to remediate CVE-2026-49476.</li>
<li><strong>Upgrade <code>beautifulsoup4</code></strong>: Ensure <code>beautifulsoup4</code> is updated to a version that bundles a patched <code>soupsieve</code> dependency, or explicitly update <code>soupsieve</code> in your project's dependency lock file.</li>
<li><strong>Input validation</strong>: Implement strict input validation and sanitization for any user-supplied CSS selectors, limiting their complexity and length before processing them with <code>soupsieve.compile()</code> or Beautiful Soup's <code>.select()</code>/<code>.select_one()</code>.</li>
<li><strong>Resource Monitoring</strong>: Deploy robust memory and CPU utilization monitoring for Python applications that process untrusted input, using tools like <code>tracemalloc</code> for deep memory profiling if custom application logging is enabled.</li>
</ul>
]]></content:encoded><category domain="severity">medium</category><category domain="type">advisory</category><category>denial-of-service</category><category>memory-exhaustion</category><category>python</category><category>supply-chain</category></item></channel></rss>