{"id":"CVE-2023-22460","aliases":["EUVD-2023-0438","GHSA-c653-6hhg-9x92","GO-2023-1269"],"status":"published","title":"go-ipld-prime json codec may panic if asked to encode bytes","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.","severity":{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.01165,"percentile":0.67712,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-20"],"published":"2023-01-04T14:53:19Z","modified":"2026-10-28T02:30:21Z","fixes":[{"ecosystem":"Go","package":"github.com/ipld/go-ipld-prime","fixed_in":["0.19.0"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Go","package":"github.com/ipld/go-ipld-prime","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.19.0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/ipld/go-ipld-prime","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.19.0"}]}]},{"source":"osv","ecosystem":"Go","package":"github.com/ipld/go-ipld-prime","ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.19.0"}]}]}],"products":[{"vendor":"ipld","product":"go-ipld-prime"},{"vendor":"protocol","product":"go-ipld-prime"}],"references":[{"url":"https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-c653-6hhg-9x92","tags":["x_refsource_CONFIRM","x_transferred","Third Party Advisory","advisory","web"]},{"url":"https://github.com/ipld/go-ipld-prime/pull/472","tags":["x_refsource_MISC","x_transferred","Patch","Third Party Advisory","fix","web"]},{"url":"https://github.com/ipld/go-ipld-prime/releases/tag/v0.19.0","tags":["x_refsource_MISC","x_transferred","Release Notes","Third Party Advisory","web"]},{"url":"http://www.openwall.com/lists/oss-security/2026/08/27/1","tags":["web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-22460","tags":["advisory"]},{"url":"https://pkg.go.dev/vuln/GO-2023-1269","tags":["web"]},{"url":"https://github.com/ipld/go-ipld-prime/commit/146d1c8529676fe9ee0604f014656af2395505fc","tags":["web"]},{"url":"https://github.com/advisories/GHSA-c653-6hhg-9x92"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22460.json","tags":["advisory"]},{"url":"https://github.com/ipld/go-ipld-prime","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2023-22460","title":"go-ipld-prime json codec may panic if asked to encode bytes","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.","status":"published","published":"2023-01-04T14:53:19.877Z","modified":"2026-08-27T03:42:58.484Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"cna"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:35:15.779187Z"}],"euvd":[{"id":"EUVD-2023-0438","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.","status":"published","published":"2023-01-04T14:53:19Z","modified":"2026-08-27T03:42:58Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"updated_at":"2026-11-02T18:01:29.296861Z"}],"ghsa":[{"id":"GHSA-c653-6hhg-9x92","title":"go-ipld-prime/codec/json may panic if asked to encode bytes","description":"`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.\n\n### Impact\n\nEncoding 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.\n\n**This only impacts uses of the \"json\" codec, \"dag-json\" is not impacted.** Use of \"json\" as a decoder is not impacted.\n\n### Patches\n\nFixed in v0.19.0.\n\n### Workarounds\n\nPrefer the \"dag-json\" codec which has the ability to [encode bytes](https://ipld.io/specs/codecs/dag-json/spec/#bytes).\n\n### References\n\nSee fix in [#472](https://github.com/ipld/go-ipld-prime/pull/472)","status":"published","published":"2023-01-05T12:04:09Z","modified":"2023-08-29T21:14:17Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:37:02.095916Z"}],"nvd":[{"id":"CVE-2023-22460","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.","status":"published","published":"2023-01-04T15:15:09.437Z","modified":"2026-08-27T04:16:39.52Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"secondary"},{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high","assessor":"primary"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T14:07:45.305824Z"}],"osv":[{"id":"CVE-2023-22460","title":"go-ipld-prime json codec may panic if asked to encode bytes","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.","status":"published","published":"2023-01-04T14:53:19.877Z","modified":"2026-10-28T02:30:21.086119185Z","cvss":[{"version":"3.1","score":7.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"high"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:44:30.334753Z"},{"id":"GHSA-c653-6hhg-9x92","title":"go-ipld-prime/codec/json may panic if asked to encode bytes","description":"`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.\n\n### Impact\n\nEncoding 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.\n\n**This only impacts uses of the \"json\" codec, \"dag-json\" is not impacted.** Use of \"json\" as a decoder is not impacted.\n\n### Patches\n\nFixed in v0.19.0.\n\n### Workarounds\n\nPrefer the \"dag-json\" codec which has the ability to [encode bytes](https://ipld.io/specs/codecs/dag-json/spec/#bytes).\n\n### References\n\nSee fix in [#472](https://github.com/ipld/go-ipld-prime/pull/472)","status":"published","published":"2023-01-05T12:04:09Z","modified":"2023-11-08T04:11:35.552164Z","cvss":[{"version":"3.1","score":5.9,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-20"],"updated_at":"2026-11-02T15:46:44.571161Z"},{"id":"GO-2023-1269","title":"Panic in encoding in github.com/ipld/go-ipld-prime","description":"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.","status":"published","published":"2023-01-18T18:07:08Z","modified":"2024-05-20T16:03:47Z","updated_at":"2026-11-02T15:47:00.918515Z"}]}}
