CVE-2026-96778 Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer
- Exploited in the wild
- Not known
- Fix
- Available
What is CVE-2026-96778?
CVE-2026-96778 is a high-severity vulnerability in Python Pillow, published on 21 Oct 2026.
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.
Weakness: CWE-787
Which versions are affected by CVE-2026-96778?
3 open source packages ship an affected version, including pillow and Pillow. It affects 1 product.
| Package | Affected | Fixed in |
|---|---|---|
pillow Bitnami | From 9.4.0 | 13.0.0 |
pillow PyPI | From 9.4.0 | 13.0.0 |
Pillow PyPI | From 9.4.0 | 13.0.0 |
Products include Python Pillow.
How do I fix CVE-2026-96778?
Upgrade pillow to 13.0.0 or later.
Is CVE-2026-96778 being exploited?
There is no known exploitation of CVE-2026-96778 in the wild and no public exploit code.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Python Pillow
Sources
Also known as BIT-pillow-2026-96778, CLSA-2026-1793101376, DEBIAN-CVE-2026-96778, ECHO-5f9d-bfb0-9576, GHSA-g7cr-3p24-7wf7, ROOT-APP-PYPI-CVE-2026-96778 and 1 more.