# CVE-2026-112396: Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer

- Severity: Medium 5.9 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- 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.69%, higher than 54% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-10-19T21:02:15.197Z
- Modified: 2026-10-27T11:10:49.694Z
- Also known as: GHSA-4rr5-89j8-mwwm, BIT-PILLOW-2026-112396, PYSEC-2026-4328
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.

(As written by CVE List.)

## Affected

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

## Every score

- GitHub_M: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- GitHub: CVSS:3.1 5.9 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H`
- NVD: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- PyPA Advisory Database: CVSS:3.1 7.5 High `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H`
- Bitnami Vulnerability Database: rating High

## References

- <https://github.com/python-pillow/Pillow/security/advisories/GHSA-4rr5-89j8-mwwm> (exploit, advisory, evidence, vendor-advisory, web)
- <https://github.com/python-pillow/Pillow/commit/dc95da20207827a062cfbf551ee9f6031465a8bb> (fix, patch, web)
- <https://github.com/python-pillow/Pillow/releases/tag/13.0.0> (advisory, article, release-notes, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-112396> (advisory, web)
- <https://github.com/python-pillow/Pillow> (package)

## Sources

- CVE List: [CVE-2026-112396](https://www.cve.org/CVERecord?id=CVE-2026-112396), CVE Terms of Use, modified 2026-10-20
- GitHub Advisory Database: [GHSA-4rr5-89j8-mwwm](https://github.com/advisories/GHSA-4rr5-89j8-mwwm), CC-BY-4.0, modified 2026-10-27
- NVD: [CVE-2026-112396](https://nvd.nist.gov/vuln/detail/CVE-2026-112396), Public domain, modified 2026-10-26
- PyPA Advisory Database: [PYSEC-2026-4328](https://osv.dev/vulnerability/PYSEC-2026-4328), CC-BY-4.0, modified 2026-10-27
- Bitnami Vulnerability Database: [BIT-PILLOW-2026-112396](https://osv.dev/vulnerability/BIT-PILLOW-2026-112396), Apache-2.0, modified 2026-10-27

---

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