CVE-2026-35480: go-ipld-prime DAG-CBOR Decoder Unbounded Memory Allocation Vulnerability

MODERATE
Advisory Identifier: GHSA-378j-3jfj-8r9f
CVSS 6.2
CWE-770
Published
Advisory Summary

CVE-2026-35480 is a MODERATE (CVSS 6.2) dag-cbor decoder unbounded memory allocation vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting go-ipld-prime libraries in the Go ecosystem. The issue involves dag-cbor decoder unbounded memory allocation from cbor headers. Remediation is available by upgrading affected packages to version 0.22.0.

CVE-2026-35480 at a Glance

CVE Identifier CVE-2026-35480
GHSA Identifier GHSA-378j-3jfj-8r9f
Severity MODERATE
CVSS v3.1 Base Score 6.2
CWE Classification CWE-770: Allocation of Resources Without Limits or Throttling
Affected Product 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-35480

To remediate this vulnerability, upgrade all affected 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.22.0
Upgrade github.com/ipld/go-ipld-prime to 0.22.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-35480, inspect your project dependencies for go-ipld-prime:

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

Analyze the terminal output to locate any version of 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.22.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-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In 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 decoder uses collection sizes declared in CBOR headers as Go preallocation hints for maps and lists. The decoder does not cap these size hints or account for their cost in its allocation budget, allowing small payloads to cause excessive memory allocation. A CBOR map or list header can declare an arbitrarily large number of entries, causing the decoder to preallocate proportionally large backing structures before any entries are actually read. Because the allocation budget is only decremented as entries are decoded (not when sizes are declared), this cost is effectively invisible to the budget system. This is compounded by nesting: each level of a nested structure triggers its own unchecked preallocation while consuming minimal budget (one entry per parent level), so a payload under 100 bytes with 10 levels of nesting can cause over 9GB of allocation. Schema-free decoding (i.e. using `basicnode.Prototype.Any`) allows arbitrary nesting depth. Schema-bound decoding limits nesting to the schema's structure, but any field typed as `Any` in the schema permits unconstrained nesting within that field. The fix caps the preallocation size hint to 1024 entries and decrements the allocation budget when collection sizes are declared. The declared length is still used for entry-count validation, and collections grow dynamically as entries are decoded, so correctly-formed data is unaffected, even beyond the preallocation limit.

CVE-2026-35480 Affected go-ipld-prime Versions

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

References

Frequently Asked Questions

What is CVE-2026-35480?
CVE-2026-35480 is a security vulnerability in go-ipld-prime involving DAG-CBOR decoder unbounded memory allocation from CBOR headers under CWE-770: Allocation of Resources Without Limits or Throttling.
Which go-ipld-prime versions are affected?
Affected versions include releases prior to 0.22.0 across affected packages: github.com/ipld/go-ipld-prime.
What version fixes CVE-2026-35480?
Upgrading to 0.22.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.22.0. Upgrade your dependency to 0.22.0 or later.
What is the CVSS score of CVE-2026-35480?
CVE-2026-35480 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-35480?
CVE-2026-35480 is classified under CWE-770: Allocation of Resources Without Limits or Throttling (The product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated.).
How can I check Go dependencies for CVE-2026-35480?
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-378j-3jfj-8r9f",
  "modified" : "2026-04-07T20:00:26Z",
  "published" : "2026-04-06T23:08:24Z",
  "aliases" : [ "CVE-2026-35480" ],
  "summary" : "go-ipld-prime: DAG-CBOR decoder unbounded memory allocation from CBOR headers",
  "details" : "The DAG-CBOR decoder uses collection sizes declared in CBOR headers as Go preallocation hints for maps and lists. The decoder does not cap these size hints or account for their cost in its allocation budget, allowing small payloads to cause excessive memory allocation.\n\nA CBOR map or list header can declare an arbitrarily large number of entries, causing the decoder to preallocate proportionally large backing structures before any entries are actually read. Because the allocation budget is only decremented as entries are decoded (not when sizes are declared), this cost is effectively invisible to the budget system. This is compounded by nesting: each level of a nested structure triggers its own unchecked preallocation while consuming minimal budget (one entry per parent level), so a payload under 100 bytes with 10 levels of nesting can cause over 9GB of allocation.\n\nSchema-free decoding (i.e. using `basicnode.Prototype.Any`) allows arbitrary nesting depth. Schema-bound decoding limits nesting to the schema's structure, but any field typed as `Any` in the schema permits unconstrained nesting within that field.\n\nThe fix caps the preallocation size hint to 1024 entries and decrements the allocation budget when collection sizes are declared. The declared length is still used for entry-count validation, and collections grow dynamically as entries are decoded, so correctly-formed data is unaffected, even beyond the preallocation limit.",
  "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.22.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-378j-3jfj-8r9f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-35480"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipld/go-ipld-prime/commit/e43bf4a27055fe8d895671a731ee5041e2d983a9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ipld/go-ipld-prime"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipld/go-ipld-prime/releases/tag/v0.22.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-770" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-04-06T23:08:24Z",
    "nvd_published_at" : "2026-04-07T15:17:45Z"
  }
}