Description
Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.
Published: 2026-10-19
Score: 5.9 Medium
EPSS: n/a
KEV: No
Impact: Crash; potential code execution
Action: Immediate Patch
AI Analysis

Impact

A heap use‑after‑free occurs in Pillow between the 11.3.0 and 13.0.0 releases when libtiff rejects a tag during encoding TIFF data to an in‑memory buffer. The error path frees the output buffer, then cleanup writes through the callback into freed memory, which can crash the process and may lead to code execution. The weakness is classified as CWE‑416.

Affected Systems

The vulnerability affects the Pillow imaging library released by python‑pillow. Any installation of Pillow from version 11.3.0 up to and including 13.0.0 that uses the in‑memory buffer encoding path is susceptible. These versions are in active use in many Python applications that process TIFF images.

Risk and Exploitability

The CVSS score of 5.9 indicates moderate severity. No EPSS data is available, and the vulnerability is not listed in the CISA KEV catalog. Based on the description, it is inferred that an attacker must supply a TIFF document that contains malicious or malformed tags to the library while it writes to a BytesIO buffer. The attack is likely local to the process; if the application runs with elevated privileges, the resulting code execution could be far more damaging. Detection of exploitation would typically be a crash or abnormal termination of the Python process.

Generated by OpenCVE AI on October 20, 2026 at 01:02 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Pillow to version 13.0.0 or later.
  • If an upgrade is not immediately possible, avoid processing untrusted TIFF files with the in‑memory encoding path; validate or sanitize tags before passing them to Pillow.
  • If the application must continue using the affected version, isolate the TIFF encoding operation in a separate, restricted process or container so that a crash or code execution does not compromise the whole system.

Generated by OpenCVE AI on October 20, 2026 at 01:02 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Tue, 20 Oct 2026 00:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-825
References
Metrics threat_severity

None

threat_severity

Moderate


Mon, 19 Oct 2026 23:00:00 +0000

Type Values Removed Values Added
First Time appeared Python-pillow
Python-pillow pillow
Vendors & Products Python-pillow
Python-pillow pillow

Mon, 19 Oct 2026 21:30:00 +0000

Type Values Removed Values Added
Description Pillow is a Python imaging library. From 11.3.0 until 13.0.0, Pillow has a heap use-after-free when libtiff rejects a tag while encoding TIFF data to an in-memory buffer. When an application saves attacker-influenced TIFF tags to BytesIO, libtiff can reject a tag during encoding in ImagingLibTiffEncode; the error path then frees the output buffer without closing or clearing the TIFF handle, and later cleanup flushes through the write callback into freed memory, which can crash the process and may enable code execution. This issue is fixed in version 13.0.0.
Title Pillow: Heap use-after-free when encoding TIFF to an in-memory buffer
Weaknesses CWE-416
References
Metrics cvssV3_1

{'score': 5.9, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H'}


Subscriptions

Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-19T21:02:15.197Z

Reserved: 2026-10-19T16:58:51.959Z

Link: CVE-2026-112396

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-10-19T22:17:06.837

Modified: 2026-10-19T22:17:06.837

Link: CVE-2026-112396

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-10-19T21:02:15Z

Links: CVE-2026-112396 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T01:15:06Z

Weaknesses