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.
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
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian:12 | pillow | no fix listed | DEBIAN-CVE-2026-96778 |
| Debian:13 | pillow | no fix listed | DEBIAN-CVE-2026-96778 |
| Debian:14 | pillow | no fix listed | DEBIAN-CVE-2026-96778 |
| PyPI | pillow | 13.0.0 | GHSA-g7cr-3p24-7wf7 |
| Ubuntu:24.04:LTS | pillow | no fix listed | UBUNTU-CVE-2026-96778 |
| Ubuntu:26.04:LTS | pillow | no fix listed | UBUNTU-CVE-2026-96778 |
| Ubuntu:26.10 | pillow | no fix listed | UBUNTU-CVE-2026-96778 |
Affected products (as reported)
| Vendor | Product | Versions |
|---|---|---|
| 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
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-g7cr-3p24-7wf7 x_refsource_CONFIRM
- https://github.com/python-pillow/Pillow/pull/10124 x_refsource_MISC
- https://github.com/python-pillow/Pillow/commit/02561b8dc6117d5670d4b469fecdd02c70854f9b x_refsource_MISC
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0 x_refsource_MISC