Advisory Database
  • Advisories
  • Dependency Scanning
  1. golang
  2. ›
  3. github.com/ipld/go-codec-dagpb
  4. ›
  5. GMS-2022-820

GMS-2022-820: Panic when processing certain blocks

April 8, 2022 (updated August 30, 2023)

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
  • Open an issue in go-codec-dagpb

References

  • github.com/advisories/GHSA-g3vv-g2j5-45f2
  • github.com/ipld/go-codec-dagpb/security/advisories/GHSA-g3vv-g2j5-45f2

Code Behaviors & Features

Detect and mitigate GMS-2022-820 with GitLab Dependency Scanning

Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →

Affected versions

All versions before 1.3.1

Fixed versions

  • v1.3.1

Solution

Upgrade to version 1.3.1 or above.

Source file

go/github.com/ipld/go-codec-dagpb/GMS-2022-820.yml

Spotted a mistake? Edit the file on GitLab.

  • Site Repo
  • About GitLab
  • Terms
  • Privacy Statement
  • Contact

Page generated Wed, 14 May 2025 12:15:58 +0000.