Python-pillow Pillow
Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer
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 versions and mitigation
From the CVE record and the vendor's references.Affected
- >= 9.4.0, < 13.0.0
Fixed in 13.0.0
Mitigation
Upgrade Pillow to 13.0.0 or later.
References
- Vendor advisory github.com/python-pillow/Pillow/security/advis…
- Patch github.com/python-pillow/Pillow/pull/10124
- Patch github.com/python-pillow/Pillow/commit/02561b8…
1 more
- Release notes github.com/python-pillow/Pillow/releases/tag/1…
Timeline
Days relative to CVE publicationFirst public PoC 6.2 days after publication; not in CISA KEV. First PoC: paktiko1986/CVE-2026-96778-pillow (created 28 Oct 2026, found by us: 14 Nov 2026).
PoC repositories
Found on GitHub.1 PoCs
PoCs 1
| Repository | Created | Found by us | Stars | Assessment |
|---|---|---|---|---|
| paktiko1986/CVE-2026-96778-pillow | 28 Oct 2026 +6.2 d | 14 Nov 2026 | 0 | PoC
Flags · score 15
Below the suspicion threshold (50); does not change the assessment. |
Only PoCs count toward the first-PoC date and the characteristics below. Do not run PoC code from unknown sources.