ag-psd can exhaust memory when parsing crafted PSD dimensions
CVE-2026-62297 · GHSA-qfx6-q44v-9qqw · published 13 Nov 2026
How serious is it
- Severity: high, CVSS score 7.5 out of 10.
- Exploit prediction (EPSS): 0.3% chance of exploitation in the next 30 days, higher than 28% of all vulnerabilities.
- Not on the CISA list of exploited vulnerabilities.
- No public exploit in Exploit-DB.
Is your app affected by CVE-2026-62297?
Paste this prompt into Claude Code, Cursor or any AI coding tool: it runs a free Shippable scan of your project and fixes what it finds. Built with Lovable, Bolt or v0? Scan your live app. Or upload your package file.
Who is affected
ag-psd(npm) < 31.0.0
How to check
- Run
npm ls ag-psdin your project to see the installed version, including copies pulled in by other packages. - Or paste your lockfile into the checker: it lists every package with a known vulnerability, this one included.
- Or run
npx shippable-dev scan localhost:3000in your project folder. It reads your lockfile and flags this vulnerability along with every other known one.
How to fix
Copies a prompt for Claude Code, Cursor or Codex: it checks your lockfiles for this and upgrades it.
- Upgrade
ag-psdto 31.0.0 or later, commit the lockfile and redeploy. - If a vulnerable version was live, check your logs and rotate the secrets that server could read.
The advisory
### 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.
Check your whole app
Dependencies are only half of it. Free and read-only: before you push, run npx shippable-dev scan localhost:3000 in your project folder, no account needed. For your live app, you prove it's yours with a one-line tag first.
References
- github.com/Agamnentzar/ag-psd/security/advisories/GHSA-qfx6-q44v-9qqw
- github.com/Agamnentzar/ag-psd/commit/2d7da68400990bae8ba248a065eb45021fa8000a
- github.com/Agamnentzar/ag-psd/blob/2d7da68400990bae8ba248a065eb45021fa8000a/CHANGELOG.md
- github.com/Agamnentzar/ag-psd/tree/31.0.0
- nvd.nist.gov/vuln/detail/cve-2026-62297
- github.com/advisories/GHSA-qfx6-q44v-9qqw
- github.com/Agamnentzar/ag-psd
Merged from GitHub Advisory Database, FIRST EPSS, OSV. Last updated 16 Nov 2026. All vulnerabilities · RSS · JSON