Improper Input Validation Affecting github.com/ipld/go-ipld-prime/codec/dagjson package, versions <0.19.0


Severity

Recommended
0.0
medium
0
10

CVSS assessment made by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.22% (61st percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications

Snyk Learn

Learn about Improper Input Validation vulnerabilities in an interactive lesson.

Start learning
  • Snyk IDSNYK-GOLANG-GITHUBCOMIPLDGOIPLDPRIMECODECDAGJSON-3225095
  • published5 Jan 2023
  • disclosed5 Jan 2023
  • creditHenrique Dias

Introduced: 5 Jan 2023

CVE-2023-22460  (opens in a new tab)
CWE-20  (opens in a new tab)

How to fix?

Upgrade github.com/ipld/go-ipld-prime/codec/dagjson to version 0.19.0 or higher.

Overview

Affected versions of this package are vulnerable to Improper Input Validation such that, encoding data which contains a Bytes kind Node will pass a Bytes token to the JSON encoder which will panic as it does not expect to receive Bytes tokens.

Note: This issue only impacts uses of the json codec. Using dag-json or json as a decoder does not impact the user.

Workaround

Users who are unable to upgrade to the fixed version should use the dag-json codec which has the ability to encode bytes.

CVSS Base Scores

version 3.1