pillow
Affected
- introduced
4.1.0, fixed13.0.0(ecosystem)
Fixed versions
13.0.0
Fix
- Fixed version
13.0.0pip install --upgrade pillow==13.0.0
Advisory
Also known as: BIT-pillow-2026-112892, 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-146Impact
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 MAX_IMAGE_PIXELS does not bound it.
High Basis: The source's own band: HIGH
4.1.0, fixed 13.0.0 (ecosystem)13.0.0
13.0.0pip install --upgrade pillow==13.0.0Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0