Description
Pillow is a Python imaging library. Prior to 13.0.0, Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width and component count after scaling is requested, and an 8-bit lossless SOF3 JPEG decoded by a build linked to libjpeg-turbo 3.x can ignore the requested downscaling geometry. An attacker can supply such a JPEG to an application that uses draft() or thumbnail() to request downscaling. This can corrupt heap memory, crash the process, or potentially allow code execution. Older libjpeg-turbo 2.x and IJG builds reject the SOF3 input. This issue is fixed in version 13.0.0.
Published: 2026-10-19
Score: 9.2 Critical
EPSS: < 1% Very Low
KEV: No
Impact: Potential Arbitrary Code Execution
Action: Immediate Patch
AI Analysis

Impact

Pillow, a widely used Python imaging library, contains a heap buffer overflow in its JPEG decoder when processing certain 8‑bit lossless SOF3 images. The flaw occurs during downscaling via draft() or thumbnail() because the decoder does not verify that the decoded width and component count match the requested size. If an attacker supplies a malicious JPEG, the program can corrupt heap memory, crash, or potentially execute arbitrary code.

Affected Systems

Any system running Pillow prior to version 13.0.0 is potentially affected. The issue is tied to builds of Pillow linked with libjpeg‑turbo 3.x; older libjpeg‑turbo 2.x or IJG builds reject the problematic SOF3 input. The fix is delivered in Pillow 13.0.0 and later.

Risk and Exploitability

The CVSS score of 9.2 indicates critical severity. Although the EPSS score is not available, the vulnerability is not listed in CISA's KEV catalog. The attack vector is likely local or remote depending on how the application receives JPEG input; a compromised image can trigger heap corruption and lead to code execution. As the failure mode is a buffer overflow, exploiting it generally requires the attacker to provide a crafted JPEG that the application will process, making prevention through input validation a key mitigation factor.

Generated by OpenCVE AI on October 20, 2026 at 06:30 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 13.0.0 or later
  • Avoid using draft() or thumbnail() on untrusted JPEG images; if needed, validate image parameters before processing
  • Implement additional input validation or sanitization to confirm image dimensions and component counts before decoding

Generated by OpenCVE AI on October 20, 2026 at 06:30 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-8g5g-8vmr-9782 Pillow: Heap buffer overflow in ImagingJpegDecode
History

Tue, 27 Oct 2026 15:15:00 +0000

Type Values Removed Values Added
First Time appeared Python
Python pillow
CPEs cpe:2.3:a:python:pillow:*:*:*:*:*:*:*:*
Vendors & Products Python
Python pillow
Metrics cvssV3_1

{'score': 9.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H'}


Fri, 23 Oct 2026 00:45:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


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:45:00 +0000

Type Values Removed Values Added
Description Pillow is a Python imaging library. Prior to 13.0.0, Pillow's JPEG decoder can write a full-width scanline into a buffer sized for a requested draft scale. ImagingJpegDecode does not verify libjpeg's actual output width and component count after scaling is requested, and an 8-bit lossless SOF3 JPEG decoded by a build linked to libjpeg-turbo 3.x can ignore the requested downscaling geometry. An attacker can supply such a JPEG to an application that uses draft() or thumbnail() to request downscaling. This can corrupt heap memory, crash the process, or potentially allow code execution. Older libjpeg-turbo 2.x and IJG builds reject the SOF3 input. This issue is fixed in version 13.0.0.
Title Pillow: Heap buffer overflow in ImagingJpegDecode
Weaknesses CWE-122
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
Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-22T21:08:58.141Z

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

Link: CVE-2026-112403

cve-icon Vulnrichment

Updated: 2026-10-22T21:08:46.915Z

cve-icon NVD

Status : Analyzed

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

Modified: 2026-10-27T15:00:15.043

Link: CVE-2026-112403

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T06:45:12Z

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow