7.5high
go-ipld-prime json codec may panic if asked to encode bytes
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.17% (higher than 68% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-c653-6hhg-9x92GO-2023-1269
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. Encoding data which contains a Bytes kind Node will pass a Bytes token to the JSON encoder which will panic as it doesn't expect to receive Bytes tokens. Such an encode should be treated as an error, as plain JSON should not be able to encode Bytes. This only impacts uses of the `json` codec. `dag-json` is not impacted. Use of `json` as a decoder is not impacted. This issue is fixed in v0.19.0. As a workaround, one may prefer the `dag-json` codec, which has the ability to encode bytes.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| ipld go-ipld-prime | < 0.19.0 | CVE List |
| github.com/ipld/go-ipld-prime (Go) | before 0.19.0 | GitHub Advisory Database, Go Vulnerability Database |
| protocol go-ipld-prime | before 0.19.0 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H |
| NVD | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.
What each source says
CVE List
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. Encoding data which contains a Bytes kind Node will pass a Bytes token to the JSON encoder which will panic as it doesn't expect to receive Bytes tokens. Such an encode should be treated as an error, as plain JSON should not be able to encode Bytes. This only impacts uses of the `json` codec. `dag-json` is not impacted. Use of `json` as a decoder is not impacted. This issue is fixed in v0.19.0. As a workaround, one may prefer the `dag-json` codec, which has the ability to encode bytes.
GitHub Advisory Database
go-ipld-prime is a series of Go interfaces for manipulating IPLD data and a Go module that contains the go-ipld-prime/codec/json codec.
Impact
Encoding data which contains a Bytes kind Node will pass a Bytes token to the JSON encoder which will panic as it doesn't expect to receive Bytes tokens. Such an encoding should be treated as an error, as plain JSON should not be able to encode Bytes.
This only impacts uses of the "json" codec, "dag-json" is not impacted. Use of "json" as a decoder is not impacted.
Patches
Fixed in v0.19.0.
Workarounds
Prefer the "dag-json" codec which has the ability to encode bytes.
References
See fix in #472
Go Vulnerability Database
Encoding data using the 'json' codec which contains a 'Bytes' type Node will cause the encoder to panic. The decoder is not impacted. If the codec is used to encode user supplied data, this may be used as a vector for a denial of service attack.
NVD (es)
go-ipld-prime es una implementación de las interfaces de especificaciones de datos vinculados interplanetarios (IPLD), que incluye implementaciones de códec de IPLD para CBOR y JSON y herramientas para operaciones básicas en objetos IPLD. La codificación de datos que contiene un nodo de tipo Bytes pasará un token de Bytes al codificador JSON, lo que entrará en pánico porque no espera recibir tokens de Bytes. Dicha codificación debe tratarse como un error, ya que JSON simple no debería poder codificar bytes. Esto solo afecta los usos del códec "json". `dag-json` no se ve afectado. El uso de `json` como decodificador no se ve afectado. Este problema se solucionó en v0.19.0. Como workaround, se puede preferir el códec `dag-json`, que tiene la capacidad de codificar bytes.
References
| https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-c653-6hhg-9x92 | advisory, third-party-advisory, web | |
| https://github.com/ipld/go-ipld-prime/pull/472 | fix, patch, third-party-advisory, web | |
| https://github.com/ipld/go-ipld-prime/releases/tag/v0.19.0 | release-notes, third-party-advisory, web | |
| http://www.openwall.com/lists/oss-security/2026/08/27/1 | ||
| https://nvd.nist.gov/vuln/detail/CVE-2023-22460 | advisory | |
| https://github.com/ipld/go-ipld-prime/commit/146d1c8529676fe9ee0604f014656af2395505fc | web | |
| https://github.com/ipld/go-ipld-prime | package | |
| https://pkg.go.dev/vuln/GO-2023-1269 | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-22460 changed 2026-08-27 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-c653-6hhg-9x92 changed 2023-11-08 | CC-BY-4.0 |
| Go Vulnerability Database | GO-2023-1269 changed 2024-05-20 | CC-BY-4.0 |
| NVD | CVE-2023-22460 changed 2026-08-27 | Public domain |