Skip to main content

Pillow CVE-2026-112402

| EUVDEUVD-2026-104641 HIGH
Use After Free (CWE-416)
2026-10-19 GitHub_M GHSA-7mwm-ghpf-9vrm
8.7
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Submit crafted large image to transform endpoint
  2. Delivery
    Drive oversized Image.transform() under memory pressure
  3. Exploit
    Output allocates but per-column lookup allocation fails
  4. Execution
    Error path double-frees image storage
  5. Impact
    Process crash or memory corruption

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
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 Image.transform() using the fast path - specifically Transform.EXTENT or a pure scale-and-translate Transform.AFFINE with the default NEAREST resampling filter - on an operation large enough that memory allocation is strained. The precise trigger is a selective allocation failure: the output image allocation must succeed while the additional per-column lookup allocation fails, so the host must be under genuine memory pressure for the vulnerable error path to execute. Limiting factors: the attacker must be able to influence transform size/parameters (typically via an image-upload or image-processing feature), reliable triggering depends on the non-deterministic memory-pressure window rather than a guaranteed condition, and only Pillow versions prior to 13.0.0 are affected. There is no authentication requirement in the supplied CVSS vector (PR:N) and no user interaction (UI:N).

Impact

The input CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N) scores 8.7 (High) and is driven entirely by availability impact (VA:H) with no confidentiality or integrity impact - this is fundamentally a denial-of-service/memory-corruption bug, not a disclosure or code-execution flaw as confirmed. No EPSS score, KEV listing, or POC was provided, so the signal set is thin: no public exploit identified at time of analysis and no evidence of active exploitation. The AC:L/AT:N rating in the supplied vector conflicts with the description, which requires the attacker to 'drive such a large Image.transform() operation under memory pressure' such that the output allocation succeeds while the per-column lookup allocation selectively fails - this is a probabilistic, environment-dependent precondition, not a deterministic low-complexity trigger, so the real-world reliability is considerably lower than 8.7 implies. The description also hedges impact as 'may trigger', 'can crash', and 'may corrupt memory', meaning the worst-case (exploitable memory corruption → code execution) is unconfirmed and speculative; the confirmed outcome is a process crash. Net assessment: a genuine bug worth patching in exposed image-processing pipelines, but closer to a conditional DoS than a widely-weaponizable critical issue, and the raw high CVSS overstates priority absent exploit evidence.

Exploit ScenarioDerived

A web service that accepts user-supplied images and performs resize/transform operations (e.g. thumbnailing via Image.transform with EXTENT or scale-and-translate AFFINE under default NEAREST resampling) is targeted by an attacker who submits a very large transform request while the host is under memory pressure. If the output image allocation succeeds but the subsequent per-column lookup allocation fails, the error path double-frees image storage, crashing the worker process and potentially corrupting memory. No public exploit code is identified, and reliable triggering depends on inducing the specific allocation-failure window.

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 – Oct 19, 2026

Memory corruption in Pillow versions prior to 13.0.0 can crash the process when Image.transform() takes the fast Transform.EXTENT or pure scale-and-translate Transform.AFFINE path with default NEAREST resampling and a selective allocation failure occurs under memory pressure. The defect is a double free/use-after-free in ImagingScaleAffine: the output image allocation succeeds, the additional per-column lookup allocation fails, and the error path deletes image storage that later cleanup releases again (CWE-416). The assessed impact is availability-only with no confidentiality or integrity effect, exploitation depends on attacker-influenced transform sizes plus genuine memory pressure, and no public exploit identified at time of analysis.

RemediationAI

