CVE-2022-2584: Github.com/ipld/go codec dagpb Ipld/go-codec-dagpb Panics When Processing Certain Vulnerability

HIGH
Advisory Identifier: GHSA-g3vv-g2j5-45f2
CVSS 7.5
CWE-119
Published
Advisory Summary

CVE-2022-2584 is a HIGH (CVSS 7.5) ipld/go-codec-dagpb panics when processing certain vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Github.com/ipld/go codec dagpb libraries in the Go ecosystem. The issue involves ipld/go-codec-dagpb panics when processing certain blocks. Remediation is available by upgrading affected packages to version 1.3.1.

CVE-2022-2584 at a Glance

CVE Identifier CVE-2022-2584
GHSA Identifier GHSA-g3vv-g2j5-45f2
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Github.com/ipld/go codec dagpb
Package Ecosystem Go
Published Date
Last Updated

Security Impact

CVSS: 7.5

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

Attack Vector Network (AV:N)
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-2022-2584

To remediate this vulnerability, upgrade all affected Github.com/ipld/go codec dagpb 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-codec-dagpb fixed: 1.3.1
Upgrade github.com/ipld/go-codec-dagpb to 1.3.1
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-codec-dagpb

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-2584, inspect your project dependencies for Github.com/ipld/go codec dagpb:

inspect dependencies for github.com/ipld/go-codec-dagpb

Analyze the terminal output to locate any version of Github.com/ipld/go codec dagpb in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.1), 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-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Github.com/ipld/go codec dagpb, 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

### Impact Decoding certain blocks using the go-ipld-prime version of the dag-pb codec (go-codec-dagpb) can cause a panic. The panic comes from an assumption that the reported link length is accurate, but if the block ends before that reported length then it’s a buffer overread. ### Patches The issue is fixed in v1.3.1 and above. Consumers can discover the versions of `go-codec-dagpb` in a module's dependency graph using the following command in the module root: ```go mod graph | grep go-codec-dagpb``` ### Workarounds You can work around this issue without upgrading by recovering panics higher in the call stack of the goroutine that calls the defective code. ### For more information If you have any questions or comments about this advisory: * Ask in [IPFS Discord #ipld-chatter](https://discord.gg/ipfs) * Open an issue in [go-codec-dagpb](https://github.com/ipld/go-codec-dagpb)

CVE-2022-2584 Affected Github.com/ipld/go codec dagpb Versions

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

References

Frequently Asked Questions

What is CVE-2022-2584?
CVE-2022-2584 is a security vulnerability in Github.com/ipld/go codec dagpb involving ipld/go-codec-dagpb panics when processing certain blocks under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Github.com/ipld/go codec dagpb versions are affected?
Affected versions include releases prior to 1.3.1 across affected packages: github.com/ipld/go-codec-dagpb.
What version fixes CVE-2022-2584?
Upgrading to 1.3.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is github.com/ipld/go-codec-dagpb affected?
Yes, github.com/ipld/go-codec-dagpb is affected in releases prior to 1.3.1. Upgrade your dependency to 1.3.1 or later.
What is the CVSS score of CVE-2022-2584?
CVE-2022-2584 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2022-2584?
CVE-2022-2584 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check Go dependencies for CVE-2022-2584?
Run the dependency tree command: 'inspect dependencies for github.com/ipld/go-codec-dagpb'. 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-g3vv-g2j5-45f2",
  "modified" : "2026-01-23T22:34:06Z",
  "published" : "2022-04-08T22:08:45Z",
  "aliases" : [ "CVE-2022-2584" ],
  "summary" : "ipld/go-codec-dagpb panics when processing certain blocks",
  "details" : "### Impact \nDecoding certain blocks using the go-ipld-prime version of the dag-pb codec (go-codec-dagpb) can cause a panic.  The panic comes from an assumption that the reported link length is accurate, but if the block ends before that reported length then it’s a buffer overread.\n\n### Patches\nThe issue is fixed in v1.3.1 and above.\n\nConsumers can discover the versions of `go-codec-dagpb` in a module's dependency graph using the following command in the module root:\n\n```go mod graph | grep go-codec-dagpb```\n\n### Workarounds\nYou can work around this issue without upgrading by recovering panics higher in the call stack of the goroutine that calls the defective code.\n\n### For more information\nIf you have any questions or comments about this advisory:\n\n* Ask in [IPFS Discord #ipld-chatter](https://discord.gg/ipfs)\n* Open an issue in [go-codec-dagpb](https://github.com/ipld/go-codec-dagpb)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Go",
      "name" : "github.com/ipld/go-codec-dagpb"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ipld/go-codec-dagpb/security/advisories/GHSA-g3vv-g2j5-45f2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-2584"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ipld/go-codec-dagpb/commit/a17ace35cc760a2698645c09868f9050fa219f57"
  }, {
    "type" : "WEB",
    "url" : "https://pkg.go.dev/vuln/GO-2022-0422"
  }, {
    "type" : "PACKAGE",
    "url" : "github.com/ipld/go-codec-dagpb"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-04-08T22:08:45Z",
    "nvd_published_at" : null
  }
}