Skip to content
High 7.5

ag-psdに細工されたPSDで大量のメモリを確保させられる脆弱性(サービス拒否)

CVE-2026-62297 First seen on SecPulse

Summary

ag-psdには、PSDファイルに宣言された画像サイズをもとに、実データより前に大量のメモリを確保してしまう脆弱性(CVE-2026-62297)があります。細工された52バイトのファイルで約3.17GBのメモリを消費した例が報告されており、信頼できないPSDを読み込むサービスではサービス拒否の危険があります。バージョン31.0.0で合成画像の確保上限が追加されましたが、レイヤーの矩形に関する経路は完全には対処されていないとされています。最新の情報を確認してください。

AI summary

Produced by SecPulse using an external AI model; it may contain mistakes. Check the original description and references below before acting on it.

ag-psdには、PSDファイルに宣言された画像サイズをもとに、実データより前に大量のメモリを確保してしまう脆弱性(CVE-2026-62297)があります。細工された52バイトのファイルで約3.17GBのメモリを消費した例が報告されており、信頼できないPSDを読み込むサービスではサービス拒否の危険があります。バージョン31.0.0で合成画像の確保上限が追加されましたが、レイヤーの矩形に関する経路は完全には対処されていないとされています。最新の情報を確認してください。

Affected packages

PackageAffected → Fixed
Agamnentzarag-psd —
npmag-psd
< 31.0.0→ 31.0.0
Original description The description as published by the source.

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 }…

Source: CVE.org (CVE Program・cvelistV5) NVD GitHub Advisory

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details