Vulnerability DatabaseCVE-2026-112902

CVE-2026-112902: 
Python vulnerability analysis and mitigation

Overview

CVE-2026-112902 is a memory disclosure and denial-of-service vulnerability in Pillow's libtiff TIFF encoder, titled "Memory disclosure and segfault in libtiff encoder via crafted TIFF tags." It affects Pillow versions 5.4.0 through 12.3.0 (inclusive) and was published on October 17, 2026, with a fix released in version 13.0.0. The root cause is that PyImaging_LibTiffEncoderNew in src/encode.c passes mismatched arguments to the variadic TIFFSetField() function when processing attacker-controlled TIFF tag metadata. It carries a CVSS v3.1 base score of 9.1 (Critical) and a CVSS v4.0 base score of 8.3 (High) (Github Advisory, Pillow Security Advisory).

Technical details

The vulnerability is classified as CWE-686 (Function Call With Incorrect Argument Type). PyImaging_LibTiffEncoderNew determines the argument shape passed to the variadic TIFFSetField() based solely on the Python value type (scalar, tuple, or bytes), incorrectly assuming that its own ImagingLibTiffMergeFieldInfo() registration overrides libtiff's built-in field definitions. In reality, TIFFMergeFieldInfo() never overrides libtiff's built-in table for known tags, so libtiff reads varargs according to its own field definition regardless of what Pillow pushed. For counted-array tags like DNGPrivateData (50740), an attacker-supplied integer is consumed by libtiff as a byte count, and the data pointer is read from an unwritten vararg slot — causing libtiff to memcpy an attacker-chosen number of bytes from process memory into the output TIFF. For fixed-size array tags like ActiveArea (50829), the integer is used directly as a source address, causing a SIGSEGV. The vulnerability is reachable via a plain Image.open() followed by im.save(fp, "TIFF") whenever the source image is compressed, and also through JPEG/PNG/WebP images with EXIF metadata converted to compressed TIFF output (Pillow Security Advisory, Fix PR #10227).

Impact

Successful exploitation allows an unauthenticated attacker to cause two distinct impacts: (1) memory disclosure — an attacker-chosen number of bytes from the worker process's memory (including pointers into _imaging.so, libpython, libc, libtiff, and libjpeg) are embedded in the re-saved TIFF output and returned to the attacker, enabling a complete ASLR bypass that can be chained with other memory-corruption bugs; and (2) denial of service — certain crafted tag values (e.g., ActiveArea with value 64) cause a deterministic SIGSEGV crash of the worker process on every request. In testing, requests for up to 2,000,000 bytes of process memory succeeded, returning over 2,800 resolved pointers. The vulnerability affects any service that accepts image uploads and re-saves them as TIFF, including pipelines that process JPEG/PNG/WebP with EXIF metadata into compressed TIFF output (Pillow Security Advisory).

Exploitability

The advisory includes concrete reproduction steps — a crafted sub-1 KB TIFF with specific IFD tag entries (e.g., tag 50740/LONG/count 1/value 4096) followed by Image.open() and im.save(buf, "TIFF") — which reliably trigger memory disclosure and SIGSEGV. Feedly's analysis classifies this as a high-confidence PoC with exploitation steps described in the advisory, though no standalone runnable exploit code has been publicly released. There is no evidence of in-the-wild exploitation as of the advisory date. The EPSS score is approximately 0.495%, and the vulnerability is not listed in the CISA KEV catalog. No threat actor attribution has been reported. The vulnerability requires no authentication and no user interaction, but does require the target application to re-save images as TIFF (Github Advisory, Feedly).

Exploitation steps

  1. Craft a malicious TIFF file: Create a small (≤356 bytes) LZW-compressed TIFF containing a standard image (e.g., 16×16 RGB) with one extra IFD entry using a tag number known to libtiff's built-in table as a counted-array field. For memory disclosure, use tag 50740 (DNGPrivateData) / LONG / count 1 / value 65536. For a crash, use tag 50829 (ActiveArea) / LONG / count 1 / value 64.
  2. Upload the crafted TIFF to the target application: Submit the file to any service that accepts image uploads and re-saves them as TIFF (e.g., an image processing API, thumbnail generator, or metadata-preserving converter).
  3. Trigger the vulnerable code path: The application calls Image.open(uploaded_file) followed by im.save(output, "TIFF"). Because the source is LZW-compressed, Pillow automatically routes the save through the libtiff writer without any explicit option from the application.
  4. Exploit the vararg mismatch: Pillow's encoder passes the attacker-supplied integer (e.g., 65536) as a single scalar vararg to TIFFSetField(). libtiff, using its built-in definition for DNGPrivateData (passcount=1), reads this as the byte count and reads the data pointer from an unwritten vararg slot (a stale CPU register pointing into _imaging.so's .rodata). libtiff then memcpys 65536 bytes of process memory into the output TIFF tag.
  5. Retrieve disclosed memory: Download the re-saved TIFF output from the application. Parse the output file and read the value of tag 50740 — it contains up to 2,000,000+ bytes of process memory, including resolved pointers into libpython, libc, libtiff, and libjpeg, enabling a full ASLR bypass for chaining with additional exploits (Pillow Security Advisory).

