Vulnerabilities in pkg:golang/github.com/ipld/go-ipld-prime

PACKAGE
Advisory Identifier: GHSA-w239-58x2-q8p5
Advisory Summary

CVE-2026-42328 is a MODERATE (CVSS 6.2) go-ipld-prime's dag-cbor and dag-json decoders vulnerability (CWE-674: Uncontrolled Recursion) affecting Github.com/ipld/go ipld prime libraries in the Go ecosystem. The issue involves go-ipld-prime's dag-cbor and dag-json decoders have unbounded recursion depth. Remediation is available by upgrading affected packages to version 0.23.0.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:golang/github.com/ipld/go-ipld-prime

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:golang/github.com/ipld/go-ipld-prime. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-w239-58x2-q8p5 CVE-2026-42328 MODERATE go-ipld-prime's DAG-CBOR and DAG-JSON decoders have unbounded recursion depth
GHSA-378j-3jfj-8r9f CVE-2026-35480 MODERATE go-ipld-prime: DAG-CBOR decoder unbounded memory allocation from CBOR headers
GHSA-c653-6hhg-9x92 CVE-2023-22460 MODERATE go-ipld-prime/codec/json may panic if asked to encode bytes

CVE-2026-42328 at a Glance

CVE Identifier CVE-2026-42328
GHSA Identifier GHSA-w239-58x2-q8p5
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-674: Uncontrolled Recursion
Affected Product Github.com/ipld/go ipld prime
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 6.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-42328

To remediate this vulnerability, upgrade all affected Github.com/ipld/go ipld prime dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

github.com/ipld/go-ipld-prime fixed: 0.23.0
Upgrade github.com/ipld/go-ipld-prime to 0.23.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for github.com/ipld/go-ipld-prime

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-42328, inspect your project dependencies for Github.com/ipld/go ipld prime:

inspect dependencies for github.com/ipld/go-ipld-prime

Analyze the terminal output to locate any version of Github.com/ipld/go ipld prime in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.23.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-674: Uncontrolled Recursion, where the product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack. In Github.com/ipld/go ipld prime, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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). For 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. Schema-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. The 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.

CVE-2026-42328 Affected Github.com/ipld/go ipld prime Versions

1 component(s)
Fixed Versions:
0.23.0
Product / Package Ecosystem Affected Versions Fixed Version
github.com/ipld/go-ipld-prime
Go
< 0.23.0
0.23.0

References

Frequently Asked Questions

What is CVE-2026-42328?
CVE-2026-42328 is a security vulnerability in Github.com/ipld/go ipld prime involving go-ipld-prime's DAG-CBOR and DAG-JSON decoders have unbounded recursion depth under CWE-674: Uncontrolled Recursion.
Which Github.com/ipld/go ipld prime versions are affected?
Affected versions include releases prior to 0.23.0 across affected packages: github.com/ipld/go-ipld-prime.
What version fixes CVE-2026-42328?
Upgrading to 0.23.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ipld/go-ipld-prime affected?
Yes, github.com/ipld/go-ipld-prime is affected in releases prior to 0.23.0. Upgrade your dependency to 0.23.0 or later.
What is the CVSS score of CVE-2026-42328?
CVE-2026-42328 has a CVSS v3.1 base score of 6.2 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-42328?
CVE-2026-42328 is classified under CWE-674: Uncontrolled Recursion (The product does not properly control the amount of recursion that takes place, consuming excessive resources, such as allocated memory or the program stack.).
How can I check Go dependencies for CVE-2026-42328?
Run the dependency tree command: 'inspect dependencies for github.com/ipld/go-ipld-prime'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-w239-58x2-q8p5",
  "modified" : "2026-06-08T23:47:37Z",
  "published" : "2026-05-07T02:07:21Z",
  "aliases" : [ "CVE-2026-42328" ],
  "summary" : "go-ipld-prime's DAG-CBOR and DAG-JSON decoders have 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ipld/go-ipld-prime"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.23.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "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"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-674" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-07T02:07:21Z",
    "nvd_published_at" : "2026-05-27T18:16:22Z"
  }
}