CVE-2026-59205
Analyzed Analyzed - Analysis Complete

Heap Corruption in Pillow ImageCmsTransform

Vulnerability report for CVE-2026-59205, including description, CVSS score, EPSS score, affected products, exploitability, helpful resources, and attack-flow context.

Publication date: 2026-07-14

Last updated on: 2026-07-14

Assigner: GitHub, Inc.

Description

Pillow is a Python imaging library. Prior to 12.3.0, Pillow's ImageCms.ImageCmsTransform.apply(im, imOut) API can trigger controlled native heap corruption when the caller supplies an output image whose mode does not match the transform's declared output mode. This issue is fixed in version 12.3.0.

CVSS Scores

EPSS Scores

Probability:
Percentile:

Meta Information

Published
2026-07-14
Last Modified
2026-07-14
Generated
2026-08-03
AI Q&A
2026-07-14
EPSS Evaluated
2026-08-02
NVD
EUVD

Affected Vendors & Products

Showing 1 associated CPE
Vendor Product Version / Range
python pillow to 12.3.0 (exc)

Helpful Resources

Exploitability

CWE
CWE Icon
KEV
KEV Icon
CWE ID Description
CWE-787 The product writes data past the end, or before the beginning, of the intended buffer.

Attack-Flow Graph

AI Quick Actions

Instant insights powered by AI
Executive Summary

CVE-2026-59205 is a vulnerability in the Pillow Python imaging library, specifically in the ImageCms.ImageCmsTransform.apply() function. The issue occurs when the output image's mode does not match the transform's declared output mode.

For example, if a transform is set to convert an image from RGBA to RGBA (4 bytes per pixel) but is applied to an output image in L mode (1 byte per pixel), the LittleCMS library will write 4-byte RGBA data into a 1-byte-per-pixel buffer. This causes a heap overflow, corrupting memory.

The vulnerability arises because Pillow only checks the dimensions of the images, not their modes, before calling the native transform. This can lead to controlled heap corruption even with small images, as demonstrated in proof-of-concept code.

The issue affects Pillow versions up to 12.2.0 and is fixed in version 12.3.0 by adding stricter validation to ensure the input and output image modes match the transform's expected modes.

Detection Guidance

Detecting this vulnerability requires checking if your system is running an affected version of Pillow (versions prior to 12.3.0) and identifying applications that use the vulnerable ImageCms.ImageCmsTransform.apply() API with untrusted input or output image modes.

  • Check the installed Pillow version using Python: Run `python -c "import PIL; print(PIL.__version__)"`. If the version is below 12.3.0, the system is vulnerable.
  • Inspect application code or dependencies for usage of `ImageCms.ImageCmsTransform.apply(im, imOut)`. Look for instances where the output image mode (`imOut.mode`) does not match the transform's declared output mode.
  • Monitor for crashes or unexpected behavior in applications using Pillow's ImageCms module, as heap corruption may cause segmentation faults or memory errors.
  • Use static analysis tools to scan Python codebases for calls to `ImageCmsTransform.apply()` where input validation for image modes is absent.
Impact Analysis

This vulnerability can impact you in several ways if you use an affected version of Pillow (prior to 12.3.0) in your applications or workflows.

  • Memory corruption: The heap overflow can corrupt memory, leading to crashes or unpredictable behavior in your application.
  • Availability loss: The primary impact, as indicated by the CVSS score, is a loss of availability. Your application may crash or become unresponsive due to the memory corruption.
  • Potential for further exploitation: While the CVSS score does not indicate direct confidentiality or integrity impacts, heap corruption could potentially be exploited further to achieve arbitrary code execution or other malicious outcomes, depending on the context.
  • Risk from untrusted input: If your application allows untrusted users to control transform parameters or output images, it is at higher risk of being exploited through this vulnerability.
Compliance Impact

The impact of this vulnerability on compliance with standards and regulations like GDPR or HIPAA depends on how Pillow is used in your systems and the nature of the data being processed.

  • GDPR: If your application processes personal data of EU citizens and relies on Pillow for image transformations, a crash or memory corruption caused by this vulnerability could lead to a loss of availability. Under GDPR, this could be considered a violation of the availability and resilience requirements (Article 32). Additionally, if the vulnerability were exploited to cause a data breach (though not directly indicated by the CVSS score), it could result in non-compliance with GDPR's data protection obligations.
  • HIPAA: For organizations handling protected health information (PHI) in the U.S., this vulnerability could pose risks if Pillow is used in systems processing medical images or related data. A crash or memory corruption could disrupt access to PHI, violating HIPAA's availability requirements. While the vulnerability does not directly imply a breach of confidentiality, any disruption in service could be seen as a failure to ensure the integrity and availability of electronic PHI (ePHI), as required by the HIPAA Security Rule.
  • General compliance risks: Many compliance frameworks require organizations to maintain secure and resilient systems. This vulnerability, if unpatched, could be flagged during audits as a failure to apply security updates or mitigate known risks, potentially leading to non-compliance findings.

To mitigate compliance risks, it is recommended to update to Pillow version 12.3.0 or later, where the vulnerability is patched.

Mitigation Strategies

To mitigate this vulnerability, follow these steps:

  • Upgrade Pillow to version 12.3.0 or later, which includes the fix for this issue. Use `pip install --upgrade pillow>=12.3.0` to update.
  • If upgrading is not immediately possible, apply input validation to ensure the output image mode matches the transform's declared output mode before calling `ImageCmsTransform.apply()`.
  • Restrict untrusted users from controlling transform parameters or output images in applications using Pillow's ImageCms module.
  • Monitor applications for crashes or anomalous behavior, as these may indicate exploitation attempts.
  • Review and audit code that uses the `ImageCmsTransform.apply()` API to ensure proper mode validation is in place.

Chat Assistant

Ask questions about this CVE
Hi! I’m here to help you understand CVE-2026-59205. Ask me anything about the vulnerability, its impact, or mitigation strategies.
0/70

EPSS Chart