High

Pillow: MSP RLE decoder expands a tiny file into unbounded memory

  • Disclosed: 21.10.2026
  • Updated: 23.10.2026 00:10

Summary

The MSP RLE decoder in Pillow 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

This issue leads to a memory-exhaustion denial of service from a tiny crafted image in any application that loads pixels. Because the expansion is decoupled from the declared pixel count, MAX_IMAGE_PIXELS does not bound it.

What to do

Upgrade Pillow to version 13.0.0 or later.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
Python (PyPI) pillow >= 4.1.0, < 13.0.0 13.0.0

References

CVSS score -
CVSS vector
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
Weakness (CWE)
CWE-409
Platform
Python (PyPI)
Package
pillow
Disclosed
21.10.2026
Updated
23.10.2026 00:10

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-gg2r-wvfm-q9rx - CC BY 4.0

Vulnerability history: pillow

All published vulnerabilities of this package (Python (PyPI)), newest first. Shows whether this is a one-off slip or a package that needs watching.

All (100) in the archive
Total entries
100
First → latest
04.2014 10.2026
Without a fix
0
Exploited in attacks
1

Severity breakdown

  • Critical 13
  • High 58
  • Medium 27
  • Low 1
  • Unrated 1

Disclosures per year

  1. 2017: 1
  2. 2018: 0
  3. 2019: 1
  4. 2020: 10
  5. 2021: 20
  6. 2022: 8
  7. 2023: 3
  8. 2024: 2
  9. 2025: 1
  10. 2026: 42

earlier: 12

Severity:
  1. Critical · 9.8 CVE-2026-96639 >= 11.0.0, < 13.0.0 13.0.0
  2. Pillow: MSP RLE decoder expands a tiny file into unbounded memory this entry
    High CVE-2026-112892 >= 4.1.0, < 13.0.0 13.0.0
  3. High CVE-2026-112390 >= 7.2.0, < 13.0.0 13.0.0
  4. High CVE-2026-112405 >= 12.0.0, < 13.0.0 13.0.0
  5. High CVE-2026-112893 >= 10.0.0, < 13.0.0 13.0.0
  6. Critical CVE-2026-112900 >= 2.6.0, < 13.0.0 13.0.0
  7. Critical CVE-2026-112403 < 13.0.0 13.0.0
  8. High · 7.5 CVE-2026-59200 >= 5.1.0, < 12.3.0 12.3.0
Show more (20) Showing 20 of 71

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.