Indicators of compromise

  • Network: Unusual upload of very small TIFF files (≤400 bytes) to image processing endpoints, followed by download of disproportionately large TIFF output files (e.g., a 356-byte input producing a 65,536+ byte output).
  • File System: Output TIFF files containing metadata tags (e.g., tag 50740 DNGPrivateData, tag 34377 Photoshop) with unexpectedly large binary payloads not present in the original input file.
  • Logs: Application logs showing repeated image upload-and-download cycles with small TIFF inputs; Python RuntimeError messages such as "Failed to allocate memory for custom tag binary object (-N elements of 4 bytes each)" in application logs.
  • Process: Worker processes (e.g., Python/Gunicorn/uWSGI workers) terminating with SIGSEGV (signal 11 / exit code -11) after processing TIFF image uploads; unexpected process restarts in image-processing services.
  • Memory/Output Analysis: Re-saved TIFF output files whose tag values contain byte sequences matching the .rodata or .data sections of _imaging.so or other shared libraries loaded by the Python process (Pillow Security Advisory).

Mitigation and workarounds

The primary remediation is to upgrade Pillow to version 13.0.0 or later, which validates TIFF tag values against libtiff's own field definition before calling TIFFSetField(), raising ValueError for mismatched values instead of forwarding them (Pillow 13.0.0 Release, Fix Commit). If immediate patching is not possible, implement input validation and sanitization for image metadata before processing through the TIFF encoder, and restrict re-saving of compressed TIFF images or EXIF-preserving conversions to trusted sources only. IBM Netezza Software users should consult the IBM advisory for platform-specific guidance (IBM Advisory). Linux distribution users (SUSE, openSUSE, Red Hat, Amazon Linux) should apply the updated python-Pillow packages provided by their respective vendors.

Community reactions

The vulnerability was reported by researcher "carlini" and credited in the fix commit, with the fix co-authored with assistance from Copilot and Claude Opus 5.5 (Fix PR #10227). GitLab published a blog post highlighting the CVE and demonstrating how to find and fix it using GitLab tooling. Multiple Linux distributions (SUSE, openSUSE, Red Hat, Amazon Linux) issued security advisories and updated packages. The vulnerability received coverage on security aggregators including VulDB, OSV.dev, AusCERT, and Radar/Offseq, and was discussed in the oss-security mailing list. Community reaction focused on the severity of the ASLR-bypass potential and the breadth of affected code paths across multiple TIFF tag types.

Additional resources

Linux Distribution fix status

Fix availability across major Linux distributions and their releases.

Debian

Fixed

bookworm

pillow

Affected

sid

pillow: 13.0.0-1

Fixed

trixie

pillow

Affected

Ubuntu

Unknown

bionic (esm-infra)

pillow

Unknown

devel

pillow

Unknown

focal (esm-apps)

pillow-python2

Unknown

focal (esm-infra)

pillow

Unknown

jammy

pillow

Unknown

noble

pillow

Unknown

resolute

pillow

Unknown

trusty (esm-infra-legacy)

pillow

Unknown

RHEL / CentOS

Affected

RHEL 8

Not Affected

Source: This report was generated using AI

Related Python vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-hhqh-8jpj-27rfCRITICAL9.8
  • Python logoPython
  • lmcache
NoYesNov 23, 2026
CVE-2026-130164HIGH7.8
  • Python logoPython
  • hermes-agent
NoYesNov 23, 2026
GHSA-v8x2-8vhg-5vc3MEDIUM5.8
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-gfqr-fp2c-h495MEDIUM5.4
  • Python logoPython
  • nautobot
NoYesNov 23, 2026
GHSA-jg4p-wprm-8hphMEDIUM5.3
  • Python logoPython
  • lmcache
NoYesNov 23, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management