Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessUpload crafted FlashPix (.fpx) file
-
DeliveryApplication opens/thumbnails image via Pillow
-
ExploitFPX JPEG tile decoded as JCS_UNKNOWN 4-component
-
ExecutionOverflow writes past two-byte LA tile buffer
-
PersistCorrupt heap memory
-
ImpactAchieve arbitrary code execution
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 the target application to (1) have Pillow installed WITH the optional 'olefile' dependency present - olefile is not a default Pillow dependency, so this is a significant limiting factor - and (2) open or thumbnail an attacker-supplied OLE2 FlashPix (FPX) file. The specific trigger is a crafted FlashPix JPEG tile whose JPEG mode is unrecognized so libjpeg decodes it as JCS_UNKNOWN with four components, overflowing the two-byte-per-pixel (raw mode LA) tile buffer. No authentication is required (PR:N) and no explicit user interaction is encoded in the CVSS vector (UI:N), but the CVSS-assessed HIGH attack complexity reflects the crafting and heap-grooming effort needed, and exposure is confined to applications that process untrusted FlashPix input. |
| Impact | This is a genuinely high-severity memory-corruption flaw (CWE-122 heap buffer overflow) that can lead to arbitrary code execution, and the fix is confirmed by a vendor security advisory (GHSA-5x8w-8jj5-q52h), a patch commit, and the 13.0.0 release. The provided CVSS 4.0 vector (AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H, 9.2) indicates a network-reachable, unauthenticated path with full confidentiality/integrity/availability impact, but notably rates attack complexity HIGH - consistent with the need to craft a FlashPix file that coerces libjpeg into JCS_UNKNOWN four-component decoding and to turn resulting heap corruption into reliable code execution. Two signals temper the raw score: (1) the vulnerable code path is only reachable when the OPTIONAL olefile dependency is installed, so many Pillow deployments are not exposed by default, and (2) no EPSS score, CISA KEV listing, or public POC is present in the provided data, so there is no evidence of active exploitation or weaponization - only a confirmed, patched bug. Net: a real priority for any service that thumbnails or opens untrusted images with olefile present, but not an in-the-wild emergency on the current evidence. EPSS is absent (not low) - exploitation probability cannot be quantified from the provided data. |
| Exploit ScenarioDerived | An attacker uploads a crafted OLE2 FlashPix (.fpx) file to a web application or image-processing pipeline that uses Pillow with the optional olefile dependency installed to open or generate thumbnails of user-supplied images. When Pillow decodes the embedded JPEG tile, an unrecognized JPEG mode is decoded as JCS_UNKNOWN with four components and written into a two-byte-per-pixel LA tile buffer, corrupting the heap; a successful groom can escalate this to arbitrary code execution in the service process. No public exploit code is identified at time of analysis, and the high attack complexity means reliable RCE requires non-trivial heap manipulation. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Oct 19, 2026
Heap-based buffer overflow in Pillow before 13.0.0 can corrupt memory and potentially enable arbitrary code execution when an application with the optional olefile dependency opens or thumbnails a crafted OLE2 FlashPix (FPX) image. The flaw is reachable by unauthenticated remote attackers who can supply malicious image input, but exposure is limited to deployments that have installed olefile and process untrusted FPX content; no public exploit identified at time of analysis, and no confirmed active exploitation (CISA KEV). The vendor-released patch is Pillow 13.0.0.
RemediationAI
Upgrade Pillow to 13.0.0 or later; the vendor-released patch is version 13.0.0 as documented in GHSA-5x8w-8jj5-q52h and the 13.0.0 release tag, with the bounds check added in commit 242a059aedc1935097d9aa1dc3f099750467ba75. If upgrading is not immediately possible, remove the optional olefile dependency from environments that process untrusted images, which disables FlashPix/OLE2 handling and any application features that rely on olefile; alternatively or additionally, block or reject FPX/OLE2 uploads at the application boundary and run image loading in an isolated low-privilege sandbox or container so heap corruption cannot easily reach sensitive components. These workarounds are compensating controls, not fixes, and should be followed by verification testing after applying the 13.0.0 update.
Affected VersionsENISA
Affected Packages
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, the Python imaging library, uses libImaging/JpegDecode.c to decode JPEG data through libjpeg. In the FlashPix (FPX) path, Pillow selects raw mode LA, allocating a tile buffer with two bytes per pixel, but a crafted FlashPix JPEG tile can use an unrecognized JPEG mode that libjpeg decodes as JCS_UNKNOWN with four components. ImagingJpegDecode then writes four-component scanlines into the two-byte-per-pixel tile buffer, producing a heap buffer overflow (CWE-122). The commit 242a059aedc1935097d9aa1dc3f099750467ba75 adds a check that libjpeg's output width and component count fit within the tile buffer. The CPE cpe:2.3:a:python-pillow:pillow:*:*:*:*:*:*:*:* identifies Pillow versions before 13.0.0 as affected; the optional olefile dependency is not installed by default, so only deployments that explicitly added it and process untrusted FlashPix/OLE2 files are exposed.
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:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
Untrusted file reaches a network-facing image service (AV:N, PR:N, UI:N); crafting JCS_UNKNOWN decoding plus heap grooming and the optional olefile prerequisite justify AC:H; heap RCE yields C:H/I:H/A:H, S:U.
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 FlashPix JPEG-tile decoder can write decoded scanlines beyond the allocated tile buffer. FlashPix (FPX) JPEG decoding selects raw mode LA with two bytes per pixel, while an unrecognized JPEG mode can be decoded as JCS_UNKNOWN with four components, causing ImagingJpegDecode to write four-component scanlines into the two-byte tile buffer. An attacker can supply a crafted OLE2 FlashPix file to an application with the optional olefile dependency installed that opens or thumbnails untrusted input. This can corrupt heap memory and may allow arbitrary code execution. This issue is fixed in version 13.0.0.
Articles & Coverage 1
Technical POC Analysis
CWE-122 heap-based buffer overflow in Pillow's FlashPix (FPX) JPEG-tile decoder.
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 imaging library, contains a critical heap-based buffer overflow (CVE-2026-112398) that can lead to arbitrary code execution when an application with the optional olefile dependency processes a crafted OLE2 FlashPix (FPX) image. This affects organizations that use Pillow with olefile to handle untrusted image inputs-such as web uploads or thumbnail generation-and could result in system compromise, though exposure is limited to those specific configurations. At time of analysis, no public exploit identified at time of analysis. Vendor-released patch: Pillow 13.0.0.
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.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
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-104634
NVD
CVE.org
EPSS
GitHub
Exploit-DB