1. Home
  2. Vulnerabilities
  3. CVE-2026-96778

CVE-2026-96778

Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer

Published 21 Oct 2026 · modified 28 Oct 2026 · Sources: NVD, CNA (vendor or assigner), CERT-FR, EPSS (FIRST)

Medium 54/100

Summary

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 products and versions

python-pillow (1 line(s))
python-pillow
ProductVersionsFixed inSource
Pillow Versions not specified — CNA (vendor or assigner)
Pypi (1 line(s))
Pypi
ProductVersionsFixed inSource
pillow from 9.4.0 (included) to 13.0.0 (excluded) 13.0.0 GitHub Advisory
Python (1 line(s))
Python
ProductVersionsFixed inSource
Pillow from 9.4.0 (included) to 13.0.0 (excluded) — NVD

Fix

Upgrade — PyPI/pillow 13.0.0official source

Source : GitHub Advisory

Workaround

No workaround provided.

Check whether you are affected

Exploit reported by sources

These links are tagged “exploit” by the NVD or CVE.org. We have neither verified nor copied them; open with care.

Timeline

  1. — CVE published (cve)
  2. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1486)
  3. — CERT-FR advisory (certfr:CERTFR-2026-AVI-1527)

CERT-FR advisories

References

Data provenance

Status
NVD
Publication date
NVD
Description
CNA (vendor or assigner)
CVSS score
NVD
Weakness (CWE)
NVD
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H (CVSS 3.1, NVD)
Weakness
CWE-787 · Corruption mémoire

How this data is obtained and calculated