Cloudanix VulnDB

CVE-2026-71847

None

CVSS

—

EPSS

0.4%

Published

Aug 7, 2026

CISA due date

—

Cloudanix analysis

Monitor only SSVC: Track

A flaw in how Ruby handles certain incoming data streams can let an attacker crash the program, stopping services that rely on it until restarted.

Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Library
Class
Use After Free
Remediation
Upgrade
Effort
Low
Patch risk
Low

What it actually does

Heap-use-after-free in the JSON::ResumableParser native extension caused by stale pointers (state.start, state.cursor, state.end) after buffer clearance; dereference occurs in cursor_position during duplicate-key warning handling on incomplete objects.

Why it matters to the business

Attackers can remotely terminate Ruby processes that parse attacker-controlled JSON streams containing duplicate object keys, resulting in denial of service and potential service disruption for applications relying on resumable JSON parsing.

How an attack unfolds

An attacker supplies a partial JSON stream containing an incomplete object with duplicate keys to an application using JSON::ResumableParser; when the application later invokes partial_value, the duplicate-key path calls cursor_position which dereferences the freed pointers, triggering the use-after-free crash.

How to fix it

Upgrade the ruby-json gem to version 2.21.2 or later; rebuild and restart all affected Ruby applications; verify no custom builds retain the vulnerable 2.20.0-2.21.1 range.

How to confirm the fix worked

Confirm the installed ruby-json version is 2.21.2 or newer via gem list or bundle; run the upstream test suite exercising ResumableParser with duplicate-key partial input; monitor process stability under malformed stream loads.

Typical attack path

  1. Identify an application endpoint or API accepting JSON stream input via JSON::ResumableParser
  2. Craft and send partial JSON containing an object with duplicate keys
  3. Trigger partial_value reconstruction on the incomplete input
  4. Cause the duplicate-key warning path to dereference stale pointers and crash the process

How to detect it

Review application and system logs for abrupt Ruby interpreter crashes or segmentation faults during JSON parsing; correlate with inbound streams containing duplicate object keys; inspect core dumps or heap traces for use-after-free patterns in the json gem native extension.

What your security team should do

  • Immediately upgrade all deployments using ruby-json 2.20.0 through 2.21.1 to 2.21.2
  • Inventory Ruby applications that accept untrusted JSON streams and prioritize patching by exposure
  • Add runtime monitoring for unexpected Ruby process terminations during JSON parsing

The record

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.

Affected packages

Ecosystem Package Introduced Fixed

Related vulnerabilities