---
id: "CVE-2026-62297"
kind: "vulnerability"
aliases: ["CVE-2026-62297"]
title: "ag-psd: crafted tiny PSD file forces multi-gigabyte memory allocation"
severity: "high"
cvss: 7.5
epss: null
exploited: false
status: "open"
category: "package"
products: []
ecosystems: []
tags: ["image-processing", "javascript", "node", "package", "self-hosted"]
not_affected_if: ["auth-required", "no-untrusted-psd-input"]
published_at: "2026-10-30T21:17:13+00:00"
first_seen_at: "2026-10-30T21:25:53+00:00"
updated_at: "2026-10-30T21:26:44+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-62297", "first_seen_at": "2026-10-30T21:25:53+00:00"}]
---

# ag-psd: crafted tiny PSD file forces multi-gigabyte memory allocation

ag-psd is a JavaScript library for reading and writing Photoshop files. A tiny malicious PSD declaring huge dimensions makes readPsd() allocate multi-gigabyte buffers before failing, so an attacker can crash or exhaust memory on a service that reads untrusted PSDs.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check the installed version with `npm ls ag-psd` and compare against the fixed release.
- Search your code for calls to `readPsd()` that accept files uploaded or supplied by users.

## Fix

- ag-psd `31.0.0` adds a composite-image allocation limit; the sources say complete coverage of the layer-rectangle allocation path is not established, so verify before relying on it.

## Timeline

- 2026-10-30T21:25:53+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-62297

## From the sources

ag-psd is a JavaScript library for reading and writing Photoshop Document files. Before the allocation-limit remediation attempt in version 31.0.0, `readPsd()` commits image and layer buffers from attacker-declared PSD geometry before validating the declarations against the actual available data or sane allocation limits. The `psdReader.js` implementation sizes off-heap typed arrays using `width`, `height`, `channels`, `depth` and `per-layer rectangles`, so a tiny PSD declaring enormous geometry can force multi-gigabyte memory allocation before a later bounds error. The reported 52-byte input on Node 24 produced approximately 3.17 GB peak RSS before a RangeError; under memory pressure the process can be terminated before the error can be caught, and concurrent inputs can exhaust memory. Services reading untrusted PSDs are exposed to denial of service. This differs from genuinely large PSD files whose memory demand is proportional to real input content. Version 31.0.0 adds a composite-image allocation limit, but complete coverage of the separately described layer-rectangle allocation path is not established and requires curator residual/scope review.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
