PatchSiren cyber security CVE debrief
CVE-2026-112898 python-pillow CVE debrief
CVE-2026-112898 is a vulnerability in Pillow's `Image.quantize()` function. When an application allows a user to supply the palette image, the user can obtain 512 bytes of the server process's stack memory in the returned image's pixels. This issue arises from the `ImagingPaletteCacheUpdate()` function in `src/libImaging/Palette.c`, which fails to initialize a local array when the palette has zero entries, leading to uninitialized stack memory being leaked.
- Vendor
- python-pillow
- Product
- pillow
- CVSS
- MEDIUM 6.9
- CISA KEV
- Not listed in stored evidence
- Original CVE published
- 2026-10-21
- Original CVE updated
- 2026-10-21
- Advisory published
- 2026-10-21
- Advisory updated
- 2026-10-21
Who should care
Defenders responsible for systems using Pillow, especially those allowing user-supplied palette images, should assess exposure and prioritize remediation. This includes operators of platforms using Pillow, vulnerability management teams, and security teams that need to verify the presence of affected versions and plan for updates or mitigations.
Why it matters
CVE-2026-112898 is a vulnerability in Pillow's `Image.quantize()` function that can lead to the exposure of stack memory contents. Defenders should prioritize updating Pillow and assessing exposure in systems using affected versions.
- Potential exposure of stack memory contents
- Risk of sensitive information disclosure
- Need for verification of remediation in affected systems
- Potential impact on systems allowing user-supplied palette images
Technical summary
The `Image.quantize()` function in Pillow leaks 512 bytes of uninitialized stack memory when an empty palette is supplied. This occurs because the `ImagingPaletteCacheUpdate()` function in `src/libImaging/Palette.c` does not initialize a local array when the palette size is zero, and this uninitialized array is then used to generate pixel indices. The bug is in `ImagingPaletteCacheUpdate()` in `src/libImaging/Palette.c`. It fills a local `UINT8 c[512]` only inside loops bounded by `palette->size`. When the palette has zero entries, the array is never written, but it is still copied into the colour cache.
Defensive priority
Defenders should prioritize updating Pillow to version 13.0.0 or later to address this vulnerability. Systems using affected versions of Pillow should assess exposure and verify remediation.
Recommended defensive actions
- Update Pillow to version 13.0.0 or later
- Assess exposure in systems using affected Pillow versions
- Verify remediation in affected systems
- Review compensating controls for exposed systems while remediation is scheduled and verified
- Check relevant monitoring, detection, and logs for exposed assets that need extra review
- Track exceptions, retest remediated assets, and close the item only after evidence is documented
- Confirm whether affected product deployments exist in managed environments and assign an owner for follow-up
Evidence notes
The vulnerability is confirmed in Pillow versions from 9.1.0 up to but not including 13.0.0. The issue is caused by the `ImagingPaletteCacheUpdate()` function in `src/libImaging/Palette.c`. This function fails to initialize a local array when the palette has zero entries, leading to uninitialized stack memory being leaked. The bug allows an attacker to obtain 512 bytes of the server process's stack memory in the pixels of the returned image when an application lets a user supply the palette image for Pillow's `Image.quantize(palette=)
Sources and references
Verified primary and authoritative sources
-
CVE-2026-112898 CVE Program record
Publisher, destination, and source semantics verified
URL: https://www.cve.org/CVERecord?id=CVE-2026-112898
CVE Program - Official CVE Program record with source-provided CVE metadata.
-
CVE-2026-112898 NVD vulnerability detail
Publisher, destination, and source semantics verified
URL: https://nvd.nist.gov/vuln/detail/CVE-2026-112898
NIST National Vulnerability Database - Official NIST NVD detail page and source-specific vulnerability assessment.
Supplemental references
-
Pillow: Image.quantize() with empty palette leaks uninitialized stack memory
Unverified legacy reference
URL: https://storage.googleapis.com/osv-vulnerabilities/PyPI/GHSA-rfgq-q3w2-pmv2.json
osv_dev
-
Source reference
Unverified legacy reference
URL: https://github.com/python-pillow/Pillow/security/advisories/GHSA-rfgq-q3w2-pmv2
Supplemental source
-
Source reference
Unverified legacy reference
URL: https://github.com/python-pillow/Pillow/commit/13943c8f857b22f073d30f0ef9b725a0d255f1a4
Supplemental source
-
Source reference
Unverified legacy reference
URL: https://github.com/python-pillow/Pillow
Supplemental source
-
Source reference
Unverified legacy reference
URL: https://github.com/python-pillow/Pillow/releases/tag/13.0.0
Supplemental source
Methodology and review provenance
AI-assisted synthesis based on stored public vulnerability evidence. System validation, approval state, and publication status do not by themselves establish human review of this revision. PatchSiren helps prioritize defensive review and does not prove exposure or remediation on any system.