Skip to main content

Pillow CVE-2026-112398

| EUVDEUVD-2026-104634 CRITICAL
Heap-based Buffer Overflow (CWE-122)
2026-10-19 GitHub_M
9.2
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Upload crafted FlashPix (.fpx) file
  2. Delivery
    Application opens/thumbnails image via Pillow
  3. Exploit
    FPX JPEG tile decoded as JCS_UNKNOWN 4-component
  4. Execution
    Overflow writes past two-byte LA tile buffer
  5. Persist
    Corrupt heap memory
  6. Impact
    Achieve 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.

Act Now Prioritize within 24-48h. Why: CRITICAL severity.
Patch available 0.3% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – 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

Pillow < 13.0.0

Affected Packages

euvd pillow fix: 13.0.0

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

Vendor (GitHub_M) PRIMARY 9.2 CRITICAL
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
vuln.today AI 8.1 HIGH

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
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:07 cve.org
CRITICAL 9.2

DescriptionCVE.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.

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

Why It Matters

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.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 76% exploitable
Prevalence
High
Pillow is the de facto Python imaging library, extremely widely deployed in web/app stacks
Data Quality
5 sources
Confidence: Medium

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 CRITICAL
CISA KEV No
Public POC No
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
CRITICAL severity
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
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No
Human Impact
High

Priority Score

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

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

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