What’s Vulnerable › Vulnerabilities
CVE-2026-112393: Pillow: Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO
- Severity: critical (CVSS 9.8 v3.1)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.8% probability of exploitation in the next 30 days
- Public exploit or detection template: yes
- Published: 2026-10-19 · updated 2026-10-26
- Weakness: CWE-122
Description
Pillow is a Python imaging library. From 2.0.0 until 13.0.0, Pillow has a heap buffer overflow and stale-heap disclosure in _tiffWriteProc when saving compressed TIFF data through libtiff to a target without a usable fileno(), such as BytesIO. The callback sizes its allocation from the prior buffer size instead of the current write position, allowing an attacker-controlled out-of-line TIFF tag or retained ICC profile to be copied beyond the allocation after libtiff seeks forward. This overflow can crash the process and may allow code execution. Independently, unwritten alignment gaps in compressed TIFF output larger than 64 KiB can disclose stale heap bytes without a crafted tag. File paths and targets with real file descriptors are unaffected. This issue is fixed in version 13.0.0.
Affected products
- python-pillow Pillow: from 2.0.0 before 13.0.0 — fixed in 13.0.0
- Pypi Pillow: from 2.0.0 before 13.0.0; 10.0.0, 10.0.1, 10.1.0, 10.2.0, 10.3.0, 10.4.0 (+85) — fixed in 13.0.0
- python-pillow Pillow: from 2.0.0, < 13.0.0
How to fix
Upgrade to a fixed version: python-pillow Pillow 13.0.0; Pypi Pillow 13.0.0. Check the vendor advisory for mitigations.
References
- https://github.com/python-pillow/Pillow/commit/11582e5ffbdceb973d5ee593f3105af5a9852b40
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-332p-7hrc-92wf
- https://github.com/python-pillow/Pillow/security/advisories/GHSA-332p-7hrc-92wf
Get alerted when CVE-2026-112393 or the next vulnerability affects your stack