CVE-2026-42311: Pillow integer overflow and OOB write in PSD processing

CVE-2026-42311 · Severity: high · CVSS 7.8 · Published 2026-05-09

Pillow, a widely used Python library for image processing, contains a vulnerability when handling Adobe Photoshop (PSD) files. If a user or automated system processes a specially crafted, malicious PSD file, it could cause the application to crash or allow an attacker to execute unauthorized code. This could lead to data theft or a complete takeover of the system running the software.

Technologies: pillow (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-42311 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-42311 being exploited in the wild.
How severe is CVE-2026-42311?
High severity, with a CVSS score of 7.8, published 9 May 2026.
Which products and versions are affected?
pillow (PyPI) >= 10.3.0, < 12.2.0, ECOSYSTEM:introduced=10.3.0,fixed=12.2.0.
Is there a fix for CVE-2026-42311?
Yes. pillow (PyPI): upgrade to 12.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-42311 attacked?
It is attacked with local access, in a software library.
Am I affected by CVE-2026-42311?
Check whether you run pillow (PyPI) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • pillow (PyPI): upgrade to 12.2.0 or later
    pip install "pillow>=12.2.0"

Technical details

An integer overflow vulnerability exists in the PSD image plugin of Pillow between versions 10.3.0 and 12.2.0. The flaw occurs when the library adds tile extents together without proper validation, leading to an out-of-bounds (OOB) write. An attacker can exploit this by providing a malicious PSD file that, when opened or processed, triggers memory corruption. This can result in a denial-of-service (crash) or arbitrary code execution in the context of the application. The vulnerability is addressed in version 12.2.0 by ensuring extents are not added together in a way that causes overflow.

Affected products

  • python-pillow Pillow >= 10.3.0, < 12.2.0

Identifiers

  • CVE-2026-42311
  • GHSA-pwv6-vv43-88gr
  • PYSEC-2026-2252

Timeline

  • 2026-04-01: patched: Fix committed and version 12.2.0 released.
  • 2026-05-09: disclosed: Initial advisory published.

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.