Security fix · CVE-2026-96778
Pillow is a Python imaging library.
Published Oct 21, 2026 · catalog updated Oct 28, 2026 · Pillow is a Python
Last checked Oct 31, 2026. A connected source was read within the last 7 days.
Check if you run it
No confirmed exploitation is on record for CVE-2026-96778. EPSS is 0.45%. Act only if a listed version of Pillow is a Python is installed.
Gaps on this record
- The stored product name is a package slug. The name on this page is taken from the title (Pillow is a Python).
- No vendor fix or required action is stored. Compare the linked advisory before you change production.
Same product and reporting
- CVE-2026-96641 · Medium
- CVE-2026-96640 · High
- CVE-2026-42311 · High
- CVE-2026-42310 · Medium
- CVE-2026-42309 · Medium
- Severity
- High8.1
- Known exploitation
- Not in CISA/VulnCheck KEV
- EPSS
- 0.45%
- Remediation
- Version ranges on file
- Affected products
- Debian:12 pillow · Debian:13 pillow · Debian:14 pillow · cpe python/pillow · pip Pillow · pypi pillow
A heap buffer overflow in Pillow's JPEG encoder lets anyone who can supply an image write up to 64 KB of bytes they choose, followed by the rest of the compressed image, past the end of a 64 KB heap buffer. The target is any application that re-saves the image as JPEG while keeping its colour profile. The reliable result is that the Python process is killed outright rather than raising an exception. Because the overwritten memory sits directly in front of function pointers that the encoder calls next, this could allow code execution, though the attached reproducer demonstrates only the crash. The bug is in in . State 4 (line 330) calls for the COM comment marker without checking that the output buffer has room. Meanwhile, sizes that buffer from the EXIF and ICC/XMP data only and reserves nothing for the comment. When a 65498-byte ICC profile fills the 65536-byte buffer exactly, libjpeg's stores one byte past the end and then decrements from 0. The counter wraps, so the marker, the comment and the entire compressed image are written out of bounds. Triggering it takes only a valid JPEG (or PNG) carrying that profile and any comment, passed through and then . That is the documented way to preserve colour. The comment is forwarded from automatically, and no non-default setting is involved. The attached reproducer re-saves such a file on the stock build, and the process dies with SIGSEGV. An identical file without the comment saves normally. An ASan build of Pillow will not flag this, because the stray writes happen inside the system libjpeg-turbo. Valgrind does report it, as an invalid write immediately after the 65569-byte allocation. The unguarded call was introduced in e50ae85ea406 ("Use jpeg_write_marker to write comment", 2022-12-05) and first shipped in 9.4.0. ## Details ( ) is a resumable state machine that fills a caller-supplied output buffer of bytes and returns when it is full. State 4 writes the JPEG COM marker with without first checking that the buffer has
Are you affected?
Enter the version you run. The result uses only the ranges stored on this record.
The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.
- Debian:12 pillow10.0.0-1, 10.1.0-1, 10.2.0-1
- Debian:13 pillow11.1.0-5, 11.1.0-5+deb13u1, 11.1.0-5+deb13u2
- Debian:14 pillow11.1.0-5, 11.2.1-1, 11.3.0-1
- cpe python/pillow< 13.0.0
- pip Pillow>= 9.4.0, < 13.0.0
- pypi pillowversion unspecified
How to fix CVE-2026-96778
Upgrade
CVE-2026-96778 lists a fix boundary at 13.0.0. Compare the installed build with that boundary before you change production.
Version check
Affected < 13.0.0
Advisory
Open the cve_org record and follow its fix.
Official advisories
What to do
Three questions, each answered from this record only. Confirm the vendor advisory before you patch.
Should you patch?
No confirmed exploitation is on record for CVE-2026-96778. EPSS is 0.45%. Act only if a listed version of Pillow is a Python is installed.
Which versions are affected?
Compare what you have installed with Pillow >= 9.4.0, < 13.0.0. Compare the installed version with the linked vendor advisory before you change production.
What should an analyst verify?
CWE-787: Out-of-bounds Write. EPSS 0.45%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.
Technology hubs
Code
The project this record applies to. Exploit listings stay in References.
Timeline
Detection, updates, and resolution for this record.
Oct 21, 2026 · NIST NVD
Detected
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 i
Oct 22, 2026 · GitHub Advisory Database
Updated
A heap buffer overflow in Pillow's JPEG encoder lets anyone who can supply an image write up to 64 KB of bytes they choose, followed by the rest of the compressed image, past the end of a 64 KB heap buffer. The target is any application that re-saves the image as JPEG while keeping its colour profile. The reliable result is that the Python process is killed outright rather than raising an exceptio
Oct 28, 2026 · NIST NVD
Updated
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 i
Sources
- CVE.orgVulnerability recordCVE-2026-96778
Official CVE identifier
cve.org - FIRST EPSSExploitation probabilityCVE-2026-96778
30-day exploitation probability 0.45%
first.org - GitHub Advisory DatabasePackage advisoryGHSA-g7cr-3p24-7wf7
Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer
github.com - GitLab Advisory DatabasePackage advisoryCVE-2026-96778
============================================================================ Heap buffer overflow writing JPEG comment after ICC profile fills buffer Location: src/libImaging/JpegEncode.c:330 in ImagingJpegEncode() Commit: a707c6b21c313880d0771e54965d142dd42358b6 ============================================================================ A heap buffer overflow in Pillow's JPEG encoder lets anyone
advisories.gitlab.com - NIST NVDVulnerability recordCVE-2026-96778
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 ex
nvd.nist.gov - OpenCVEVendor advisoryCVE-2026-96778
CVE-2026-96778 is named on the public OpenCVE page.
opencve.io - OpenSSF OSV / OSV ScannerPackage advisoryDEBIAN-CVE-2026-96778osv.dev
- Red Hat Security DataVendor advisoryCVE-2026-96778
pillow: pillow: Arbitrary code execution via JPEG encoder buffer overflow
access.redhat.com
References
Freshness
Last verified in this catalog Oct 31, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.
- FIRST EPSSOct 28, 2026
- OpenSSF OSV / OSV ScannerOct 28, 2026
- NIST NVDOct 28, 2026
- OpenCVEOct 28, 2026
- GitLab Advisory DatabaseOct 23, 2026
- GitHub Advisory DatabaseOct 23, 2026
- Red Hat Security DataOct 23, 2026
- CVE.orgOct 22, 2026