{"id":"CVE-2026-96778","published":"2026-10-21T20:58:24Z","modified":"2026-10-28T01:53:22Z","title":"Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer","vendor":"python-pillow","product":"Pillow","tier":"tail","description":{"text":"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.","provenance":"source","from":"CVE.org"},"cvss":{"score":7.7,"severity":"HIGH","version":"4.0","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","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00619,"percentile":0.43949,"provenance":"source"},"cwes":[{"id":"CWE-787","name":"Out-of-bounds Write"}],"references":[{"url":"https://github.com/python-pillow/Pillow/security/advisories/GHSA-g7cr-3p24-7wf7","tags":["x_refsource_CONFIRM"]},{"url":"https://github.com/python-pillow/Pillow/pull/10124","tags":["x_refsource_MISC"]},{"url":"https://github.com/python-pillow/Pillow/commit/02561b8dc6117d5670d4b469fecdd02c70854f9b","tags":["x_refsource_MISC"]},{"url":"https://github.com/python-pillow/Pillow/releases/tag/13.0.0","tags":["x_refsource_MISC"]}],"priority":{"score":14.2,"factors":[{"name":"EPSS percentile","points":8.79},{"name":"CVSS severity","points":5.39}]},"vendorSlug":"python-pillow","affectedVersions":[{"vendor":"python-pillow","product":"Pillow","versions":[">= 9.4.0, < 13.0.0"]}],"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"total","timestamp":"2026-10-28T01:52:07.426606Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"PyPI","package":"Pillow","vulnerableRanges":[">=9.4.0, <13.0.0"],"patched":["13.0.0"],"from":["GHSA-g7cr-3p24-7wf7"],"provenance":"source"}],"summary":{"text":"A heap buffer overflow in Pillow's JPEG encoder (src/libImaging/JpegEncode.c, the ImagingJpegEncode() path) affects versions from 9.4.0 up to but not including 13.0.0. An attacker can exploit it by supplying an untrusted image that, when re-saved as JPEG with its ICC profile and comment preserved, fills the encoder buffer exactly so that a COM comment write overruns adjacent heap memory, which can crash the process and may allow code execution; exploitation requires that a user or application re-saves the attacker-supplied image, with no authentication needed.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T21:36:01Z"},"euvd":{"id":"EUVD-2026-107566","exploited":false,"provenance":"source"}}