Skip to main content

Pillow EUVDEUVD-2026-104660

| CVE-2026-112898 MEDIUM
Use of Uninitialized Variable (CWE-457)
2026-10-19 GitHub_M GHSA-rfgq-q3w2-pmv2
6.9
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit image with zero-entry palette
  2. Exploit
    Trigger Image.quantize via attacker palette
  3. Execution
    Emit uninitialized stack bytes as pixels
  4. Impact
    Recover addresses and canary from output

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Variable initialization checks
Exploitation Conditions

Exploitation requires that the target application call Pillow's Image.quantize(palette=p) with an attacker-controlled palette image whose palette has zero entries (p.palette.palette == b""), causing ImagingPaletteCacheUpdate() to leave its local cache array uninitialized and the topalette() conversion path to emit those bytes as output pixel indices in the returned PNG/GIF. Limiting factors: this is not Pillow's default or implicit behavior - the application must expose the quantize-with-palette code path to untrusted input, and the attacker must control the palette image specifically. Impact is confined to disclosure of uninitialized stack memory (addresses, stack-canary data) with no code execution, corruption, or crash. Affects Pillow 9.1.0 through versions before 13.0.0.

Impact

This is a medium-severity information-disclosure flaw (CVSS 4.0 base 6.9) rated CWE-457 (use of uninitialized variable). The CVSS 4.0 vector AV:N/AC:L/AT:N/PR:N/UI:N indicates network-reachable, low-complexity, unauthenticated triggering with no user interaction, but impact is confined to confidentiality at Low (VC:L; VI:N/VA:N) - a pure read of uninitialized stack memory with no corruption, out-of-bounds write, or crash. No EPSS score was provided, so exploitation probability cannot be quantified; the CVE is NOT in CISA KEV and no public exploit code was supplied, so exploitation status is 'no public exploit identified at time of analysis'. The source-code evidence (fix commit 13943c8) is a patch, not a weaponized PoC. The practical risk is tempered by a real precondition the raw vector obscures: the AV:N/PR:N scoring assumes the attacker can reach the vulnerable call path, but exploitation only occurs when an application invokes Image.quantize() with an attacker-controlled palette image that has zero entries - not Pillow's default behavior. Net assessment: a genuine but lower-tier priority - valuable as an ASLR/stack-canary-defeating leak primitive to chain with a separate memory-corruption bug rather than an independently critical issue. Patch to 13.0.0 where the quantize path is a realistic attack surface.

Exploit ScenarioDerived

A web application lets users upload an image and recolor it against a user-supplied palette via Pillow's Image.quantize(palette=...). An attacker uploads a palette image whose palette is empty (zero entries); Pillow's conversion path emits uninitialized stack bytes as pixel indices, and the attacker downloads the resulting PNG/GIF and reconstructs leaked stack contents such as pointers and stack-canary values. No public exploit code is known, but the low attack complexity (AC:L) makes reliable triggering straightforward once the palette path is reachable.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Oct 19, 2026

Uninitialized stack memory disclosure in Pillow 9.1.0 through 12.x allows an attacker who controls a palette image passed to Image.quantize(palette=p) to receive raw stack contents - including pointer addresses and stack-canary bytes - embedded as pixel indices in the returned PNG or GIF. Exploitation is not implicit in normal Pillow use: the application must expose the quantize-with-palette path to untrusted input and must accept an attacker-supplied palette whose palette data is empty (p.palette.palette == b""), which causes ImagingPaletteCacheUpdate() to leave its local cache array uninitialized before those bytes are emitted by the topalette() conversion path. The flaw yields confidentiality-only impact with no memory corruption or crash; no public exploit code or confirmed active exploitation (CISA KEV) was identified at time of analysis, and the vendor-released fix is Pillow 13.0.0.

RemediationAI

