{"id":"CVE-2026-42328","aliases":["GHSA-w239-58x2-q8p5","GO-2026-5684"],"url":"https://o3.security/vulnerability/CVE-2026-42328","summary":"go-ipld-prime: DAG-CBOR and DAG-JSON decoders unbounded recursion depth","details":"The DAG-CBOR and DAG-JSON decoders recurse on each nested map or list without a depth limit. A payload containing deeply nested collections causes the decoder to recurse once per level, growing the goroutine stack until the Go runtime terminates the process with a fatal stack overflow (distinct from a recoverable panic).\n\nFor DAG-CBOR, a payload of approximately 2 MB, consisting of repeated `0x81` (array-of-1) bytes followed by a terminator, produces around 2 million recursion frames and reliably exhausts Go's default 1 GB goroutine stack. The existing allocation budget does not prevent this: each nested collection header costs only a handful of budget units, so the stack is exhausted before the budget is. DAG-JSON has equivalent exposure via `[[[...]]]`-style payloads; it has no budget system and is therefore unprotected against recursion depth as well.\n\nSchema-free decoding (using `basicnode.Prototype.Any`) allows arbitrary nesting depth. Schema-bound decoding bounds nesting only when the schema itself is non-recursive and contains no fields typed as `Any`; schemas with recursive type references or any `Any`-typed fields permit unconstrained nesting at those points.\n\nThe fix adds a configurable `MaxDepth` option to both decoders, defaulting to 1024 nested levels. The decoder returns `ErrDecodeDepthExceeded` when a payload nests beyond the limit. Well-formed IPLD data rarely approaches this depth in practice; the default is generous for legitimate use while preventing stack exhaustion.","published":"2026-05-27T16:31:38.090Z","modified":"2026-08-27T18:26:03.904615302Z","cvss":{"score":6.2,"severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"},"epss":{"score":0.0012,"percentile":0.02024,"asOf":"2026-08-24"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"Go","name":"github.com/ipld/go-ipld-prime","fixedVersion":"0.23.0"}],"fix":null,"references":[{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/42xxx/CVE-2026-42328.json"},{"type":"ADVISORY","url":"https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-w239-58x2-q8p5"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42328"},{"type":"PACKAGE","url":"https://github.com/ipld/go-ipld-prime"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-08-27T18:26:03.904615302Z"}}