At a glance
- CVE-2026-62297 in ag-psd can exhaust memory while parsing PSD files.
- npm ag-psd versions below 31.0.0 are affected; services processing untrusted PSD files face DoS risk.
- Prioritize upgrading to 31.0.0; avoid processing untrusted PSD files before upgrading.
- Check the installed package version and confirm it is 31.0.0 or later.
ag-psd memory exhaustion vulnerability in PSD parsing: upgrade to 31.0.0
GitHub warns that CVE-2026-62297 in the Node.js ag-psd library can exhaust memory when parsing PSD files with unusually declared dimensions, causing DoS. Versions below 31.0.0 are affected; upgrade to 31.0.0 and avoid untrusted PSD files until upgraded.
In this article
GitHub Advisories published GHSA-qfx6-q44v-9qqw for ag-psd, a Node.js library used to read and process Adobe Photoshop PSD files. The vulnerability can cause a process to consume excessive memory when parsing PSD data with unusually declared dimensions.
Overview and technical details
| Field | Details |
|---|---|
| Product | npm ag-psd, a Node.js library for reading and processing PSD files |
| Identifiers | CVE-2026-62297; GHSA-qfx6-q44v-9qqw |
| CWE | CWE-789 |
| CVSS | 7.5 (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| Source | GitHub Advisories |
In readPsd(), the library allocates image and layer buffers based on dimensions, channel count, and color depth in the PSD header and layer rectangles before validating those values against the actual data. The advisory states that a 52-byte PSD can make ag-psd 30.2.0 on Node 24 commit about 3.17 GB of memory in about 0.45 seconds and then raise a RangeError; in practice, the process may be OOM-killed before the error is handled.
Affected systems
| Product | Affected versions | Fixed version |
|---|---|---|
| npm ag-psd | < 31.0.0 | 31.0.0 |
The stated risk applies to services reading untrusted PSD files: a crafted file can cause remote DoS. Concurrent requests can exhaust memory.
System checks
Check the ag-psd version installed in the Node.js project:
npm ls ag-psdAlternatively, check the package version directly:
node -p "require('ag-psd/package.json').version"Version 31.0.0 or later is fixed; versions below 31.0.0 need upgrading.
Remediation and mitigation
Upgrade the npm ag-psd package to version 31.0.0.
Until upgraded, avoid processing untrusted PSD files.
After upgrading, run one of the version checks above and confirm the version is 31.0.0 or later.
The proposed remediation is to validate declared dimensions, channel count, color depth, and each layer rectangle against the input data length, and to apply reasonable maximum limits before allocating memory.