CVE-2026-112898: Pillow: Image.quantize() with empty palette leaks uninitialized stack memory

Published Oct 19, 2026
·
Updated

Pillow is a Python imaging library. From 9.1.0 until 13.0.0, Pillow can disclose uninitialized stack memory when Image.quantize() uses an empty palette. ImagingPaletteCacheUpdate() leaves a local cache array uninitialized when the palette has zero entries, and the conversion path emits those bytes as output pixel indices. An attacker who controls the palette image can obtain stack contents from a returned PNG or GIF. This can disclose addresses and stack-canary data without an out-of-bounds access, memory corruption, or process crash. This issue is fixed in version 13.0.0.

Affected Software

1 affected component
pypi/Pillow>=9.1.0<13.0.0

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade Pillow to a version that resolves this vulnerability.

    Fixed in 13.0.0

Event History

Oct 19, 2026
CVE Published
via MITRE·10:04 PM
Data Sourced
via MITRE·10:04 PM
DescriptionWeakness
Data Sourced
via NVD·10:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are realistically exposed?

Applications using Pillow 9.1.0 through versions before 13.0.0 are exposed if they process an attacker-controlled palette image with Image.quantize() and return the resulting PNG or GIF to the attacker.

2

What does an attacker need to exploit this issue?

The attacker needs to control the palette image supplied to the quantization operation. The CVSS vector indicates network reachability, low attack complexity, no privileges, and no user interaction requirements.

3

What information can be disclosed?

The generated image can contain uninitialized stack bytes emitted as pixel indices. Disclosed data may include memory addresses and stack-canary data.

4

How can I determine whether an installation is affected?

Check the installed Pillow version and whether the application uses Image.quantize() on untrusted palette images. Versions from 9.1.0 up to, but not including, 13.0.0 are affected; version 13.0.0 fixes the issue.

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