CVE-2020-10663
📋 TL;DR
This vulnerability in the JSON gem for Ruby allows attackers to create malicious objects during JSON parsing, potentially leading to arbitrary code execution or denial of service. It affects Ruby applications using JSON gem versions through 2.2.0, particularly those running Ruby 2.4 through 2.6.5. The impact depends on how the application processes untrusted JSON input.
💻 Affected Systems
- Ruby JSON gem
- Ruby interpreter
📦 What is this software?
Fedora by Fedoraproject
Fedora by Fedoraproject
Json by Json Project
Leap by Opensuse
Macos by Apple
macOS is Apple's desktop and laptop operating system powering Mac computers used by millions of professionals, developers, creative professionals, and enterprise users worldwide. Built on a Unix foundation with the Darwin kernel and modern Cocoa frameworks, macOS delivers a seamless ecosystem integr...
Learn more about Macos →⚠️ Risk & Real-World Impact
Worst Case
Remote code execution leading to complete system compromise, data theft, or ransomware deployment.
Likely Case
Denial of service through application crashes or resource exhaustion, potentially leading to data corruption.
If Mitigated
Limited impact if input validation and sanitization prevent malicious JSON from reaching vulnerable parsers.
🎯 Exploit Status
Exploitation requires sending malicious JSON to vulnerable endpoints. The vulnerability is well-documented and similar to previous JSON parsing issues.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: JSON gem ≥ 2.3.0, Ruby ≥ 2.4.10, ≥ 2.5.8, ≥ 2.6.6
Vendor Advisory: https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/
Restart Required: Yes
Instructions:
1. Update Ruby to version 2.4.10, 2.5.8, 2.6.6 or later. 2. Update JSON gem to version 2.3.0 or later using 'gem update json'. 3. Restart all Ruby applications and services.
🔧 Temporary Workarounds
Input Validation and Sanitization
allImplement strict input validation to reject or sanitize untrusted JSON before parsing.
Use Safe Parsing Methods
allUse JSON.parse with the 'create_additions' option set to false to disable object creation during parsing.
JSON.parse(json_string, create_additions: false)
🧯 If You Can't Patch
- Implement network segmentation to isolate vulnerable systems from untrusted networks.
- Deploy web application firewalls (WAF) with JSON parsing protection rules.
🔍 How to Verify
Check if Vulnerable:
Check Ruby version with 'ruby -v' and JSON gem version with 'gem list json'.
Check Version:
ruby -v && gem list json
Verify Fix Applied:
Verify Ruby version is ≥ 2.4.10, ≥ 2.5.8, or ≥ 2.6.6, and JSON gem is ≥ 2.3.0.
📡 Detection & Monitoring
Log Indicators:
- Unexpected application crashes
- Memory usage spikes during JSON parsing
- Unusual error messages from JSON parser
Network Indicators:
- Large or malformed JSON payloads to Ruby application endpoints
- Repeated JSON parsing requests causing performance degradation
SIEM Query:
source="application.log" AND ("JSON::ParserError" OR "unexpected token" OR "memory allocation")
🔗 References
- http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00004.html
- http://seclists.org/fulldisclosure/2020/Dec/32
- https://lists.apache.org/thread.html/r37c0e1807da7ff2bdd028bbe296465a6bbb99e2320dbe661d5d8b33b%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/r3b04f4e99a19613f88ae088aa18cd271231a3c79dfff8f5efa8cda61%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/r5f17bfca1d6e7f4b33ae978725b2fd62a9f1b3111696eafa9add802d%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/r8d2e174230f6d26e16c007546e804c343f1f68956f526daaafa4aaae%40%3Cdev.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rb023d54a46da1ac0d8969097f5fecc79636b07d3b80db7b818a5c55c%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rb2b981912446a74e14fe6076c4b7c7d8502727ea0718e6a65a9b1be5%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rd9b9cc843f5cf5b532bdad9e87a817967efcf52b917e8c43b6df4cc7%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rec8bb4d637b04575da41cfae49118e108e95d43bfac39b7b698ee4db%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/ree3abcd33c06ee95ab59faa1751198a1186d8941ddc2c2562c12966c%40%3Cissues.zookeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2020/04/msg00030.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7QL6MJD2BO4IRJ5CJFNMCDYMQQFT24BJ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/F4TNVTT66VPRMX5UZYSDGSVRXKKDDDU5/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NK2PBXWMFRUD7U7Q7LHV4KYLYID77RI4/
- https://security.netapp.com/advisory/ntap-20210129-0003/
- https://support.apple.com/kb/HT211931
- https://www.debian.org/security/2020/dsa-4721
- https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/
- http://lists.opensuse.org/opensuse-security-announce/2020-05/msg00004.html
- http://seclists.org/fulldisclosure/2020/Dec/32
- https://lists.apache.org/thread.html/r37c0e1807da7ff2bdd028bbe296465a6bbb99e2320dbe661d5d8b33b%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/r3b04f4e99a19613f88ae088aa18cd271231a3c79dfff8f5efa8cda61%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/r5f17bfca1d6e7f4b33ae978725b2fd62a9f1b3111696eafa9add802d%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/r8d2e174230f6d26e16c007546e804c343f1f68956f526daaafa4aaae%40%3Cdev.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rb023d54a46da1ac0d8969097f5fecc79636b07d3b80db7b818a5c55c%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rb2b981912446a74e14fe6076c4b7c7d8502727ea0718e6a65a9b1be5%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rd9b9cc843f5cf5b532bdad9e87a817967efcf52b917e8c43b6df4cc7%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/rec8bb4d637b04575da41cfae49118e108e95d43bfac39b7b698ee4db%40%3Cissues.zookeeper.apache.org%3E
- https://lists.apache.org/thread.html/ree3abcd33c06ee95ab59faa1751198a1186d8941ddc2c2562c12966c%40%3Cissues.zookeeper.apache.org%3E
- https://lists.debian.org/debian-lts-announce/2020/04/msg00030.html
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/7QL6MJD2BO4IRJ5CJFNMCDYMQQFT24BJ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/F4TNVTT66VPRMX5UZYSDGSVRXKKDDDU5/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/NK2PBXWMFRUD7U7Q7LHV4KYLYID77RI4/
- https://security.netapp.com/advisory/ntap-20210129-0003/
- https://support.apple.com/kb/HT211931
- https://www.debian.org/security/2020/dsa-4721
- https://www.ruby-lang.org/en/news/2020/03/19/json-dos-cve-2020-10663/