Vulnerability · Published Oct 21, 2026 · Assigned by GitHub_M

CVE-2026-96778Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer

High 7.7

In plain English

A high-severity out-of-bounds write in Pillow from python-pillow. There are no confirmed reports of exploitation so far. The chance it is exploited in the next 30 days is estimated at 0.5% (higher than 40% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.

Severity (CVSS 4.0)7.7High
Exploit odds (30 days)0.5%top 60.4% of all CVEs
Exploited in the wildNo reportsCISA SSVC: none
Attack tooling1Public PoC

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

Affected packages & fixed versions

EcosystemPackageFixed inAdvisory
Debian:12pillowno fix listedDEBIAN-CVE-2026-96778
Debian:13pillowno fix listedDEBIAN-CVE-2026-96778
Debian:14pillowno fix listedDEBIAN-CVE-2026-96778
PyPIpillow13.0.0GHSA-g7cr-3p24-7wf7
Ubuntu:24.04:LTSpillowno fix listedUBUNTU-CVE-2026-96778
Ubuntu:26.04:LTSpillowno fix listedUBUNTU-CVE-2026-96778
Ubuntu:26.10pillowno fix listedUBUNTU-CVE-2026-96778

Affected products (as reported)

VendorProductVersions
python-pillow Pillow >= 9.4.0, < 13.0.0

Weakness: CWE-787 · Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

References