Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload crafted zero-width PPM/PGM image
-
ExploitApplication invokes ImageMorph MorphOp.apply()
-
ExecutionRoutine indexes outrow[width-1] out of bounds
-
ImpactProcess crashes (denial of service)
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 (1) the target application to decode an attacker-supplied PPM or PGM image that produces an image with width zero, and (2) the application to call Pillow's ImageMorph.MorphOp.apply() (a morphology operation such as erosion8/dilation) on that image. The limiting factor is the morphology code path: most Pillow deployments never invoke ImageMorph, so only applications explicitly performing morphological operations on untrusted images are affected. No authentication is required (PR:N) and no user interaction beyond supplying the image (UI:N); impact is confined to a process crash with no data exposure or code execution. |
| Impact | This is a denial-of-service memory-safety flaw with a narrow real-world risk profile despite its 8.7 (HIGH) CVSS 4.0 base score. The vector (CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H) correctly reflects the single meaningful consequence: availability impact only (VA:H) via a process crash, with no confidentiality or integrity impact (VC:N/VI:N). CWE-787 (out-of-bounds write) is listed, but the description and fix indicate an out-of-bounds memory access at outrow[width-1] when width is 0 - the demonstrated and fixed impact is a crash, not code execution, so the score's C:N/I:N is consistent. The network attack vector (AV:N) is realistic only indirectly: Pillow itself is a local library, so AV:N applies solely to applications that ingest attacker-supplied images over a network AND then invoke the morphology routine - a comparatively uncommon code path. There is NO EPSS score, NO CISA KEV listing, and NO public exploit (only a vendor fix commit and a test case are provided), so all active-exploitation and probability signals are absent rather than low. Net: this is a legitimate but low-urgency DoS to patch in the normal cycle for anyone using ImageMorph; it is not a high-real-risk emergency, and the HIGH severity reflects easy triggering conditions rather than severe impact. Note the signal tension: AV:N raises the paper score, but exploitability is gated by the application calling MorphOp.apply() on untrusted input - verify whether your deployment actually uses morphology operations. |
| Exploit ScenarioDerived | An application accepts user-uploaded images and passes them through Pillow's ImageMorph.MorphOp.apply() (e.g., for preprocessing or OCR cleanup). An attacker uploads a crafted PPM or PGM file decoded to a zero-width image; the native morphology routine indexes outrow[width-1], reads/writes out of bounds, and crashes the worker process, causing denial of service. No public exploit code is provided - only the vendor fix commit and a regression test demonstrate the condition. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Process crash in Pillow before 13.0.0 can be triggered when an application decodes an attacker-supplied PPM or PGM image with zero width and then applies an ImageMorph morphology operation. The flaw is an out-of-bounds memory access in the native morphology routine, and unauthenticated remote attackers can exploit it only when that specific ImageMorph code path is used, resulting in denial of service rather than data exposure or code execution. Vendor-released patch: 13.0.0; no public exploit identified at time of analysis.
RemediationAI
Upgrade Pillow to version 13.0.0, which contains the vendor fix for zero-width and zero-height geometry in the ImageMorph native path. If immediate upgrade is not possible, avoid calling ImageMorph.MorphOp.apply() on untrusted or unvalidated images, and reject PPM/PGM files whose decoded dimensions include zero width or zero height before any morphology operation; these controls trade compatibility with malformed or unusual image inputs for safety. Running image parsing and morphology in a separate, resource-limited process can contain a crash but does not remove the underlying flaw. Refer to the vendor advisory https://github.com/python-pillow/Pillow/security/advisories/GHSA-58r4-6rv3-gfh8 and the 13.0.0 release https://github.com/python-pillow/Pillow/releases/tag/13.0.0 for patch details.
Affected VersionsENISA
Affected Packages
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 with native C extensions for performance-sensitive operations. The affected code is ImageMorph.MorphOp.apply() in src/_imagingmorph.c, which performs morphology operations such as erosion or dilation on image buffers. PPM and PGM parsing can produce an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry, producing an out-of-bounds memory access classified as CWE-787. The upstream fix adds an early return when width or height is zero and includes a regression test for zero-width images. Although the memory-safety class can include memory corruption, the assessed impact for this CVE is limited to a process crash with no confidentiality or integrity impact; exploitation is constrained to applications that explicitly call ImageMorph on untrusted PPM/PGM input.
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
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
Attacker-supplied image reaches the parser remotely with no auth or interaction (AV:N/PR:N/UI:N), trivially crafted zero-width input (AC:L), and the only impact is a crash (A:H, C:N/I:N).
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
2DescriptionCVE.org
Pillow is a Python imaging library. Prior to 13.0.0, Pillow's ImageMorph.MorphOp.apply() can access memory before a row buffer for a zero-width image. PPM and PGM input can create an image with width zero, and the native morphology routine indexes outrow[width - 1] without rejecting that geometry. An attacker can supply such an image to an application that applies a morphology operation. This can crash the process. This issue is fixed in version 13.0.0.
Blast Radius
ecosystem impact- 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-787 (out-of-bounds write) in Pillow's native morphology extension, src/imagingmorph.c.
Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.
Executive ViewAI
Pillow, a widely used Python image processing library, contains a high-severity denial-of-service vulnerability (CVE-2026-112397) that can crash applications when processing maliciously crafted PPM or PGM images with zero width followed by an ImageMorph operation. This affects any service that decodes untrusted images, potentially disrupting availability for end users and downstream systems. Leadership should prioritize upgrading to Pillow 13.0.0 to prevent service outages.
Apply vendor patch.
Threat Intelligence Overview
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.
What every action level means
SSVC AssessmentENISA
Priority Score
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.
libImaging/TgaRleDecode.c in Pillow 9.1.0 has a heap buffer overflow in the processing of invalid TGA image files. Rated
Denial of service in Python Pillow (versions 8.2.0 through 12.2.0) allows remote attackers to exhaust memory during JPEG
Out-of-bounds memory disclosure in Python Pillow before 12.3.0 lets an attacker who supplies a crafted McIdas AREA image
Heap out-of-bounds write in Python Pillow prior to 12.3.0 lets an attacker who controls the rank-filter size parameter c
Uncontrolled memory consumption in Python Pillow (PIL) versions 5.1.0 through 12.2.x allows a remote attacker to cause d
The package pillow 5.2.0 and before 8.3.2 are vulnerable to Regular Expression Denial of Service (ReDoS) via the getrgb
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
Integer overflow in the ImagingResampleHorizontal function in libImaging/Resample.c in Pillow before 3.1.1 allows remote
Python Image Library (PIL) 1.1.7 and earlier and Pillow 2.3 might allow remote attackers to execute arbitrary commands v
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
Pillow through 8.2.0 and PIL (aka Python Imaging Library) through 1.1.7 allow an attacker to pass controlled parameters
An issue was discovered in Pillow before 8.1.1. Rated critical severity (CVSS 9.8), this vulnerability is remotely explo
EUVD-2026-104640
GHSA-58r4-6rv3-gfh8
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB