CVE-2020-10663: Json Unsafe Object Creation Vulnerability

HIGH
Advisory Identifier: GHSA-jphg-qwrw-7w9g
CVSS 7.5
CWE-20
Published
Advisory Summary

CVE-2020-10663 is a HIGH (CVSS 7.5) unsafe object creation vulnerability (CWE-20: Improper Input Validation) affecting Json libraries in the RubyGems ecosystem. The issue involves unsafe object creation in json rubygem. Remediation is available by upgrading affected packages to version 2.3.0.

CVE-2020-10663 at a Glance

CVE Identifier CVE-2020-10663
GHSA Identifier GHSA-jphg-qwrw-7w9g
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-20: Improper Input Validation
Affected Product Json
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability None (A:N)

How to Fix CVE-2020-10663

To remediate this vulnerability, upgrade all affected Json dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

json fixed: 2.3.0
Upgrade json to 2.3.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for json

How to Check if You Are Affected

To determine whether your application is affected by CVE-2020-10663, inspect your project dependencies for Json:

inspect dependencies for json

Analyze the terminal output to locate any version of Json in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Json, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The JSON gem through 2.2.0 for Ruby, as used in Ruby 2.4 through 2.4.9, 2.5 through 2.5.7, and 2.6 through 2.6.5, has an Unsafe Object Creation Vulnerability. This is quite similar to CVE-2013-0269/GHSA-x457-cw4h-hq5f, but does not rely on poor garbage-collection behavior within Ruby. Specifically, use of JSON parsing methods can lead to creation of a malicious object within the interpreter, with adverse effects that are application-dependent.

CVE-2020-10663 Affected Json Versions

1 component(s)
Fixed Versions:
2.3.0
Product / Package Ecosystem Affected Versions Fixed Version
json
RubyGems
< 2.3.0
2.3.0

References

NVD — CVE-2020-10663 NVD
https://nvd.nist.gov/vuln/detail/CVE-2020-10663
www.ruby-lang.org/en/news/2020/03/19/... WEB
https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663
Json Security Information SECURITY
https://www.debian.org/security/2020/dsa-4721
support.apple.com/kb/ht211931 WEB
https://support.apple.com/kb/HT211931
Json Security Information SECURITY
https://security.netapp.com/advisory/ntap-20210129-0003
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NK2PBXWMFRUD7U7Q7LHV4KYLYID77RI4
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F4TNVTT66VPRMX5UZYSDGSVRXKKDDDU5
lists.fedoraproject.org/archives/list/packa... WEB
https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7QL6MJD2BO4IRJ5CJFNMCDYMQQFT24BJ
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2020/04/msg00030.html
lists.apache.org/thread.html/ree3abc... WEB
https://lists.apache.org/thread.html/ree3abcd33c06ee95ab59faa1751198a1186d8941ddc2c2562c12966c@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/rec8bb4... WEB
https://lists.apache.org/thread.html/rec8bb4d637b04575da41cfae49118e108e95d43bfac39b7b698ee4db@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/rd9b9cc... WEB
https://lists.apache.org/thread.html/rd9b9cc843f5cf5b532bdad9e87a817967efcf52b917e8c43b6df4cc7@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/rb2b981... WEB
https://lists.apache.org/thread.html/rb2b981912446a74e14fe6076c4b7c7d8502727ea0718e6a65a9b1be5@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/rb023d5... WEB
https://lists.apache.org/thread.html/rb023d54a46da1ac0d8969097f5fecc79636b07d3b80db7b818a5c55c@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/r8d2e17... WEB
https://lists.apache.org/thread.html/r8d2e174230f6d26e16c007546e804c343f1f68956f526daaafa4aaae@%3Cdev.zookeeper.apache.org%3E
lists.apache.org/thread.html/r5f17bf... WEB
https://lists.apache.org/thread.html/r5f17bfca1d6e7f4b33ae978725b2fd62a9f1b3111696eafa9add802d@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/r3b04f4... WEB
https://lists.apache.org/thread.html/r3b04f4e99a19613f88ae088aa18cd271231a3c79dfff8f5efa8cda61@%3Cissues.zookeeper.apache.org%3E
lists.apache.org/thread.html/r37c0e1... WEB
https://lists.apache.org/thread.html/r37c0e1807da7ff2bdd028bbe296465a6bbb99e2320dbe661d5d8b33b@%3Cissues.zookeeper.apache.org%3E
Json Source Repository REPOSITORY
https://github.com/rubysec/ruby-advisory-db/blob/master/gems/json/CVE-2020-10663.yml
Json Source Repository REPOSITORY
https://github.com/flori/json/blob/master/CHANGES.md#2019-12-11-230
Json Source Repository REPOSITORY
https://github.com/flori/json
Json Security Information SECURITY
http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00004.html
seclists.org/fulldisclosure/2020... WEB
http://seclists.org/fulldisclosure/2020/Dec/32

Frequently Asked Questions

What is CVE-2020-10663?
CVE-2020-10663 is a security vulnerability in Json involving Unsafe object creation in json RubyGem under CWE-20: Improper Input Validation.
Which Json versions are affected?
Affected versions include releases prior to 2.3.0 across affected packages: json.
What version fixes CVE-2020-10663?
Upgrading to 2.3.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is json affected?
Yes, json is affected in releases prior to 2.3.0. Upgrade your dependency to 2.3.0 or later.
What is the CVSS score of CVE-2020-10663?
CVE-2020-10663 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2020-10663?
CVE-2020-10663 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check RubyGems dependencies for CVE-2020-10663?
Run the dependency tree command: 'inspect dependencies for json'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jphg-qwrw-7w9g",
  "modified" : "2023-01-25T22:49:03Z",
  "published" : "2020-07-27T18:08:21Z",
  "aliases" : [ "CVE-2020-10663" ],
  "summary" : "Unsafe object creation in json RubyGem",
  "details" : "The JSON gem through 2.2.0 for Ruby, as used in Ruby 2.4 through 2.4.9, 2.5 through 2.5.7, and 2.6 through 2.6.5, has an Unsafe Object Creation Vulnerability. This is quite similar to CVE-2013-0269/GHSA-x457-cw4h-hq5f, but does not rely on poor garbage-collection behavior within Ruby. Specifically, use of JSON parsing methods can lead to creation of a malicious object within the interpreter, with adverse effects that are application-dependent.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "json"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-10663"
  }, {
    "type" : "WEB",
    "url" : "https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663"
  }, {
    "type" : "WEB",
    "url" : "https://www.debian.org/security/2020/dsa-4721"
  }, {
    "type" : "WEB",
    "url" : "https://support.apple.com/kb/HT211931"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20210129-0003"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/NK2PBXWMFRUD7U7Q7LHV4KYLYID77RI4"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/F4TNVTT66VPRMX5UZYSDGSVRXKKDDDU5"
  }, {
    "type" : "WEB",
    "url" : "https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/7QL6MJD2BO4IRJ5CJFNMCDYMQQFT24BJ"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2020/04/msg00030.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ree3abcd33c06ee95ab59faa1751198a1186d8941ddc2c2562c12966c@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rec8bb4d637b04575da41cfae49118e108e95d43bfac39b7b698ee4db@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rd9b9cc843f5cf5b532bdad9e87a817967efcf52b917e8c43b6df4cc7@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rb2b981912446a74e14fe6076c4b7c7d8502727ea0718e6a65a9b1be5@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rb023d54a46da1ac0d8969097f5fecc79636b07d3b80db7b818a5c55c@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r8d2e174230f6d26e16c007546e804c343f1f68956f526daaafa4aaae@%3Cdev.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r5f17bfca1d6e7f4b33ae978725b2fd62a9f1b3111696eafa9add802d@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r3b04f4e99a19613f88ae088aa18cd271231a3c79dfff8f5efa8cda61@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/r37c0e1807da7ff2bdd028bbe296465a6bbb99e2320dbe661d5d8b33b@%3Cissues.zookeeper.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/json/CVE-2020-10663.yml"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/flori/json/blob/master/CHANGES.md#2019-12-11-230"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/flori/json"
  }, {
    "type" : "WEB",
    "url" : "http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00004.html"
  }, {
    "type" : "WEB",
    "url" : "http://seclists.org/fulldisclosure/2020/Dec/32"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-07-27T18:07:46Z",
    "nvd_published_at" : "2020-04-28T21:15:00Z"
  }
}