← Back to search

CVE-2026-96778

8.8 HIGHpublic exploit available

Published 2026-10-21 · Updated 2026-10-28

AI risk analysis

Summary
A heap-based buffer overflow in Pillow's JPEG encoder allows an attacker to overwrite adjacent heap memory by crafting a JPEG with a precisely-sized ICC profile and a forwarded comment, leading to crashes or potential code execution when re-saving untrusted images.
Exploitability
Exploitation requires the victim to re-save an untrusted JPEG image while preserving its ICC profile and comment, and relies on specific heap layout conditions for reliable code execution.
Blast radius
Successful exploitation could lead to remote code execution in the context of the application using Pillow (e.g., a web service processing user uploads), compromising confidentiality, integrity, and availability.
Detection
No reliable host or network indicator is derivable from the published description.
Prioritized remediation
Upgrade to Pillow version 13.0.0 or later.
heap-overflowrceimage-processingpythoncwe787

Analysis generated locally by garnet-coder (no data left the box). AI-assisted — verify against primary sources before acting.

NVD description

Pillow is a Python imaging library. From 9.4.0 until 13.0.0, ImagingJpegEncode() in src/libImaging/JpegEncode.c can call jpeg_write_marker() for a JPEG COM comment when an ICC profile has exactly filled the 65536-byte encoder buffer. libjpeg writes one byte before checking the exhausted free_in_buffer counter, which then wraps and permits the attacker-controlled comment and subsequent compressed image data to overwrite adjacent heap memory. Re-saving an untrusted image as JPEG while preserving its ICC profile and forwarded comment can crash the process and may enable code execution in suitable runtime and heap layouts. This issue is fixed in version 13.0.0.

CVSS vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Weaknesses

CWE-787

Vendors

python

Products

pillow

Public exploit & PoC references

All references

Source data: NVD (nvd.nist.gov), public domain. Exploit-DB.ai adds local AI analysis for defensive use only.

Related CVEs

Related by shared AI tags and CWE weakness class. Browse the full archive.