Skip to content
Thursday, October 22, 2026AboutContactRSS
Vulnerabilities

Patch Pillow to 13.0.0 to eliminate critical TIFF heap overflow enabling remote code execution

A critical heap buffer overflow in Pillow versions before 13.0.0 allows remote code execution when saving compressed TIFF files to memory buffers.

Illustration: A sleek white pillow floats above a dark surface, its fabric unraveling into chaotic digital threads that spill out from a tiny, overflowing heap.
AI-generated illustration: Shell Bulletin

Key points

  • Pillow versions 2.0.0 through 12.x contain a critical CVSS 9.2 flaw in TIFF handling.
  • The vulnerability enables remote code execution or process crashes via heap overflow.
  • Version 13.0.0 fixes the heap overflow and associated stale-heap disclosure issues.

An attacker who controls image data processed by vulnerable Python applications can achieve remote code execution on the hosting system. This capability arises from a critical heap buffer overflow in the Pillow imaging library, which affects versions from 2.0.0 up to 13.0.0. The flaw specifically manifests when the library saves compressed TIFF data through libtiff to memory targets that lack usable file descriptors, such as BytesIO objects.

The National Vulnerability Database rates CVE-2026-112393 as critical with a CVSS score of 9.2. The vulnerability stems from incorrect allocation sizing within the _tiffWriteProc callback function. Instead of using the current write position, the callback bases its memory allocation on the prior buffer size. This discrepancy allows attacker-controlled data, such as out-of-line TIFF tags or retained ICC profiles, to be copied beyond the allocated memory boundary after libtiff seeks forward.

Scope of the Vulnerability

The primary risk involves applications that process compressed TIFF files and write them to in-memory buffers. The overflow can crash the application process or allow an attacker to execute arbitrary code. Additionally, the source material notes an independent issue where unwritten alignment gaps in compressed TIFF output larger than 64 KiB can disclose stale heap bytes. This disclosure occurs without requiring a crafted tag, further exposing sensitive memory contents to potential analysis.

Affected Systems and Fixes

Only Pillow versions starting from 2.0.0 and ending before 13.0.0 are affected by this vulnerability. File paths and targets utilizing real file descriptors remain unaffected by this specific heap overflow mechanism. The vendor has addressed the issue in version 13.0.0, which includes fixes for both the heap buffer overflow and the stale-heap disclosure. Users of older versions should update immediately to mitigate the risk of remote code execution.

What to watch

Monitor vendor announcements for any additional patches or security advisories related to image processing libraries. Review application logs for unexpected crashes or anomalous behavior when handling TIFF files. Check for any new CVEs assigned to Pillow or its dependencies in the coming weeks. Ensure that your dependency management tools are configured to alert you on critical security updates.

What made it possible

Heap buffer overflows occur when software writes data beyond the boundaries of a memory buffer. This weakness often arises from miscalculating allocation sizes during data processing. In intrusion scenarios, such flaws serve as an entry point for attackers seeking to execute arbitrary code. Teams usually mitigate these risks by validating input sizes and ensuring memory allocations match expected data volumes. Checking for outdated libraries helps prevent exploitation of known memory management errors.

Background: Security advisories

Security advisories provide the technical context needed to prioritize patches. They explain the severity, affected components, and mitigation steps. Without them, teams guess which fixes matter, leaving critical gaps open to exploitation while wasting time on low-risk updates.

Read the full guide: How Security Advisories Drive Patch Decisions and Reduce Risk

What to do and how to stay safe: Pillow

  • Update Pillow to version 13.0.0 or later to apply the confirmed fix for CVE-2026-112393.
  • Audit applications to identify any usage of BytesIO or similar memory buffers for TIFF output.
  • Restrict input sources to trusted origins to reduce the likelihood of processing malicious TIFF files.
  • Monitor system logs for crashes or unusual memory usage when handling image data.

Step-by-step guide: Detect Buffer Overflow Vulnerabilities: Early Signs and Hidden Indicators

General security guidance from the Shell Bulletin newsroom. It is not confirmed advice from the organisations named in this story.

Frequently asked questions

What is the CVSS score for CVE-2026-112393?

The National Vulnerability Database rates CVE-2026-112393 as critical with a CVSS score of 9.2.

Which Pillow versions are affected by this vulnerability?

Pillow versions from 2.0.0 up to, but not including, 13.0.0 are affected by this heap buffer overflow.

Is there a fix available for this vulnerability?

Yes, the issue is fixed in Pillow version 13.0.0, which addresses both the overflow and disclosure flaws.

Sources

  1. CVE Program
PillowCVE-2026-112393PythonHeap OverflowTIFF

Related stories

Update joserfc Libraries to Block Signature Forgery Attacks

A critical flaw in older joserfc versions allows attackers to forge digital signatures without keys, risking data integrity for users of the Python library.