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.
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
You can work around this issue without upgrading by recovering panics higher in the call stack of the goroutine that calls the defective code.
If you have any questions or comments about this advisory:
| Score | Percentile |
|---|---|
| 0.47% | 64.51% |
| Base score | Version | Severity | Vector |
|---|---|---|---|
| 7.5 | 3.1 | — |
|
| Type | Value |
|---|---|
| GHSA | GHSA-g3vv-g2j5-45f2 ↗ |
| CVE | CVE-2022-2584 ↗ |
| CWE id | Name |
|---|---|
| CWE-119 | Improper Restriction of Operations within the Bounds of a Memory Buffer |
Vulnerable version ranges and first patched releases as published by GitHub.
| Ecosystem | Package | Vulnerable range | First patched | Vulnerable functions |
|---|---|---|---|---|
| go | github.com/ipld/go-codec-dagpb | < 1.3.1 | 1.3.1 | — |