Vendor-released patch: upgrade to Pillow 13.0.0 or later (https://github.com/python-pillow/Pillow/releases/tag/13.0.0), which adds an explicit empty-palette rejection that raises ValueError("empty palette") from the topalette() conversion path and zero-initializes the palette cache array per commit 13943c8f857b22f073d30f0ef9b725a0d255f1a4; details are in GHSA-rfgq-q3w2-pmv2. Where an immediate upgrade is not possible, the practical compensating control is input validation in the calling application: before invoking Image.quantize(palette=p), inspect the supplied palette image and reject it when p.mode != "P" or p.palette is None or p.palette.palette == b"", returning an error to the user - this mirrors exactly the check the upstream patch performs and carries negligible side effects, since a zero-entry palette has no legitimate quantize semantics. A broader but more disruptive mitigation is to disable the quantize-with-palette feature entirely for untrusted input (for example by running image conversion in a subprocess that refuses palette-bearing requests), at the cost of losing a legitimate color-reduction capability; running the conversion in a short-lived worker process also limits the value of leaked stack data such as canary and address bytes, though it does not eliminate the disclosure itself. Because the defect discloses stack memory without crashing, it will not be caught by crash monitoring - inventory call sites of Image.quantize(palette=...) directly to confirm exposure.

Affected VersionsENISA

Pillow 9.1.0, < 13.0.0

Affected Packages

pypi pillow fix: 13.0.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in pypi

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Pillow is the maintained fork of the Python Imaging Library, with its performance-critical imaging primitives implemented in C under src/libImaging and exposed to Python through the _imaging extension module. This issue is CWE-457 (use of uninitialized variable): in ImagingPaletteCacheUpdate() (src/libImaging/Palette.c) the local cache array is populated by looping over the palette's entries, so a palette with zero entries leaves the array contents undefined on the stack, and the subsequent topalette() conversion in Convert.c copies those undefined values out as output pixel indices. The result is an information leak of stack memory without any out-of-bounds access, memory corruption, or crash - the conversion simply succeeds and returns an image whose index channel is derived from uninitialized stack bytes. The trigger is the quantize()-with-palette path, where the caller passes a mode "P" image as the reference palette; the committed upstream fix (13943c8f857b22f073d30f0ef9b725a0d255f1a4) adds an explicit palette->size == 0 check that raises ImagingError_ValueError("empty palette") from topalette() and also zero-initializes the cache entry in ImagingPaletteCacheUpdate(), plus a regression test asserting that quantize(palette=p) raises ValueError for an empty palette. Note that some feed metadata tags this as a "Buffer Overflow"; the authoritative root-cause class is uninitialized memory use, and the assessed CVSS v3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N) confirms a remote, unauthenticated, low-confidentiality-only impact with no integrity or availability effect.

Know when Pillow gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 6.9 MEDIUM
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N
vuln.today AI 5.3 MEDIUM

Attacker-supplied palette image can arrive over the network with no auth or interaction (AV:N/PR:N/UI:N), triggering reliably (AC:L); only a partial stack-memory read results, so C:L and I:N/A:N.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Oct 19, 2026 - 23:18 EUVD
CVE Published
Oct 19, 2026 - 22:04 cve.org
MEDIUM 6.9

DescriptionCVE.org

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.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 62 pypi packages depend on pillow (58 direct, 4 indirect)

Ecosystem-wide dependent count for version 9.1.0.

Threat Intelligence Overview

EPSS Score
0.3%
Top 80% exploitable
Prevalence
High
Pillow is among the most widely deployed Python imaging libraries
Threat Intel
1
1 source
Data Quality
5 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact· derived
Medium

Priority Score

34
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +34
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

More in Pillow

View all
CVE-2022-30595 CRITICAL POC
9.8 May 25

libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated

CVE-2026-59204 HIGH POC
8.7 Jul 14

Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG

CVE-2026-54058 HIGH POC
8.3 Jul 14

Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image

CVE-2026-59197 HIGH POC
8.2 Jul 14

Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c

CVE-2026-59200 HIGH POC
7.5 Jul 14

Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d

CVE-2021-23437 HIGH POC
7.5 Sep 03

The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb

CVE-2025-48379 HIGH POC
7.1 Jul 01

Pillow is a Python imaging library. In versions 11.2.0 to before 11.3.0, there is a heap buffer overflow when writing a

CVE-2016-4009 CRITICAL
9.8 Apr 13

Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote

CVE-2014-3007 CRITICAL
10.0 Apr 27

Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v

CVE-2026-96639 CRITICAL
9.8 Oct 21

Pillow versions 11.0.0 through 12.x (fixed in 13.0.0) can reuse a stale native ImagingCore buffer when a multi-frame ima

CVE-2021-34552 CRITICAL
9.8 Jul 13

Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters

CVE-2021-25289 CRITICAL
9.8 Mar 19

An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy