Skip to main content

Pillow CVE-2026-59205

| EUVDEUVD-2026-43746 HIGH
Out-of-bounds Write (CWE-787)
2026-07-14 GitHub_M GHSA-9hw9-ch79-4vh6
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Submit crafted image to color-management endpoint
  2. Exploit
    App calls ImageCmsTransform.apply with mismatched output mode
  3. Execution
    Native lcms2 transform writes past buffer bounds
  4. Impact
    Heap corruption crashes worker (DoS)

Vulnerability Assessment

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

2 techniques across 2 tactics: Execution, Privilege Escalation

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

Exploitation Conditions

Exploitation requires the application to invoke ImageCms.ImageCmsTransform.apply(im, imOut) where the supplied output image imOut has a mode that does not match the transform's declared output_mode (and, in the unpatched code path, an input im whose mode differs from input_mode) - e.g., applying a transform whose output_mode is RGB while passing an RGBA or LAB output image, exactly as shown in the fix's regression tests (t.apply(hopper('RGBA')) and t.apply(hopper('LAB'), hopper('RGBA'))). This is NOT default remote-unauthenticated exploitation of every Pillow install: it is limited to code paths that call the ImageCms transform apply() API and that allow the image mode/geometry to diverge from the transform's declared modes, typically when modes are driven by untrusted image input. Applications that never use ImageCms color transforms, or that always pass correctly mode-matched buffers, are not exposed.

Impact

The NVD CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, score 7.5) rates this network, low-complexity, unauthenticated with high availability impact and no confidentiality/integrity impact - consistent with a crash/DoS classification. That vector should be treated cautiously: exploitation is not a raw wire-protocol flaw but requires an application to call ImageCms.ImageCmsTransform.apply() with a mode-mismatched output image, so 'network' reachability depends on the application deriving image modes from untrusted input; AC:L is optimistic given the specific mode-mismatch precondition. The description's phrase 'controlled native heap corruption' suggests impact could exceed pure availability (potential integrity/code-execution consequences), which the NVD C:N/I:N scoring does not capture - verify with vendor before assuming DoS-only. No EPSS score was provided in the input, so widespread-exploitation probability cannot be quantified. This is not in CISA KEV and no POC beyond the regression test in the fix commit is provided, so real-world priority is moderate: patch promptly given Pillow's massive deployment footprint, but there is no evidence of active exploitation.

Exploit ScenarioDerived

An application performs ICC color-management on user-uploaded images and passes a pre-allocated output image whose mode is influenced by attacker-controlled input to ImageCmsTransform.apply(); the mismatched buffer geometry triggers an out-of-bounds write in the native lcms2 transform, crashing the worker process (denial of service) and potentially corrupting adjacent heap structures. Given AV:N/AC:L in the NVD vector, a remote user could repeatedly submit crafted images to exhaust or crash the service. No public exploit code has been identified; only the regression test accompanying the fix demonstrates the mode-mismatch trigger.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.4% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 14, 2026

Denial-of-service and controlled heap corruption in Python's Pillow imaging library (all versions prior to 12.3.0) occurs when ImageCms.ImageCmsTransform.apply() is invoked with an output image whose mode does not match the transform's declared output mode, causing an out-of-bounds write in the native color-management code. The pre-fix code only validated the output mode and never validated the input mode, so a mismatched buffer geometry lets the C-level transform write past allocation bounds. No public exploit has been identified at time of analysis; the fix is confirmed in release 12.3.0 via the vendor security advisory GHSA-9hw9-ch79-4vh6.

RemediationAI

Vendor-released patch: upgrade Pillow to 12.3.0 or later (pip install --upgrade 'Pillow>=12.3.0'), which adds explicit input-mode and output-mode validation before the native transform runs; see the advisory at https://github.com/python-pillow/Pillow/security/advisories/GHSA-9hw9-ch79-4vh6. Where an immediate upgrade is not feasible, the actionable compensating control is in application code: before calling ImageCms.ImageCmsTransform.apply(), assert that im.mode equals the transform's input_mode and that any supplied imOut.mode equals the transform's output_mode, rejecting or converting mismatched images (im.convert()) rather than passing them through - this mirrors the upstream fix and has minimal side effects. Additionally, avoid deriving transform modes or output-image modes directly from untrusted/attacker-supplied image metadata, and constrain ICC color-management workflows to trusted inputs; the trade-off is that strict mode validation may reject legitimate images with unusual color modes, which callers should handle by explicit conversion.

Affected VersionsENISA

Pillow < 12.3.0

Affected Packages

pypi pillow fix: 12.3.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's ImageCms module wraps LittleCMS (lcms2) to perform ICC color-profile transforms between color spaces (e.g., RGB, RGBA, LAB, CMYK). Each ImageCmsTransform carries a declared input_mode and output_mode that determine the pixel-buffer layout (bytes-per-pixel and channel count) the native transform expects. The root cause is CWE-787 (Out-of-bounds Write): the vulnerable apply() path validated only that imOut.mode matched output_mode and failed to validate that im.mode matched input_mode, so when the caller supplied images whose mode/channel geometry differs from what the native transform was compiled for, lcms2 reads and writes buffers sized for the wrong mode, corrupting the native heap. The CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* confirms the affected package is python-pillow across all versions below the fixed 12.3.0. The fix (PR #9715, commit a9ffc42) adds explicit 'mode mismatch' ValueError checks for both the input image mode and the output image mode before dispatching to the native apply().

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 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 5.9 MEDIUM

Reachable remotely only when an app feeds untrusted modes into the ImageCms apply() path with a mode mismatch, so AC:H; impact is native heap corruption manifesting primarily as availability loss (A:H), with C/I unconfirmed.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE 6.2 MEDIUM
AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 7.5 HIGH

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

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

Lifecycle Timeline

2
Patch available
Jul 14, 2026 - 18:20 EUVD
CVE Published
Jul 14, 2026 - 15:48 cve.org
HIGH 7.5

DescriptionCVE.org

Pillow is a Python imaging library. Prior to 12.3.0, Pillow's ImageCms.ImageCmsTransform.apply(im, imOut) API can trigger controlled native heap corruption when the caller supplies an output image whose mode does not match the transform's declared output mode. This issue is fixed in version 12.3.0.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 94,953 pypi packages depend on pillow (21,184 direct, 75,394 indirect)

Ecosystem-wide dependent count for version 12.3.0.

Executive ViewAI

Why It Matters

Python's Pillow library (versions before 12.3.0) is vulnerable to denial-of-service attacks that can disrupt image processing operations across web applications and data platforms. Given Pillow's widespread use in enterprise environments, affected organizations face risk of service interruptions and potential data handling issues. Rapid patching to version 12.3.0 is essential to protect business continuity for any organization processing images.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 69% exploitable
Prevalence
High
Pillow is among the most widely deployed Python imaging libraries in production
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
4 sources
Confidence: Medium
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

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 HIGH
CISA KEV No
Public POC Yes
EPSS 0.4%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: +20
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.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

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

Vendor StatusVendor

SUSE

Severity: Moderate
Product Status
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP4-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP4-LTSS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-ESPOS Affected
SUSE Linux Enterprise High Performance Computing 15 SP5-LTSS Affected

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