CVE-2026-96642: Pillow: TarIO negative size field causes infinite CPU-spin loop
Pillow is a Python imaging library. Prior to 13.0.0, the TarIO initializer in src/PIL/TarIO.py accepts a negative octal member size and computes a backward seek that returns to the same 512-byte header. When the requested member name does not match, the parser repeatedly reads that header, consumes a full CPU core, and never returns. TarIO is reached only when an application directly uses PIL.TarIO.TarIO rather than the default Image.open() path. This issue is fixed in version 13.0.0.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Pillowto a version that resolves this vulnerability.Fixed in 13.0.0
Event History
Frequently Asked Questions
Which applications are exposed to this denial-of-service issue?
Only applications that directly instantiate PIL.TarIO.TarIO are affected. The default Image.open() path does not reach the vulnerable TarIO code.
What must an attacker provide to trigger the CPU-spin loop?
The attacker needs a TAR input with a negative octal member-size field and must cause TarIO to look for a member name that does not match the repeated header. Under those conditions, the parser repeatedly rereads the same 512-byte header and does not return.
Which Pillow versions need remediation?
Pillow versions before 13.0.0 are affected. Upgrade to version 13.0.0 to obtain the fix.