Description
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.
Published: 2026-10-19
Score: 9.2 Critical
EPSS: n/a
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

Pillow, a widely used Python imaging library, contains a heap buffer overflow in its FlashPix (FPX) JPEG tile decoder. The flaw arises when the decoder selects a raw mode with two bytes per pixel but an unrecognized JPEG mode is decoded with four components, leading to write operations beyond the allocated tile buffer. This causes memory corruption and may give an attacker arbitrary code execution. The weakness is a classic heap overflow (CWE-122) and also involves improper bounds checking (CWE-787).

Affected Systems

The vulnerability affects all Pillow installations prior to version 13.0.0 that have the optional olefile dependency. Applications that load or thumbnail untrusted OLE2 FlashPix files through Pillow are therefore impacted. The fix is included in Pillow 13.0.0 and newer.

Risk and Exploitability

With a CVSS score of 9.2 the flaw is considered critical. The EPSS score is not available, and the vulnerability is not listed in CISA's KEV catalog, but the nature of the heap overflow and the ability to execute injected code mean that once an attacker can supply a crafted image to a vulnerable application, the attack can succeed with minimal effort. The likely attack vector is the ingestion of a malicious OLE2 FlashPix file by an application that relies on Pillow's image handling and has the olefile module installed. The risk is high for systems that process user-supplied images without additional validation.

Generated by OpenCVE AI on October 20, 2026 at 00:21 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update Pillow to version 13.0.0 or later to apply the vendor patch
  • If Pillow must remain at an older version, remove or disable the olefile dependency so that FlashPix JPEG files cannot be processed
  • Implement input validation or sandboxing for image processing to prevent untrusted files from reaching Pillow

Generated by OpenCVE AI on October 20, 2026 at 00:21 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Mon, 19 Oct 2026 23:00:00 +0000

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow

Mon, 19 Oct 2026 21:30:00 +0000

Type Values Removed Values Added
Description 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.
Title Pillow: Heap buffer overflow in FlashPix (FPX) JPEG decoding leads to code execution
Weaknesses CWE-122
CWE-787
References
Metrics cvssV4_0

{'score': 9.2, 'vector': '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'}


Subscriptions

Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-19T21:07:25.229Z

Reserved: 2026-10-19T16:58:51.959Z

Link: CVE-2026-112398

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-19T22:17:07.107

Modified: 2026-10-19T22:17:07.107

Link: CVE-2026-112398

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T00:30:07Z

Weaknesses