Impact
Pillow, the Python imaging library, contains a heap buffer overflow in the internal _tiffWriteProc routine that is executed when saving compressed TIFF images through libtiff to targets that do not expose a file descriptor, such as BytesIO streams. The overflow occurs when the callback allocates memory based on a prior buffer size rather than the current write position, allowing attacker‑controlled TIFF tags or retained ICC profiles to be written beyond the bounds of the allocated buffer. This can crash the process and, as the description indicates, may enable arbitrary code execution, corresponding to a CWE‑122 vulnerability.
Affected Systems
The flaw affects Pillow versions 2.0.0 through 13.0.0 inclusive when used in environments that write compressed TIFF data into a BytesIO object. Products built on the python‑pillow Pillow package are impacted; any application that constructs or manipulates TIFF images via Pillow in this manner is potentially vulnerable. The issue is mitigated in Pillow 13.0.0, after which the buffer allocation logic aligns with the current write position.
Risk and Exploitability
With a CVSS score of 9.2 the vulnerability is considered critical. Although no EPSS score is available and it is not listed in the CISA Known Exploited Vulnerabilities catalog, the high score suggests that a determined adversary could exploit it, especially in contexts where Pillow processes untrusted input. The likely attack vector is an application that accepts user‑supplied TIFF files and writes them to an in‑memory BytesIO stream; an attacker could craft tags or ICC profiles to trigger the overflow and then deliver malicious code. Because the vulnerability affects only in‑memory destinations, traditional file‑based protections do not help.
OpenCVE Enrichment