{"id":"CVE-2026-42328","aliases":["CVE-2026-42328","GHSA-w239-58x2-q8p5","GO-2026-5684"],"related":[],"kind":"vulnerability","state":"published","title":"go-ipld-prime: DAG-CBOR and DAG-JSON decoders unbounded recursion depth","summary":"go-ipld-prime is an implementation of the InterPlanetary Linked Data (IPLD) spec interfaces, a batteries-included codec implementations of IPLD for CBOR and JSON, and tooling for basic operations on IPLD objects. Prior to 0.23.0, 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). This vulnerability is fixed in 0.23.0.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"go-ipld-prime is an implementation of the InterPlanetary Linked Data (IPLD) spec interfaces, a batteries-included codec implementations of IPLD for CBOR and JSON, and tooling for basic operations on IPLD objects. Prior to 0.23.0, 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). This vulnerability is fixed in 0.23.0.","source":"cvelist"},{"lang":"en","text":"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.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Go-ipld-prime's DAG-CBOR and DAG-JSON decoders have unbounded recursion depth in github.com/ipld/go-ipld-prime","format":"markdown","source":"go"},{"lang":"es","text":"go-ipld-prime es una implementación de las interfaces de la especificación de InterPlanetary Linked Data (IPLD), implementaciones de códec de IPLD con todo incluido para CBOR y JSON, y herramientas para operaciones básicas en objetos IPLD. Antes de la 0.23.0, los decodificadores DAG-CBOR y DAG-JSON recurren en cada mapa o lista anidada sin un límite de profundidad. Una carga útil que contiene colecciones profundamente anidadas hace que el decodificador recurra una vez por nivel, haciendo crecer la pila de goroutines hasta que el tiempo de ejecución de Go termina el proceso con un desbordamiento de pila fatal (distinto de un pánico recuperable). Esta vulnerabilidad está corregida en la 0.23.0.","source":"nvd"}],"published":"2026-05-07T02:07:21.000Z","modified":"2026-10-26T11:10:00.157Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":6.2,"rating":"MEDIUM"}],"cwes":["CWE-674"],"affected":[{"ranges":[{"version":"< 0.23.0","status":"affected"}],"vendor":"ipld","product":"go-ipld-prime","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.23.0"}],"ecosystem":"Go","package":"github.com/ipld/go-ipld-prime","purl":"pkg:golang/github.com/ipld/go-ipld-prime","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.23.0"}],"ecosystem":"Go","package":"github.com/ipld/go-ipld-prime","purl":"pkg:golang/github.com/ipld/go-ipld-prime","source":"go"}],"references":[{"url":"https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-w239-58x2-q8p5","tags":["advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42328","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ipld/go-ipld-prime","tags":["package"],"sources":["ghsa"]},{"url":"https://github.com/ipld/go-ipld-prime/pull/625","tags":["fix"],"sources":["go"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-05-28T14:14:03.306Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-42328","url":"https://www.cve.org/CVERecord?id=CVE-2026-42328","licence":"CVE Terms of Use","modified":"2026-05-28T14:14:09.825Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-w239-58x2-q8p5","url":"https://github.com/advisories/GHSA-w239-58x2-q8p5","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:07.104Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2026-5684","url":"https://pkg.go.dev/vuln/GO-2026-5684","licence":"CC-BY-4.0","modified":"2026-07-24T19:00:25.418Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-42328","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-42328","licence":"Public domain","modified":"2026-10-26T11:10:00.157Z"}],"updatedAt":"2026-11-25T22:59:22.626Z","epss":{"score":0.0012,"percentile":0.02011,"date":"2026-12-01T12:00:22.000Z"}}