<?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>Pillow (&gt;= 5.1.0, &lt; 12.3.0) - CraftedSignal Threat Feed</title><link>https://feed.craftedsignal.io/products/pillow--5.1.0--12.3.0/</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>Mon, 20 Jul 2026 23:12:09 +0000</lastBuildDate><atom:link href="https://feed.craftedsignal.io/products/pillow--5.1.0--12.3.0/feed.xml" rel="self" type="application/rss+xml"/><item><title>Pillow Decompression Bomb DoS via PdfParser.PdfStream.decode()</title><link>https://feed.craftedsignal.io/briefs/2026-07-pillow-pdfparser-dos/</link><pubDate>Mon, 20 Jul 2026 23:12:09 +0000</pubDate><author>hello@craftedsignal.io</author><guid isPermaLink="true">https://feed.craftedsignal.io/briefs/2026-07-pillow-pdfparser-dos/</guid><description>A denial-of-service vulnerability (CVE-2026-59200) exists in Pillow's `PdfParser.PdfStream.decode()` function across versions 5.1.0 to 12.2.x, allowing an unauthenticated attacker to craft a malicious PDF file that, when processed by a vulnerable application, triggers excessive memory allocation (e.g., a ~950 KB file expanding to 1 GB), leading to server Out-of-Memory termination or severe service degradation.</description><content:encoded><![CDATA[<p>A denial-of-service (DoS) vulnerability, tracked as CVE-2026-59200, has been identified in Pillow, a widely used Python imaging library. Specifically, the <code>PdfParser.PdfStream.decode()</code> function in <code>PdfParser.py</code> incorrectly utilizes the <code>Length</code> field from a PDF stream as the <code>bufsize</code> parameter for Python's <code>zlib.decompress()</code>. While <code>bufsize</code> is intended as an initial buffer hint, it does not impose a maximum memory limit, allowing <code>zlib.decompress()</code> to expand memory until the entire decompressed result is produced. An unauthenticated attacker can exploit this by crafting a specially designed PDF file containing a highly compressed FlateDecode stream. When an application using Pillow's <code>PdfParser</code> processes such a file, the malicious stream decompresses into a significantly larger memory footprint (e.g., a ~950 KB file can expand to 1 GB), leading to Out-of-Memory (OOM) errors and service termination or severe degradation for the host system. This vulnerability affects Pillow versions greater than or equal to 5.1.0 and less than 12.3.0.</p>
<h2 id="attack-chain">Attack Chain</h2>
<ol>
<li>An attacker crafts a malicious PDF file containing a highly compressed FlateDecode stream.</li>
<li>The <code>Length</code> or <code>DL</code> field within the PDF stream's dictionary is set to a value reflecting the compressed stream size.</li>
<li>The attacker delivers the malicious PDF to a target application that uses <code>PIL.PdfParser.PdfParser</code> to process untrusted PDF files.</li>
<li>The target application opens and parses the untrusted PDF using an instance of <code>PdfParser.PdfParser</code>.</li>
<li>The application attempts to access a compressed stream object from the parsed PDF, triggering a call to <code>PdfStream.decode()</code>.</li>
<li>Inside <code>PdfStream.decode()</code>, the <code>zlib.decompress()</code> function is invoked, passing the potentially large value from the PDF stream's <code>Length</code> field as its <code>bufsize</code> parameter.</li>
<li><code>zlib.decompress()</code> proceeds to expand the highly compressed stream, allocating memory far exceeding the compressed file size (e.g., a 95 KB file expanding to 100 MB or a 950 KB file expanding to 1 GB).</li>
<li>This excessive memory allocation exhausts the available server memory, leading to an Out-of-Memory (OOM) error, process termination, or severe service degradation for the target application, effectively causing a denial of service.</li>
</ol>
<h2 id="impact">Impact</h2>
<p>This vulnerability directly leads to a denial-of-service condition. Any application that uses Pillow's <code>PIL.PdfParser.PdfParser</code> module to process untrusted PDF files is susceptible. An unauthenticated attacker can exploit this by submitting a relatively small (e.g., ~950 KB) malicious PDF file, which, when decompressed, consumes gigabytes of memory. This resource exhaustion will cause the server or application process to terminate due to Out-of-Memory errors or experience significant performance degradation, affecting all users and services relying on the vulnerable application. There is no specific victim count available, but any sector using Python applications that process untrusted PDFs with affected Pillow versions is at risk.</p>
<h2 id="recommendation">Recommendation</h2>
<ul>
<li>Immediately patch Pillow installations (affected versions &gt;= 5.1.0, &lt; 12.3.0) to version 12.3.0 or higher to address CVE-2026-59200.</li>
<li>Implement resource monitoring for Python applications that process untrusted PDF files, focusing on memory usage spikes, to detect potential denial-of-service attempts.</li>
<li>Review any custom code interacting with <code>PIL.PdfParser.PdfParser</code> and consider implementing explicit size checks for decompressed data, similar to the <code>MAX_DECOMPRESS_BYTES</code> example provided in the source material, to prevent unbounded memory allocation.</li>
</ul>
]]></content:encoded><category domain="severity">low</category><category domain="type">advisory</category><category>denial-of-service</category><category>vulnerability</category><category>python</category><category>library</category><category>pdf</category></item></channel></rss>