A heap buffer overflow vulnerability exists in Pillow versions 2.3.0 through 12.3.0 when saving compressed TIFF images using libtiff. Attacker-controlled image geometry tags can cause libtiff to consume a larger scanline than the allocated buffer, potentially leading to heap memory disclosure, process crashes, or memory corruption. This flaw is fixed in Pillow version 13.0.0.