Description
Pillow is a Python imaging library. From 2.0.0 until 13.0.0, Pillow has a heap buffer overflow and stale-heap disclosure in _tiffWriteProc when saving compressed TIFF data through libtiff to a target without a usable fileno(), such as BytesIO. The callback sizes its allocation from the prior buffer size instead of the current write position, allowing an attacker-controlled out-of-line TIFF tag or retained ICC profile to be copied beyond the allocation after libtiff seeks forward. This overflow can crash the process and may allow code execution. Independently, unwritten alignment gaps in compressed TIFF output larger than 64 KiB can disclose stale heap bytes without a crafted tag. File paths and targets with real file descriptors are unaffected. This issue is fixed in version 13.0.0.
Published: 2026-10-19
Score: 9.2 Critical
EPSS: n/a
KEV: No
Impact: Remote Code Execution
Action: Immediate Patch
AI Analysis

Impact

Pillow, the Python imaging library, contains a heap buffer overflow in the internal _tiffWriteProc routine that is executed when saving compressed TIFF images through libtiff to targets that do not expose a file descriptor, such as BytesIO streams. The overflow occurs when the callback allocates memory based on a prior buffer size rather than the current write position, allowing attacker‑controlled TIFF tags or retained ICC profiles to be written beyond the bounds of the allocated buffer. This can crash the process and, as the description indicates, may enable arbitrary code execution, corresponding to a CWE‑122 vulnerability.

Affected Systems

The flaw affects Pillow versions 2.0.0 through 13.0.0 inclusive when used in environments that write compressed TIFF data into a BytesIO object. Products built on the python‑pillow Pillow package are impacted; any application that constructs or manipulates TIFF images via Pillow in this manner is potentially vulnerable. The issue is mitigated in Pillow 13.0.0, after which the buffer allocation logic aligns with the current write position.

Risk and Exploitability

With a CVSS score of 9.2 the vulnerability is considered critical. Although no EPSS score is available and it is not listed in the CISA Known Exploited Vulnerabilities catalog, the high score suggests that a determined adversary could exploit it, especially in contexts where Pillow processes untrusted input. The likely attack vector is an application that accepts user‑supplied TIFF files and writes them to an in‑memory BytesIO stream; an attacker could craft tags or ICC profiles to trigger the overflow and then deliver malicious code. Because the vulnerability affects only in‑memory destinations, traditional file‑based protections do not help.

Generated by OpenCVE AI on October 20, 2026 at 00:25 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Pillow library to version 13.0.0 or later.
  • If an immediate upgrade is infeasible, avoid writing compressed TIFF data to BytesIO; use a real file descriptor or disable compression when using Pillow.
  • Validate and sanitize all TIFF input before processing, and monitor for abnormal crashes or memory corruption indicators.

Generated by OpenCVE AI on October 20, 2026 at 00:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

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 22:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'total'}, 'version': '2.0.3'}


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

Type Values Removed Values Added
Description Pillow is a Python imaging library. From 2.0.0 until 13.0.0, Pillow has a heap buffer overflow and stale-heap disclosure in _tiffWriteProc when saving compressed TIFF data through libtiff to a target without a usable fileno(), such as BytesIO. The callback sizes its allocation from the prior buffer size instead of the current write position, allowing an attacker-controlled out-of-line TIFF tag or retained ICC profile to be copied beyond the allocation after libtiff seeks forward. This overflow can crash the process and may allow code execution. Independently, unwritten alignment gaps in compressed TIFF output larger than 64 KiB can disclose stale heap bytes without a crafted tag. File paths and targets with real file descriptors are unaffected. This issue is fixed in version 13.0.0.
Title Pillow: Heap buffer overflow in _tiffWriteProc when saving TIFF to BytesIO
Weaknesses CWE-122
References
Metrics cvssV4_0

{'score': 9.2, 'vector': 'CVSS:4.0/AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Python-pillow Pillow
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-10-19T21:17:41.571Z

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

Link: CVE-2026-112393

cve-icon Vulnrichment

Updated: 2026-10-19T21:17:36.664Z

cve-icon NVD

Status : Received

Published: 2026-10-19T21:17:07.613

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

Link: CVE-2026-112393

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-10-20T00:30:07Z

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow