CVE-2026-112892: Pillow: MSP RLE decoder expands a tiny file into unbounded memory
Summary The MSP RLE decoder expands run-length data into an in-memory buffer with no cap tied to the declared image size. A small file that passes the pixel-count check can force hundreds of megabytes or more of allocation when the application loads pixels.
Details The MSP decoder writes each run into an unbounded io.BytesIO and can expand roughly 85x per run:
- src/PIL/MspImagePlugin.py:144-146
Impact Memory-exhaustion denial of service from a tiny crafted image in any application that loads pixels. The expansion is decoupled from the declared pixel count, so MAXIMAGEPIXELS does not bound it.
Other sources
Pillow is a Python imaging library. From 4.1.0 until 13.0.0, Pillow's MSP RLE decoder can expand a small file into an unbounded in-memory buffer. The decoder writes run-length output to BytesIO without limiting expansion to the declared image size. An attacker can supply a crafted MSP image to an application that loads its pixels. This can exhaust memory and deny service even when the declared pixel count passes the decompression-bomb check. This issue is fixed in version 13.0.0.
— NVD
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
pip/pillowto a version that resolves this vulnerability.Fixed in 13.0.0 - Upgrade
Upgrade
bitnami/pillowto a version that resolves this vulnerability.Fixed in 13.0.0 - Upgrade
Upgrade
Pillowto a version that resolves this vulnerability.Fixed in 13.0.0
Event History
Frequently Asked Questions
Which Pillow versions are affected?
Pillow versions from 4.1.0 up to, but not including, 13.0.0 are affected. The issue is fixed in Pillow 13.0.0.
What must an attacker be able to do to exploit this issue?
An attacker must be able to provide a crafted MSP image to an application that loads the image's pixels. No authentication or user interaction is required according to the supplied CVSS vector.
What is the impact if exploitation succeeds?
The crafted image can cause unbounded in-memory expansion and exhaust process memory, resulting in denial of service. The declared pixel count can still pass Pillow's decompression-bomb check.