CVE-2026-59991: psd-tools Uncontrolled Memory Allocation via Crafted PSD Geometry

psd-tools Updated 23 Sep 2026

Summary

22/09/2026
Yes i
High
7.5

CVE-2026-59991: psd-tools composite/numpy has uncontrolled memory allocation via crafted PSD geometry. Affects psd-tools versions < 1.17.4. Fixed in 1.17.4. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

psd-tools is a Python library designed for reading and manipulating Adobe Photoshop PSD files. It allows users to access and modify layers, channels, and other components of PSD files. The library is widely used in applications that require image processing and manipulation. However, it is vulnerable to a significant issue where it can allocate excessive memory based on unvalidated dimensions declared in the PSD file, leading to potential denial of service.

Vulnerability Detail

The vulnerability arises from the method PSDImage.composite() and its associated numpy() function, which allocate memory for the output image buffer based on the dimensions specified in the PSD file's header. These dimensions are not validated against the actual file contents, allowing an attacker to craft a PSD file with minimal size but large declared dimensions. This results in excessive memory allocation, potentially reaching several gigabytes, which can lead to out-of-memory (OOM) conditions and crash the service processing the PSD file. The issue is exacerbated by the fact that the function returns a black image with only a warning, rather than raising an exception, making it difficult for users to detect the problem.

How To Fix

Latest published version: 1.26.0 as of 23 Oct 2026

pip install --upgrade "psd-tools==1.26.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.17.4

This is the first release that contains the fix.

pip install --upgrade "psd-tools==1.17.4"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

As a temporary workaround, avoid processing untrusted PSD files until the package is updated. Implement additional checks in your application to validate the dimensions of PSD files before passing them to the composite() function.

Conclusion

The psd-tools library has a critical vulnerability (CVE-2026-59991) that allows for uncontrolled memory allocation from crafted PSD files. Users are advised to update to the latest version to mitigate this risk. Additionally, implementing validation checks can help prevent potential denial of service attacks.

See every vulnerability recorded for psd-tools →

Share this vulnerability

FAQ

CVE-2026-59991 is a vulnerability in the psd-tools library that allows for uncontrolled memory allocation based on unvalidated dimensions in crafted PSD files.

The vulnerability can lead to denial of service by causing excessive memory allocation, which may crash the service processing the PSD file.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

If you cannot update the package, avoid processing untrusted PSD files and implement checks to validate file dimensions before processing.

The CVSS score of this vulnerability is 7.5, indicating a high severity level.

Related vulnerabilities

Recent vulnerabilities recorded for psd-tools.

How To Fix

Latest published version: 1.26.0 as of 23 Oct 2026

pip install --upgrade "psd-tools==1.26.0"

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.17.4

This is the first release that contains the fix.

pip install --upgrade "psd-tools==1.17.4"

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback