Skip to content
Heist/ feed
Back to feed
High

go-ipld-prime json codec may panic if asked to encode bytes

Type: advisorySources: OSV

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.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2023-22460
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 16:26 UTC · Revision 1

Source evidence

go-ipld-prime json codec may panic if asked to encode bytes

core-osv · Original source

Published 4 Jan 2023, 14:53 UTC

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.

osv:CVE-2023-22460
Complete source record
{
  "id": "2d88ae5ce1266f575dbee65f96515d1299db921d0c9ec0d069a27ef486d6d87b",
  "url": "https://osv.dev/vulnerability/CVE-2023-22460",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "go-ipld-prime json codec may panic if asked to encode bytes",
    "summary": "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.",
    "evidence": "osv:CVE-2023-22460",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2023-22460",
      "aliases": [
        "CVE-2023-22460",
        "GHSA-c653-6hhg-9x92",
        "GO-2023-1269"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/ipld/go-ipld-prime",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "ac99fc3ecbe040a04ff4dcb83a00c9f65e863b15"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.19.0"
                      }
                    ],
                    "source": "AFFECTED_FIELD",
                    "strategy": "StringRangeExpression"
                  },
                  {
                    "range": [
                      {
                        "fixed": "ac99fc3ecbe040a04ff4dcb83a00c9f65e863b15"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "v0.19.0"
                  },
                  {
                    "cpe": "cpe:2.3:a:protocol:go-ipld-prime:*:*:*:*:*:go:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "fixed": "0.19.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.18.0",
            "v0.17.0",
            "v0.16.0",
            "v0.14.4",
            "v0.14.3",
            "v0.14.2",
            "v0.14.1",
            "v0.14.0",
            "v0.12.3",
            "v0.12.2",
            "v0.12.1",
            "v0.12.0",
            "v0.11.0",
            "v0.10.0",
            "v0.9.0",
            "v0.7.0",
            "v0.6.0",
            "v0.5.0",
            "v0.5",
            "v0.4.0",
            "v0.4",
            "v0.0.3",
            "v0.0.2",
            "v0.0.1-filecoin",
            "v0.0.1"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2023-22460.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:21.086119185Z",
      "provider": "osv",
      "references": [
        "https://github.com/ipld/go-ipld-prime/releases/tag/v0.19.0",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22460.json",
        "https://github.com/ipld/go-ipld-prime/security/advisories/GHSA-c653-6hhg-9x92",
        "https://nvd.nist.gov/vuln/detail/CVE-2023-22460",
        "https://github.com/ipld/go-ipld-prime/pull/472"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-20"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/22xxx/CVE-2023-22460.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2023-22460",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 487118,
  "published_at": "2023-01-04T14:53:19.877+00:00"
}