Panic when processing certain blocks in go-codec-dagpb

Summary

08/04/2022
Yes i
High
7.5

CVE-2022-2584: ipld/go-codec-dagpb panics when processing certain blocks. Affects github.com/ipld/go-codec-dagpb versions < 1.3.1. Fixed in 1.3.1. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The go-codec-dagpb package is a Go implementation of the dag-pb codec for the go-ipld-prime library. It is used for encoding and decoding blocks in the InterPlanetary File System (IPFS) and other distributed systems. The package provides functionality for working with blocks in the dag-pb format, which is a binary encoding of IPLD data structures. The vulnerability in go-codec-dagpb can lead to a panic when processing certain blocks.

Vulnerability Detail

The vulnerability in go-codec-dagpb arises from an assumption that the reported link length is accurate. When decoding certain blocks, if the block ends before the reported length, it can result in a buffer overread and trigger a panic. This vulnerability can be exploited by an attacker to cause a denial of service (DoS) condition or potentially execute arbitrary code. The issue has been assigned a moderate severity rating.

How To Fix

Latest published version: v1.7.0 as of 22 Oct 2026

go get github.com/ipld/go-codec-dagpb@v1.7.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.3.1

This is the first release that contains the fix.

go get github.com/ipld/go-codec-dagpb@v1.3.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If you are unable to immediately upgrade to a fixed version of go-codec-dagpb, you can implement a workaround by recovering panics higher in the call stack of the goroutine that calls the defective code. This can help prevent the panic from propagating and causing a complete system failure.

Conclusion

The vulnerability in go-codec-dagpb can lead to a panic when processing certain blocks, potentially causing a denial of service (DoS) condition or enabling arbitrary code execution. It is recommended to upgrade to version 1.3.1 or above of go-codec-dagpb to fix the vulnerability. If immediate upgrade is not possible, implementing a workaround by recovering panics higher in the call stack can help mitigate the impact. For further support on vulnerability remediation, you can contact DevNack.com.

See every vulnerability recorded for github.com/ipld/go-codec-dagpb →

Share this vulnerability

FAQ

go-codec-dagpb is a Go package that provides encoding and decoding functionality for blocks in the dag-pb format. It is commonly used in distributed systems like IPFS.

The vulnerability can lead to a panic when processing certain blocks, potentially causing a denial of service (DoS) condition or enabling arbitrary code execution.

You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. Simply upload your Gopkg.lock file and Vulert will analyze it for open-source vulnerabilities.

Yes, you can implement a workaround by recovering panics higher in the call stack of the goroutine that calls the defective code. This can help mitigate the impact of the vulnerability.

For more information, you can ask in the IPFS Discord #ipld-chatter channel or open an issue in the go-codec-dagpb GitHub repository.

How To Fix

Latest published version: v1.7.0 as of 22 Oct 2026

go get github.com/ipld/go-codec-dagpb@v1.7.0

Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.

If you need the minimum change

1.3.1

This is the first release that contains the fix.

go get github.com/ipld/go-codec-dagpb@v1.3.1

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback