Skip to main content

Ruby JSON EUVDEUVD-2026-54576

| CVE-2026-71847 HIGH
Use After Free (CWE-416)
2026-08-07 GitHub_M GHSA-9hj4-r449-hfvc
8.7
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Connect to Ruby service accepting streaming JSON
  2. Delivery
    Send truncated JSON object with duplicate keys
  3. Exploit
    ResumableParser exhausts and frees input buffer
  4. Install
    state.start/cursor/end pointers left pointing into freed memory
  5. C2
    partial_value shallow-copies stale parser state
  6. Execute
    cursor_position dereferences freed heap
  7. Impact
    SIGSEGV terminates Ruby process

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Memory lifecycle management
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Privilege Escalation

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires three concrete conditions: (1) the target Ruby application must use JSON::ResumableParser - the non-default streaming parser class - rather than the standard JSON.parse or JSON.load interfaces; (2) the application must call partial_value on input that is both attacker-controlled and incomplete (truncated mid-object); (3) the crafted input must contain at least one pair of duplicate object keys within the truncated structure to trigger the duplicate-key warning path that invokes cursor_position. Applications not using ResumableParser are categorically unaffected. Within affected applications, exploitation is unauthenticated and low-complexity once the attacker can supply input to the streaming endpoint, as crafting the trigger payload requires only a truncated JSON fragment with a repeated key, with no memory layout knowledge or race conditions required.

Impact

The CVSS 4.0 vector (AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N, score 8.7) correctly characterizes this as a network-reachable, low-complexity, unauthenticated availability threat with no confidentiality or integrity impact. However, real-world risk is meaningfully narrower than the score implies, because exploitation is gated on the application using JSON::ResumableParser - not the default JSON parsing API - and exposing that streaming interface to attacker-controlled input containing duplicate keys in truncated objects. The vast majority of Ruby applications use JSON.parse or JSON.load and are entirely unexposed. The vulnerability is not listed in CISA KEV, meaning active exploitation is not confirmed. No EPSS score was provided in the input data. A private PoC with end-to-end TCP reproduction was confirmed by a Ruby maintainer via HackerOne and GitHub Advisory, making exploitation technically plausible but not yet observed at scale. For affected deployments - Ruby services that stream external JSON via ResumableParser - this is a genuine denial-of-service priority, as crashing the process requires only a single crafted request.

Exploit ScenarioDerived

An attacker connects to a Ruby web service or daemon that accepts streaming JSON input and internally uses JSON::ResumableParser, then sends a TCP stream containing a truncated JSON object with duplicate keys - for example, '{"a":1,"a":' - causing the parser to exhaust and free its input buffer. When the application calls partial_value to reconstruct the incomplete object, the cursor_position function dereferences the now-freed state pointers, producing a SIGSEGV that immediately terminates the Ruby process. This attack pattern was demonstrated in an end-to-end loopback TCP reproduction included in the private advisory submission.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Aug 07, 2026

Heap-use-after-free in the Ruby json gem's native C extension (versions 2.20.0 through 2.21.1) allows an unauthenticated remote attacker to crash the Ruby process by supplying a crafted truncated JSON stream with duplicate object keys to any application using JSON::ResumableParser. The root cause is that the parser's input buffer is freed without resetting the state.start, state.cursor, and state.end pointers, which are subsequently dereferenced when partial_value processes the duplicate-key warning path via cursor_position, producing a heap-use-after-free confirmed by AddressSanitizer and a native SIGSEGV on official RubyGem releases. Impact is limited to availability - no code execution or information disclosure is claimed - and no public exploit code has been identified at time of analysis, though a private end-to-end TCP proof-of-concept was submitted with the advisory.

RemediationAI

