Skip to main content

Pillow CVE-2026-96639

| EUVDEUVD-2026-107573 CRITICAL
Out-of-bounds Read (CWE-125)
9.8
CVSS 3.1 · Vendor
View

Attack ChainAIDerived

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

  1. Access
    Craft malicious PSD/MPO/DCX/MIC image
  2. Delivery
    Submit file to Pillow-based application
  3. Exploit
    Advance to frame that changes mode/size
  4. Execution
    Stale narrow buffer reused, wider pixels written
  5. Impact
    Native out-of-bounds write: crash, memory leak, or code execution

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Bounds checking, read limits
MITRE ATT&CK

1 technique across 1 tactic: Collection

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Requires an application using Pillow 11.0.0 up to (not including) 13.0.0 to open an attacker-supplied multi-frame image in PSD, MPO, DCX, or MIC format and to advance past the first frame (seek/load a later frame). The specific trigger is a later frame of the same dimensions whose logical mode widens to RGB or CMYK (or whose size changes) relative to an earlier narrow-mode frame, causing load_prepare() to reuse the stale native allocation because _im is non-null. Limiting factors: the application must actually process multi-frame files and iterate frames rather than reading only the first frame; no authentication is required (PR:N), and no end-user interaction is needed in an automated pipeline. The crash and out-of-bounds read are reliably reachable, but code execution is limited to the MPO path and specific runtime/heap profiles, so most deployments realistically face DoS or memory disclosure rather than RCE.

Impact

The input CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N) yields a 9.8 Critical and, taken alone, implies trivial remote unauthenticated exploitation. However, the description reveals this is a memory-safety flaw in a parsing library triggered only when an application opens and advances through frames of an attacker-supplied multi-frame image (PSD, MPO, DCX, or MIC), so real-world risk hinges on whether the consuming application processes untrusted multi-frame files and seeks later frames. No EPSS score was provided and the CVE is not listed in CISA KEV, so there is no signal of widespread active exploitation; the matched phrase is 'no public exploit identified at time of analysis' (the patch-commit and test diffs on GitHub demonstrate the fix, not a weaponized exploit). The most reliable outcomes are native out-of-bounds writes (crash/DoS) and, on the MPO path, an over-read (information disclosure); the claimed command execution is explicitly scoped to 'demonstrated runtime-specific profiles' and is heap-layout-dependent, so RCE should be treated as conditional rather than guaranteed. Net: a genuinely high-severity memory-corruption bug in an extremely common library, but exploitation is gated by application behavior and the RCE claim is not independently confirmed - prioritize patching, but the 9.8 overstates the likelihood of reliable remote code execution against arbitrary deployments.

Exploit ScenarioDerived

An attacker submits a crafted multi-frame image (PSD, MPO, DCX, or MIC) to a service built on Pillow 11.0.0-12.x that opens the file and iterates frames; an earlier narrow-mode frame allocates a small ImagingCore buffer, and a later same-size frame that switches the logical mode to wider RGB/CMYK causes load_prepare() to reuse the stale allocation, writing wider pixels past the buffer. This produces native out-of-bounds writes (crash or memory corruption) or, via the MPO path, an over-read leaking memory, with command execution possible in specific runtime profiles. No public exploit code was identified in the provided data.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.6% exploitation probability (EPSS)

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

Alert me

AnalysisAIv2 – Oct 21, 2026

Pillow versions 11.0.0 through 12.x (fixed in 13.0.0) can reuse a stale native ImagingCore buffer when a multi-frame image is advanced to a later frame whose pixel mode widens from a narrow format to RGB or CMYK, or whose dimensions change, producing native out-of-bounds writes and crashes; the MPO path can additionally over-read memory and, on specific runtime/heap profiles, achieve command execution. Exploitation requires the application to open an attacker-supplied PSD, MPO, DCX, or MIC file and actually seek/load past the first frame, since reading only the initial frame does not trigger the bug; no credentials or user interaction are needed in an automated image-processing pipeline. No public exploit code has been identified at time of analysis and the issue is not in CISA KEV, although the 9.8 CVSS and the trivially craftable file format make weaponization plausible for any service that validates or thumbnails multi-frame uploads.

Earlier versions of this analysis (1)
v1 Oct 21, 2026 - 20:18

Stale native image buffer reuse in Pillow before 13.0.0 can corrupt memory or disclose information when an application loads an attacker-supplied image and then performs a pixel-mode transition such as Image.convert(). This Critical-rated flaw (GHSA-v9pv-5gc8-w2m6) affects all Pillow builds prior to 13.0.0 and can be reached by unauthenticated remote input only when the host application invokes a mode-changing operation on untrusted images. No public exploit code or confirmed active exploitation was identified at time of analysis.

RemediationAI

