# CVE-2026-96778: Pillow: Heap buffer overflow writing JPEG comment after ICC profile fills buffer

- Severity: High 7.7 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.49%, higher than 43% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-10-21T20:58:24.238Z
- Modified: 2026-10-29T10:56:05.933Z
- Also known as: GHSA-g7cr-3p24-7wf7, BIT-PILLOW-2026-96778
- Weaknesses: CWE-787
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact total
- Assigned by: GitHub_M

## 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.

(As written by CVE List.)

## Affected

- python-pillow Pillow: >= 9.4.0, < 13.0.0
- pillow (PyPI): from 9.4.0 before 13.0.0
- python pillow: from 9.4.0 before 13.0.0
- pillow (Bitnami): from 9.4.0 before 13.0.0

## Every score

- GitHub_M: CVSS:4.0 7.7 High `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`
- GitHub: CVSS:4.0 High `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`
- NVD: CVSS:3.1 8.8 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/python-pillow/Pillow/security/advisories/GHSA-g7cr-3p24-7wf7> (exploit, advisory, vendor-advisory, web)
- <https://github.com/python-pillow/Pillow/pull/10124> (issue-tracking, report, web)
- <https://github.com/python-pillow/Pillow/commit/02561b8dc6117d5670d4b469fecdd02c70854f9b> (fix, patch, web)
- <https://github.com/python-pillow/Pillow/releases/tag/13.0.0> (article, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-96778> (advisory, web)
- <https://github.com/python-pillow/Pillow> (package)

## Sources

- CVE List: [CVE-2026-96778](https://www.cve.org/CVERecord?id=CVE-2026-96778), CVE Terms of Use, modified 2026-10-28
- GitHub Advisory Database: [GHSA-g7cr-3p24-7wf7](https://github.com/advisories/GHSA-g7cr-3p24-7wf7), CC-BY-4.0, modified 2026-10-29
- NVD: [CVE-2026-96778](https://nvd.nist.gov/vuln/detail/CVE-2026-96778), Public domain, modified 2026-10-28
- Bitnami Vulnerability Database: [BIT-PILLOW-2026-96778](https://osv.dev/vulnerability/BIT-PILLOW-2026-96778), Apache-2.0, modified 2026-10-29

---

Page: https://cve.day/CVE-2026-96778 · Whole record: https://cve.day/CVE-2026-96778.json · Rebuilt by cve.day 2026-11-25T22:59:46.698Z
