CVE-2026-59991: psd-tools uncontrolled memory allocation in composite/numpy

CVE-2026-59991 · Severity: high · CVSS 7.5 · Published 2026-09-22

psd-tools is a Python library for reading and manipulating Adobe Photoshop PSD files. The composite() and numpy() functions allocate output image buffers based on dimensions declared in the PSD file header without validating those values. An attacker can craft a tiny malicious PSD file (under 100 bytes) that declares extremely large image dimensions, causing the library to allocate gigabytes of memory. Since the library returns successfully with only a warning rather than raising an error, applications processing untrusted PSD files face denial-of-service risk via memory exhaustion and system crashes.

Technologies: psd-tools (PyPI). Vendors: PyPI.

Quick answers

Is CVE-2026-59991 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-59991 being exploited in the wild.
How severe is CVE-2026-59991?
High severity, with a CVSS score of 7.5, published 22 September 2026.
Which products and versions are affected?
psd-tools (PyPI) < 1.17.4, ECOSYSTEM:introduced=0,fixed=1.17.4.
Is there a fix for CVE-2026-59991?
Yes. psd-tools (PyPI): upgrade to 1.17.4 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-59991 attacked?
It is attacked over the network or from the adjacent network, in a software library.
Am I affected by CVE-2026-59991?
Check whether you run psd-tools (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

  • psd-tools (PyPI): upgrade to 1.17.4 or later
    pip install "psd-tools>=1.17.4"

Technical details

The vulnerability is an uncontrolled memory allocation issue in psd-tools' composite() and numpy() methods. The root cause is that these functions size output buffers based on width, height, channels, and bit-depth values read directly from the PSD file header, without validating them against the actual file length or enforcing reasonable limits. The attack vector is network/adjacent (processing untrusted PSD files), requires no authentication, and no user interaction beyond calling the affected methods. An attacker can amplify a 49-byte input into 3–32 GB of committed memory depending on which method is called and which dimension parameters are crafted. The critical issue is that composite() returns a black image with only a warning, providing no exception for callers to catch and prevent the OOM. The suggested fix involves pre-allocation validation against file length and configurable pixel/byte budgets, with error handling to raise exceptions rather than silently committing memory.

Affected products

  • psd-tools psd-tools 1.17.2 and likely earlier versions

Identifiers

  • CVE-2026-59991
  • GHSA-8q6g-vjhf-jp8m
  • PYSEC-2026-4139

Timeline

  • 2026-09-22: disclosed: GHSA-8q6g-vjhf-jp8m published

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