Infinite loop in Pillow - CVE-2026-96642
Published: November 3, 2026
Vulnerability details
The vulnerability allows a remote attacker to cause a denial of service by hanging the affected process in an infinite loop that consumes full CPU.
The vulnerability exists due to missing validation of negative tar header sizes in Pillow's TarIO.__init__ when scanning an archive for a requested member. A remote attacker can supply a crafted tar archive with the size field set to b" -00001000" (negative 512) and a header name that does not match the requested member to cause repeated backward seeks to the same header, resulting in an infinite CPU-consuming loop.
Exploitation requires an application to call PIL.TarIO.TarIO(path, member_name) directly; Image.open() does not use this helper.