Upgrade to Pillow 13.0.0 or later; this is the vendor-released patch and contains commit aafa6c75f7cdabb9f409a8aac7c780bea31d08d9, with details in advisory GHSA-7mwm-ghpf-9vrm (https://github.com/python-pillow/Pillow/security/advisories/GHSA-7mwm-ghpf-9vrm) and the 13.0.0 release notes (https://github.com/python-pillow/Pillow/releases/tag/13.0.0). If immediate upgrade is not possible, constrain attacker-controlled Image.transform() output dimensions and input image sizes so large allocations cannot be requested, reject or cap EXTENT and pure scale-and-translate AFFINE transforms above a safe size, and consider forcing a non-NEAREST resampling filter for untrusted transforms where feasible-accepting altered image quality and validating behavior, since this is a compensating control rather than a guaranteed fix. Run image processing under memory limits and process isolation so an allocation failure or double free produces a contained crash instead of broader host impact.

Affected VersionsENISA

Pillow < 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 a Python imaging library whose performance-critical operations are implemented in C extensions, including src/_imaging.c and libImaging/Geometry.c. The affected code is the ImagingScaleAffine fast path for Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations using the default NEAREST resampling filter. CWE-416 (use-after-free) manifests here as a double free: when the output image allocation succeeds but the per-column lookup allocation fails, the error path releases image storage that is later released again during cleanup; the upstream fix removes the premature ImagingDelete(imOut) in Geometry.c and adds return-value handling in _resize so the caller deletes imOut on transform failure. The CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* covers Pillow releases before 13.0.0. The supplied CVSS 4.0 vector scores 8.7 with AC:L and availability-only impact, while the independent CVSS 3.1 assessment rates AC:H because the trigger requires a non-deterministic selective allocation failure under memory pressure; both agree that confidentiality and integrity impacts are absent.

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 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 5.9 MEDIUM

Attacker-influenced transform is reachable over the network (AV:N, PR:N), but triggering the double free needs a specific memory-pressure allocation-failure window, so AC:H; impact is availability-only (A:H, C/I:N).

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:P/PR:N/UI:N/VC:N/VI:N/VA:H/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
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
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 - 21:18 cve.org
HIGH 8.7

DescriptionCVE.org

Pillow is a Python imaging library. Prior to 13.0.0, Pillow can double free image memory when ImagingScaleAffine encounters a selective allocation failure. The affected fast path handles Transform.EXTENT or pure scale-and-translate Transform.AFFINE operations with the default NEAREST resampling. The output image allocation must succeed while the additional per-column lookup allocation fails, after which the error path deletes image storage that later cleanup releases again. An attacker who can drive such a large Image.transform() operation under memory pressure may trigger the failure. This can crash the process and may corrupt memory. 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
  • 89,616 pypi packages depend on pillow (20,283 direct, 70,825 indirect)

Ecosystem-wide dependent count for version 13.0.0.

Technical POC Analysis

CWE-416 (use-after-free, manifesting as a double free) in ImagingScaleAffine() at src/libImaging/Geometry.c:866 (advisory commit a707c6b21c313880d0771e54965d142dd42358b6).

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 memory-corruption flaw (CVE-2026-112402) in the Pillow image-processing library can crash the Python process handling image transformations, so any service, API endpoint, or batch pipeline that resizes or crops untrusted images may become intermittently unavailable. Triggering it requires an attacker to influence image geometry at the same moment the host is under genuine memory pressure, so disruption is likely to be sporadic and hard to attribute rather than a clean, repeatable outage. There is no confidentiality or integrity exposure and no public exploit identified at time of analysis, but Pillow is embedded broadly across our image-handling estate, making this a resilience and availability risk rather than a data-breach risk.

Business Impact: Medium
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: (1) enforce maximum decoded image and transform output dimensions before Image.transform() executes; (2) run image processing in isolated worker processes or containers with memory limits and auto-restart so a double free only drops one worker; (3) avoid or gate the Transform.EXTENT and scale-and-translate Transform.AFFINE fast paths, or use a non-NEAREST resampling filter, for untrusted images; (4) monitor and throttle memory pressure on image-handling hosts and reject oversized image payloads at the edge.

Threat Intelligence Overview

EPSS Score
0.4%
Top 63% exploitable
Prevalence
High
Pillow is among the most widely used Python imaging libraries across web and ML stacks
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA 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 No
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
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Medium
Technical Impact
Partial

Priority Score

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

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

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.

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

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