CVE-2026-96778 — python-pillow Pillow
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.
Severity breakdown
High · 7.7
An attacker without an account can exploit this over the network if a user views or visits something, but only under specific conditions.
- Attack from
- the network (remotely)
- Attack complexity
- low (no special conditions)
- Special conditions
- only in some setups or conditions
- Login needed
- no
- User action needed
- yes, a user must view or visit something
- Impact
- high on confidentiality, integrity and availability
- Impact on other systems
- none
Weakness
- CWE-787: Out-of-bounds Write
Affected and fixed versions
| Product | Affected versions | Fixed in |
|---|---|---|
| python-pillow Pillow | >= 9.4.0, < 13.0.0 | — |
References by type
Vendor advisories
Patches and fixed releases
Affected
- python-pillow Pillow
What to do
- Check whether you run an affected product or version and apply the vendor's update or mitigation.
- Follow the vendor advisory and the references below for fixed versions and workarounds.
Frequently asked questions
What is CVE-2026-96778?
Pillow is a Python imaging library. From 9.4.0 until 13.0.0, ImagingJpegEncode() in src/libImaging/JpegEncode.c can call jpegwritemarker() for a JPEG COM comment when an ICC profile has exactly filled the 65536-byte encoder buffer. Weakness type: Out-of-bounds Write (CWE-787).
How severe is CVE-2026-96778?
CVE-2026-96778 has a CVSS 4.0 base score of 7.7 (high), from the CNA (github.com). An attacker without an account can exploit this over the network if a user views or visits something, but only under specific conditions.
Is CVE-2026-96778 being exploited?
Not as far as is known: CVE-2026-96778 is not in CISA's Known Exploited Vulnerabilities catalog as of November 26, 2026. EPSS estimates a 0.6% chance that it is exploited in the next 30 days.
Which versions are affected by CVE-2026-96778?
python-pillow Pillow >= 9.4.0, < 13.0.0.
How do I fix CVE-2026-96778?
Apply the update or mitigation in the vendor's advisory, linked on this page under Vendor advisories.