Skip to main content

Pillow CVE-2026-42309

| EUVDEUVD-2026-28901 MEDIUM
Heap-based Buffer Overflow (CWE-122)
2026-05-04 https://github.com/python-pillow/Pillow GHSA-5xmw-vc9v-4wf2
5.1
CVSS 4.0 · Vendor: https://github.com/python-pillow/Pillow
View

Attack ChainAIDerived

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

  1. Access
    Attacker supplies nested list coordinate data
  2. Delivery
    Application passes nested lists to ImageDraw API
  3. Exploit
    Recursive unpacking exceeds buffer bounds
  4. Execution
    Heap overflow occurs
  5. Impact
    Memory corruption/denial of service or arbitrary code execution achieved

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

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

Exploitation Conditions

Exploitation requires that an application using vulnerable Pillow versions (11.2.1-12.1.x) accepts user-controlled coordinate data and passes it directly to coordinate-accepting APIs: ImagePath.Path(), ImageDraw.ImageDraw.polygon(), or ImageDraw.ImageDraw.line(). The attacker must be able to supply deeply nested list structures (e.g., lists containing lists containing coordinate pairs) as coordinate arguments. Default Pillow installations and standard API usage are vulnerable - no special configuration is required. The vulnerability is limited to local Python processes that handle untrusted image drawing requests; it cannot be exploited remotely unless the vulnerable code is exposed via a network service (web application, API server, etc.). Applications that validate and flatten coordinate data before passing to these APIs, or that only accept simple two-element tuples from trusted sources, are not vulnerable.

Impact

This vulnerability presents moderate-to-high real-world risk despite missing CVSS and EPSS data. The attack vector is local (applications must pass untrusted coordinate data to vulnerable APIs), which limits network-wide exploitation but poses significant risk in server environments processing user-supplied image drawing requests. No authentication is required - any code path that accepts user-controlled coordinate arguments is vulnerable. The heap buffer overflow could enable denial of service through crashes or, in theory, arbitrary code execution through heap corruption, though practical exploitation depends on heap layout and exploit mitigations. The vulnerability was introduced in a minor release (11.2.1) and affects a widely-used library, suggesting moderate adoption of vulnerable versions before the fix (12.2.0) was released. Lack of KEV status and public POC availability suggests limited active exploitation as of the analysis date, but the severity of heap overflows and simplicity of triggering conditions (nested lists are trivial to construct) warrant prompt patching. Organizations using Pillow for server-side image processing or web-based image manipulation should prioritize upgrades.

Exploit ScenarioDerived

An attacker controlling image drawing parameters in a web application (e.g., a service that generates custom images via user input) crafts a request with deeply nested coordinate lists such as '[[[1, 2]]]' or similar structures. When passed to ImageDraw.polygon() or ImageDraw.line(), the recursive unpacking logic exhausts the allocated buffer, causing a heap overflow. This either crashes the application (denial of service) or corrupts heap structures, potentially leading to code execution if the attacker can control heap layout and overwrite function pointers or other critical data.

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

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

Alert me

AnalysisAIv1 – May 04, 2026

Heap buffer overflow in Pillow 11.2.1 through 12.1.x allows local attackers to cause denial of service or potentially execute arbitrary code by passing deeply nested list structures as coordinates to ImagePath.Path, ImageDraw.polygon, or ImageDraw.line APIs, which recursively unpack coordinates beyond allocated buffer boundaries.

RemediationAI

Upgrade Pillow to version 12.2.0 or later immediately via 'pip install --upgrade pillow>=12.2.0'. If immediate upgrade is not feasible, apply input validation at the application layer by sanitizing coordinate data before passing to ImagePath.Path, ImageDraw.polygon, or ImageDraw.line: validate that each coordinate is a two-element tuple or list containing only numeric values, and reject any nested list structures. This workaround has minimal performance impact but requires code changes in all calling code paths. Refer to the official advisory at https://github.com/python-pillow/Pillow/security/advisories/GHSA-5xmw-vc9v-4wf2 for additional technical details and verification steps.

Affected VersionsENISA

Pillow 11.2.1, < 12.2.0

Affected Packages

pypi pillow fix: 12.2.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 a Python imaging library that provides APIs for drawing operations on images. The vulnerability exists in coordinate handling for drawing primitives (polygon, line) and path operations. When processing coordinate arguments, the code failed to validate that coordinate pairs were properly formed two-element numeric tuples; instead, it recursively unpacked nested list structures without bounds checking. This classic heap buffer overflow (CWE-122: Stack-based Buffer Overflow / Heap-based) occurs because the unpacking logic did not account for the depth of nesting and continued writing beyond the pre-allocated buffer. The affected CPE is pip/pillow, a Python package distributed via PyPI.

Know when the next one hits your stack

  • 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 (https://github.com/python-pillow/Pillow) PRIMARY 5.1 MEDIUM
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
SUSE 5.5 MEDIUM
AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
Red Hat 5.1 MEDIUM

Primary rating from Vendor (https://github.com/python-pillow/Pillow).

CVSS VectorVendor: https://github.com/python-pillow/Pillow

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

DescriptionCVE.org

Passing nested lists as coordinates to APIs that accept coordinates such as ImagePath.Path, ImageDraw.ImageDraw.polygon and ImageDraw.ImageDraw.line could cause a heap buffer overflow, as nested lists were recursively unpacked beyond the allocated buffer. Coordinate lists are now validated to contain exactly two numeric coordinates. This was introduced in Pillow 11.2.1.

Blast Radius

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

Ecosystem-wide dependent count for version 11.2.1.

Threat Intelligence Overview

EPSS Score
0.0%
Top 97% exploitable
Threat Intel
1
1 source
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS 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 MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
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
Defer
Exploitation· derived
None
System Exposure· derived
Small
Automatable· derived
No
Human Impact· derived
Medium

Priority Score

26
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +26
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.

A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Fixed
SUSE Linux Enterprise High Performance Computing 15 SP7 Fixed
SUSE Linux Enterprise Module for Package Hub 15 SP7 Fixed
SUSE Linux Enterprise Module for Python 3 15 SP7 Fixed
SUSE Linux Enterprise Server 15 SP7 Fixed

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