Upgrade the Ruby json gem to version 2.21.2 or later, which resolves this heap-use-after-free (vendor advisory: https://github.com/ruby/json/security/advisories/GHSA-9hj4-r449-hfvc). Run 'gem update json' or update the Gemfile to require 'json', '>= 2.21.2' and regenerate Gemfile.lock. If an immediate upgrade is not feasible, the most targeted compensating control is to audit and remove usage of JSON::ResumableParser#partial_value on untrusted input; applications that use only JSON.parse or JSON.load are not vulnerable and require no change. Where ResumableParser is functionally required, restrict the network endpoints accepting streaming JSON to authenticated and trusted sources, which raises the bar for exploitation without eliminating the vulnerability. Pre-filtering input to reject objects with duplicate keys before invoking partial_value is theoretically possible but introduces parsing complexity and should not be treated as a reliable substitute for patching.

Affected VersionsENISA

json 2.20.0, < 2.21.2

Affected Packages

rubygems json fix: 2.21.2

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in rubygems

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The Ruby json gem ships a native C extension (ext/json/ext/parser/parser.c) that provides high-performance JSON parsing, including the JSON::ResumableParser class for streaming, stateful JSON consumption via the partial_value API. The CWE-416 (Use After Free) defect lives in the streaming lifecycle: when cResumableParser_parse exhausts the current input buffer, it calls json_str_clear() to release it and sets parser->buffer to Qfalse, but critically does not reset the three parser-state pointers - state.start, state.cursor, state.end - which still reference freed heap storage. When partial_value subsequently reconstructs an incomplete object that contains duplicate keys, the duplicate-key warning code path invokes cursor_position(), which walks those stale pointers into released memory. The affected CPE is cpe:2.3:a:ruby:json:*:*:*:*:*:*:*:*, covering versions 2.20.0 through 2.21.1. Notably, this flaw is confined to the ResumableParser streaming API; the standard JSON.parse and JSON.load interfaces do not exercise the vulnerable code path.

Know when Ruby gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (GitHub_M) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.5 HIGH

Network-reachable unauthenticated DoS via crafted input; scope unchanged; purely availability impact (process crash), no confidentiality or integrity effect.

3.1 AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Red Hat 5.9 MEDIUM

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
None
Vulnerable system: Integrity
None
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

2
Patch available
Aug 07, 2026 - 19:02 EUVD
CVE Published
Aug 07, 2026 - 18:31 cve.org
HIGH 8.7

DescriptionCVE.org

Ruby JSON is a JSON implementation for Ruby. From 2.20.0 until 2.21.2, Ruby's JSON native C extension clears the consumed JSON::ResumableParser input buffer but leaves state.start, state.cursor, and state.end pointing into released storage. When partial_value reconstructs an incomplete object containing duplicate keys, the duplicate-key warning path calls cursor_position, which dereferences those stale pointers. This results in a heap-use-after-free and can terminate the Ruby process. An attacker who can supply JSON stream data to an application using JSON::ResumableParser may cause process termination when the application calls partial_value on incomplete attacker-controlled input containing duplicate object keys. This issue has been fixed in version 2.21.2.

Executive ViewAI

Why It Matters

The Ruby json gem (versions 2.20.0-2.21.1) contains a heap-use-after-free vulnerability that causes remote denial of service when processing crafted malformed JSON. Any Ruby application accepting JSON input is vulnerable to process crashes. This risk threatens service availability and could disrupt customer-facing operations.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.3%
Top 83% exploitable
Prevalence
High
json gem bundled with Ruby stdlib, present in most Ruby deployments
Threat Intel
1
1 sources
Exploit
POC
Public exploit code exists
Data Quality
8 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Out-of-Cycle
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
High
Technical Impact
Partial

Priority Score

64
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Use-after-free vulnerabilities occur when a program continues to access memory through a pointer after that memory has been deallocated.

Memory corruption occurs when a program writes data beyond the boundaries of allocated memory regions or accesses memory in unintended ways, violating the integrity of the process's address space.

Information disclosure occurs when an application unintentionally exposes sensitive data that aids attackers in reconnaissance or directly compromises security.

More in Ruby

View all
CVE-2017-17405 HIGH POC
8.8 Dec 15

Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl

CVE-2017-17790 CRITICAL POC
9.8 Dec 20

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio

CVE-2017-14064 CRITICAL POC
9.8 Aug 31

Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call

CVE-2016-2336 CRITICAL POC
9.8 Jan 06

Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi

CVE-2026-77602 CRITICAL POC
9.9 Sep 23

Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in

CVE-2026-44266 CRITICAL POC
9.8 Nov 03

Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub

CVE-2016-2337 CRITICAL POC
9.8 Jan 06

Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2016-2339 CRITICAL POC
9.8 Jan 06

An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub

CVE-2017-9225 CRITICAL POC
9.8 May 24

An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7

CVE-2026-27614 CRITICAL POC
9.3 Feb 25

Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th

CVE-2017-0898 CRITICAL POC
9.1 Sep 15

Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w

CVE-2013-4164 MEDIUM POC
6.8 Nov 23

Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise Desktop 15 SP7 Not-Affected
SUSE Linux Enterprise Desktop 15 SP7 Affected
SUSE Linux Enterprise High Availability Extension 15 SP7 Not-Affected
SUSE Linux Enterprise High Availability Extension 16.0 Not-Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy