Skip to main content

Ruby JSON CVE-2026-71847

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

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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X
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
qualitative

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
X

Lifecycle Timeline

4
Source Code Evidence Fetched
Aug 07, 2026 - 19:16 vuln.today
Analysis Generated
Aug 07, 2026 - 19:16 vuln.today
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.

AnalysisAI

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.

Technical ContextAI

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.

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.

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-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

CVE-2026-46727 HIGH POC
8.1 May 22

Use-after-free in Ruby 4.x (before 4.0.5) lets remote attackers who can manipulate DNS response timing crash application

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

Share

CVE-2026-71847 vulnerability details – vuln.today

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