Upgrade to Pillow 13.0.0 (Vendor-released patch: 13.0.0), which is the first release containing the fix; the change is upstream commit 78d97d994579aef81aafe123773d525f40f2522a and pull request https://github.com/python-pillow/Pillow/pull/10105, with release notes at https://pillow.readthedocs.io/en/stable/releasenotes/13.0.0.html. Because the defect is in the C extension, rebuilding any wheels, lambda layers, or frozen binaries against 13.0.0 is required - a pure-Python overlay or site-packages hot-patch will not correct the native code path unless the compiled extension is replaced. If an immediate upgrade is not possible, the highest-value compensating control is to never advance past the first frame on untrusted input: read exactly one frame and avoid patterns like ImageSequence.Iterator, im.seek(n) loops, or save_all re-encoding on user-supplied files, at the cost of losing animated/multi-page support and any thumbnail derived from later frames. A second option is to block the vulnerable plugins outright - for example by removing or refusing PSD, MPO, DCX, and MIC from Image.OPEN / registered extensions so those files fail to open - which stops the attack at the cost of rejecting legitimate Photoshop, stereo JPEG, and multi-page fax-style inputs; note that MIC and DCX are rarely needed in most web workloads, so this is usually low-impact. Where format support must remain, run the decode step in a memory-isolated worker (separate process, container, or seccomp-limited sandbox with restricted syscalls) so an out-of-bounds write becomes a contained worker crash rather than host compromise, accepting the operational overhead of process isolation and the residual memory-disclosure risk from the MPO over-read. Rejecting uploads whose later frames change mode or dimensions requires parsing the container itself and is fragile, so it should not be relied on as a primary mitigation.

Affected VersionsENISA

Pillow 11.0.0, < 13.0.0

Affected Packages

euvd pillow fix: 13.0.0

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

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

Technical ContextAI · show details

Pillow's C extension exposes image data through an ImagingCore object (the Python-level _im attribute), which is allocated once per image and cached on the ImageFile instance. ImageFile.load_prepare() is meant to reuse that native storage across frame loads, but it only checks whether _im is non-null rather than verifying that the allocation's mode and size still match the frame currently being decoded. In multi-frame containers such as PSD, MPO, DCX (concatenated PCX frames) and MIC, each frame carries its own mode and tile/decoder configuration, so a first frame decoded as a 1-bit or P-mode image can leave behind a narrow buffer that a subsequent same-size frame decodes into as RGB or CMYK, causing decoders to write wider pixels past the end of the smaller allocation. The upstream fix (commit 78d97d994579aef81aafe123773d525f40f2522a, PR 10105) clears _im on seek so the next load_prepare() reallocates correctly, and the accompanying regression tests in test_file_dcx.py, test_file_mic.py, test_file_mpo.py, test_file_psd.py and test_imagefile.py explicitly assert that _im is None after a mode or size change. Although the CVE is classified CWE-125 (out-of-bounds read) and the MPO path does permit a native over-read, the DCX/PSD/MIC paths described are fundamentally out-of-bounds writes into an undersized heap allocation, which is why the record also carries a Buffer Overflow tag; the two classes stem from the same lifetime/caching defect.

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 (CNA) PRIMARY 9.8 CRITICAL
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
vuln.today AI 9.8 CRITICAL

A service auto-processing an uploaded crafted image needs no auth or user interaction (PR:N/UI:N/AV:N), the OOB write and crash are trivially triggered (AC:L), and worst-case impacts span disclosure, corruption, and crash (C/I/A:H).

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

Primary rating from Vendor (CNA).

CVSS VectorVendor

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

Lifecycle Timeline

4
Patch available
Oct 21, 2026 - 22:03 EUVD
Analysis Updated
Oct 21, 2026 - 21:28 vuln.today
v2 - CVSS changed
CVSS changed
Oct 21, 2026 - 21:23 NVD
9.8 (CRITICAL)
CVE Published
Oct 21, 2026 - 19:14 oss-security
CRITICAL

Description PRE-NVD

Disclosed via oss-security. NVD scoring and full description are pending.

Technical POC Analysis

The flaw is stale native ImagingCore buffer reuse, producing out-of-bounds memory access.

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

A critical memory-safety defect in Pillow (versions 11.0.0 through 12.x) can allow a crafted multi-frame image to corrupt memory and, under certain runtime conditions, execute commands on the host running the Python image-processing service. The exposure is concentrated in automated upload-validation and thumbnail pipelines that accept PSD, MPO, DCX, or MIC files and walk beyond the first frame - typically internet-facing, fully automated systems where a single malicious file needs no credentials or user interaction. Leadership should care because the affected library is a shared dependency across many services, so one unpatched consumer can expose common processing infrastructure and downstream customer data.

Business Impact: High
Compensating Controls

Apply vendor patch: upgrade to Pillow 13.0.0. Where the upgrade cannot be deployed immediately, interim mitigations are: reject or quarantine PSD, MPO, DCX, and MIC uploads at the edge; force single-frame decode paths and never seek past frame zero on untrusted input; re-encode untrusted images to a flat single-frame format in a disposable, non-privileged, memory- and CPU-capped sandbox with no outbound network access; and monitor image workers for crashes, restarts, and memory anomalies as a detection signal. Exploitation status: no public exploit identified at time of analysis.

Threat Intelligence Overview

EPSS Score
0.6%
Top 54% exploitable
Prevalence
High
Pillow is a near-default imaging library across Python web and ML applications
Threat Intel
1
1 source
Social Media
1
Sightings
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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.6%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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
High

Priority Score

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

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

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-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

CVE-2020-5312 CRITICAL
9.8 Jan 03

libImaging/PcxDecode.c in Pillow before 6.2.2 has a PCX P mode buffer overflow. Rated critical severity (CVSS 9.8), this

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