HIGH · CVSS 3.1 7.5 EPSS 0.6% · 43th percentile CWE-789

CVE-2026-62297: ag-psd can exhaust memory when parsing crafted PSD dimensions

Published 2026-11-13 · Updated 2026-11-13 · Also known as GHSA-qfx6-q44v-9qqw

Summary

The ag-psd library suffers from an uncontrolled memory allocation vulnerability when parsing crafted PSD dimensions before validating them against actual data. All developers using ag-psd versions prior to 31.0.0 to parse untrusted PSD files should update immediately.

Who is affected

Deployments parsing untrusted PSD files via ag-psd are vulnerable to a remote Denial of Service (DoS) attack. A tiny crafted PSD file can force multi-gigabyte memory allocations that trigger uncatchable process termination or exhaust system memory under concurrent requests.

Exploitability

The vulnerability can be exploited over a network without authentication or user interaction with a base score of 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H). The current EPSS score is 0.003 and it is not listed in the CISA Known Exploited Vulnerabilities catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-18. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
npm ag-psd >= 0, < 31.0.0 31.0.0 npm install [email protected]

CVSS 3.1 vector

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Attack vectorNetwork
Attack complexityLow
Privileges requiredNone
User interactionNone
ScopeUnchanged
ConfidentialityNone
IntegrityNone
AvailabilityHigh

FAQ

What causes the memory exhaustion in ag-psd?

The readPsd() function allocates image and layer buffers based on declared header geometry and layer rectangles before validating those values against the actual input data length.

Is this vulnerability actively exploited in the wild?

There is currently no documentation indicating active exploitation, and the vulnerability is not present in the CISA Known Exploited Vulnerabilities catalog.

Which package version fixes this vulnerability?

Version 31.0.0 of the npm package ag-psd contains the fix for this issue.

Original advisory description
### Summary readPsd() commits the image/layer buffers from the declared header geometry (width x height x channels x depth, and per-layer rectangles) before validating those values against the actual data. A tiny crafted PSD declaring huge geometry forces a multi-gigabyte allocation. ### Impact On ag-psd 30.2.0, Node 24, a 52-byte PSD makes readPsd(buf) commit ~3.17 GB (measured peak RSS) in ~0.45 s before throwing a catchable RangeError ("Offset is outside the bounds of the DataView") - about 61,000,000x amplification. Because the buffer is committed before validation, the allocation OOM-kills the process before the error on essentially any host (uncatchable), and concurrent requests exhaust memory. Any service reading untrusted PSDs with ag-psd is exposed to a remote DoS. This is distinct from #39 and #206, which involve genuinely large PSDs (memory proportional to real data). Here the input is 52 bytes: the file declares enormous geometry that is never present, so the allocation is driven by an unvalidated header field, not by actual content, an uncontrolled-allocation denial-of-service vulnerability, not proportional memory use. ### Steps to reproduce The PoC is a 52-byte PSD (sha256 a1146a6fabdfef289472f99a56851249e7a46e8d19d4d8bf85fe833e2f0158b6). Reconstruct with: base64 -d > poc.psd <<'EOF' OEJQUwABAAAAAAAAAA0AADcuAAA58wAgAAMAAAAAAAAAAAAAAAAAAdEgNZv+i9bc9ygd2A== EOF Then (commits ~3.17 GB before throwing a catchable RangeError): const { readPsd } = require('ag-psd'); const buf = require('fs').readFileSync('poc.psd'); readPsd(buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength)); ### Root cause psdReader.js sizes the off-heap typed-array buffers from the declared header dimensions (and per-layer rectangles, a second independent lever) before validating against the available bytes. ### Suggested fix Validate the declared dimensions, channel count, depth, and per-layer rectangles against the actual input length (and a sane maximum) before allocating.

References

Source records: GHSA-qfx6-q44v-9qqw (OSV.dev) · EPSS by FIRST, 2026-11-26.