GHSA-gg2r-wvfm-q9rx: Pip/pillow vulnerability

Published Oct 21, 2026
·
Updated

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.

Affected Software

1 affected componentFixes available
pip/pillow>=4.1.0<13.0.0
13.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade pip/pillow to a version that resolves this vulnerability.

    Fixed in 13.0.0

Event History

Oct 21, 2026
Advisory Published
via GitHub·09:12 PM
Data Sourced
via GitHub·09:12 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

Which applications are exposed to this issue?

Any application using Pillow that loads pixel data from attacker-controlled or otherwise untrusted MSP image files is exposed to memory-exhaustion denial of service. The issue is triggered when pixels are loaded, not merely by the file's declared pixel count.

2

Does Pillow's MAX_IMAGE_PIXELS setting mitigate the problem?

No. The RLE expansion is decoupled from the declared pixel count, so MAX_IMAGE_PIXELS does not cap the memory consumed by the decoder.

3

What does an attacker need to do to exploit this?

An attacker needs to provide a crafted MSP image that passes the pixel-count check but contains run-length data that expands into a very large in-memory buffer. Loading its pixels can then force allocation of hundreds of megabytes or more.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203