Skip to content
LatestIBM Langflow OSS CVE-2026-107366: Authenticated Users Can Hijack Sessions
Vulnerabilities

Pillow heap leak in TIFF decoding exposes stale memory contents

A high-severity flaw in Python Pillow allows attackers to read uninitialized heap memory via crafted TIFF files, fixed in version 13.0.0.

Illustration: A cracked ceramic pillow sits on a wooden desk beside a scattered heap of loose, tangled memory foam strips.
AI-generated illustration: Packet Tribune

Key points

  • CVE-2026-112897 affects Pillow versions 5.3.0 through 12.x.
  • The flaw leaks uninitialized memory when processing JPEG or fax TIFFs.
  • Version 13.0.0 resolves the issue by clearing buffer tails.

Python Pillow, a widely used imaging library, contains a high-severity vulnerability that leaks uninitialized heap memory. The flaw, tracked as CVE-2026-112897, impacts versions from 5.3.0 up to but not including 13.0.0.

What happened

The vulnerability stems from how Pillow handles TIFF data decoded by libtiff. When processing JPEG-compressed or Group 4 fax TIFF images, libtiff may perform a short decode, writing fewer bytes than the buffer size. Pillow’s _decodeStrip and _decodeTile functions do not clear the remaining buffer space before converting rows to pixels. This leaves stale heap contents in the output.

The tile decoding path has been vulnerable since version 5.3.0, while the strip path became affected in version 6.0.0. An attacker can supply a crafted TIFF file to any application that loads, returns, or re-encodes pixel data using these library versions. The result is the disclosure of sensitive memory contents without causing a crash or memory corruption.

Why it matters

This issue is rated high severity with a CVSS score of 8.7. It falls under CWE-908, which covers exposure of sensitive information to an unauthorized actor. The flaw allows data leakage without crashing the process, disclosing stale heap contents. Applications relying on older Pillow versions for image processing are directly exposed to this information disclosure risk.

Next steps

  • Verify if your environment uses Pillow versions between 5.3.0 and 12.x.
  • Upgrade to version 13.0.0 or later to apply the official fix.
  • Audit applications that accept external TIFF files for potential exposure.
  • Monitor for suspicious memory access patterns in image processing services.

Detection notes

Teams usually observe anomalies in memory usage or unexpected data in image outputs. Check application logs for unusual TIFF processing errors or large data transfers. Look for alerts on sensitive data leaving the application boundary. Contain the issue by isolating affected services and restricting input to trusted sources. Validate that all image processing components are updated. Review access controls to limit exposure of internal memory states.

What to do and how to stay safe: Pillow

  • Inventory all systems using Python Pillow to identify vulnerable versions.
  • Restrict input of TIFF files to trusted sources until patched.
  • Monitor for unusual outbound data transfers from image processing services.
  • Once the vendor provides an update, apply it immediately to all affected systems.

Step-by-step guide: Emergency Patching: How to Fix Critical Flaws Without Breaking Production

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

Frequently asked questions

Which versions of Pillow are affected by CVE-2026-112897?

Versions from 5.3.0 up to but not including 13.0.0 are affected.

What type of data is leaked by this vulnerability?

Uninitialized heap memory contents are leaked as pixel data.

Is there a fix available for this issue?

Yes, the issue is fixed in version 13.0.0.

Sources

  1. CVE Program
PillowCVE-2026-112897PythonlibtiffCWE-908

Related stories

PraisonAI Agents sandbox escape lets LLM code harvest env vars in v1.6.77

A critical vulnerability in PraisonAI Agents allows LLM-generated code to access all environment variables, bypassing intended sandbox protections.