Vulnerabilities

Security fix · CVE-2026-96642

Pillow is a Python imaging library.

Published Oct 21, 2026 · catalog updated Oct 28, 2026 · Pillow is a Python

Last checked Oct 31, 2026. A connected source was read within the last 7 days.

Check if you run it

No confirmed exploitation is on record for CVE-2026-96642. EPSS is 0.34%. Act only if a listed version of Pillow is a Python is installed.

Gaps on this record

  • The stored product name is a package slug. The name on this page is taken from the title (Pillow is a Python).
  • No vendor fix or required action is stored. Compare the linked advisory before you change production.
Severity
High7.1
Known exploitation
Not in CISA/VulnCheck KEV
EPSS
0.34%
Remediation
Version ranges on file
Affected products
PyPI pillow · pip Pillow · pypi pillow

### Summary does not check that a tar header's size field is positive. A crafted header with a negative size makes it seek backward onto itself. This causes an infinite loop that uses 100% CPU and never returns. ### Details reads 512-byte tar headers one at a time, looking for a member with a given name. For each header it reads the size field and skips ahead to the next header: There is no check that size is zero or more. A tar header can set this field to a negative octal value. For size = -512, the seek offset comes out to exactly -512, which cancels the 512 bytes the loop had just read. The file position goes right back to where this loop step started. The loop only stops on end of file or when a header name starts with a null byte. Neither happens, since the same header keeps showing up again. The loop never ends on its own. ### Steps to reproduce This uses Tests/images/hopper.tar, a normal file already in the Pillow test suite. It only changes the size field of the first header. We confirmed this with ps. The process sits at 98 to 100% CPU and never exits on its own. It only stops if killed from outside. A pytest version of this, using pytest-timeout so the test does not hang forever, is below. On the current code it fails with Failed: Timeout (>3.0s) from pytest-timeout. ### Impact - Availability: an attacker who can get a crafted tar file passed to TarIO.TarIO() can hang the process at full CPU with a file just over 512 bytes. - Confidentiality: none. - Integrity: none. - TarIO is a small helper class. It is not used by Image.open() and is not on the default path most Pillow users hit. An app has to call PIL.TarIO.TarIO(path, member_name) directly for this to matter, which some apps do to read an image out of a tar archive.

Are you affected?

Enter the version you run. The result uses only the ranges stored on this record.

The check returns affected, not affected, or incomplete. It does not guess a version that is missing from the record.

  • PyPI pillow0 → 13.0.0
  • pip Pillow< 13.0.0
  • pypi pillowversion unspecified

How to fix CVE-2026-96642

What to do

Three questions, each answered from this record only. Confirm the vendor advisory before you patch.

Should you patch?

No confirmed exploitation is on record for CVE-2026-96642. EPSS is 0.34%. Act only if a listed version of Pillow is a Python is installed.

Which versions are affected?

Compare what you have installed with Pillow < 13.0.0. Compare the installed version with the linked vendor advisory before you change production.

What should an analyst verify?

CWE-835: Infinite Loop. EPSS 0.34%. There is no CISA KEV listing. No Exploit-DB or Metasploit reference is linked. Use the source links for the original advisory.

Technology hubs

Code

The project this record applies to. Exploit listings stay in References.

Timeline

Detection, updates, and resolution for this record.

  1. Oct 21, 2026 · NIST NVD

    Detected

    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.TarI

  2. Oct 22, 2026 · GitHub Advisory Database

    Updated

    ### Summary does not check that a tar header's size field is positive. A crafted header with a negative size makes it seek backward onto itself. This causes an infinite loop that uses 100% CPU and never returns. ### Details reads 512-byte tar headers one at a time, looking for a member with a given name. For each header it reads the size field and skips ahead to the next header: There is no check

  3. Oct 28, 2026 · PyPA Advisory Database

    Fix available

    pillow fixed in 13.0.0

  4. Oct 28, 2026 · PyPA Advisory Database

    Fix available

    pillow fixed in 13.0.0

  5. Oct 28, 2026 · PyPA Advisory Database

    Updated

    ### Summary does not check that a tar header's size field is positive. A crafted header with a negative size makes it seek backward onto itself. This causes an infinite loop that uses 100% CPU and never returns. ### Details reads 512-byte tar headers one at a time, looking for a member with a given name. For each header it reads the size field and skips ahead to the next header: There is no check

Sources

  • CVE.orgVulnerability recordCVE-2026-96642

    Official CVE identifier

    cve.org
  • FIRST EPSSExploitation probabilityCVE-2026-96642

    30-day exploitation probability 0.34%

    first.org
  • GitHub Advisory DatabasePackage advisoryGHSA-3j72-p6qg-6xp7

    Pillow: TarIO negative size field causes infinite CPU-spin loop

    github.com
  • GitLab Advisory DatabasePackage advisoryCVE-2026-96642

    TarIO. init does not check that a tar header's size field is positive. A crafted header with a negative size makes it seek backward onto itself. This causes an infinite loop that uses 100% CPU and never returns.

    advisories.gitlab.com
  • NIST NVDVulnerability recordCVE-2026-96642

    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 th

    nvd.nist.gov
  • PyPA Advisory DatabasePackage advisoryGHSA-3j72-p6qg-6xp7

    Pillow: TarIO negative size field causes infinite CPU-spin loop

    osv.dev
  • PyPA Advisory DatabasePackage advisoryPYSEC-2026-4341

    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 th

    osv.dev

References

Freshness

Last verified in this catalog Oct 31, 2026. Significant claims (KEV, EPSS, CVSS, affected ranges) come from the source rows above — open the original publisher for the authoritative advisory.

  • PyPA Advisory DatabaseOct 28, 2026
  • PyPA Advisory DatabaseOct 28, 2026
  • FIRST EPSSOct 28, 2026
  • GitLab Advisory DatabaseOct 23, 2026
  • GitHub Advisory DatabaseOct 23, 2026
  • CVE.orgOct 22, 2026
  • NIST NVDOct 22, 2026