CVE-2026-71847: Ruby JSON heap-use-after-free in ResumableParser

CVE-2026-71847 · Severity: low · CVSS 5.3 · Published 2026-08-07

The Ruby JSON gem contains a flaw in its streaming data parser, which is used by applications to process large or ongoing data feeds. An attacker can send a specially crafted, incomplete JSON stream containing duplicate keys to cause the application to crash. This results in a denial-of-service, potentially taking down web services or background workers that process JSON data.

Technologies: json (RubyGems). Vendors: RubyGems.

Quick answers

Is CVE-2026-71847 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-71847 being exploited in the wild.
How severe is CVE-2026-71847?
Low severity, with a CVSS score of 5.3, published 7 August 2026.
Which products and versions are affected?
json (RubyGems) ECOSYSTEM:introduced=2.20.0,fixed=2.21.2.
Is there a fix for CVE-2026-71847?
Yes. json (RubyGems): upgrade to 2.21.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-71847 attacked?
It is attacked over the network, in a software library.
Am I affected by CVE-2026-71847?
Check whether you run json (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • json (RubyGems): upgrade to 2.21.2 or later
    bundle update json

Technical details

A heap-use-after-free (UAF) exists in the native C extension of the Ruby JSON gem within the `JSON::ResumableParser` component. When the parser reaches the end of an input buffer, it clears the buffer but fails to invalidate the `state.start`, `state.cursor`, and `state.end` pointers. If `partial_value` is subsequently called on an incomplete object containing duplicate keys, the duplicate-key warning logic invokes `cursor_position`, which dereferences these stale pointers. An unauthenticated remote attacker can exploit this by providing a truncated JSON stream with duplicate keys, leading to a `SIGSEGV` or AddressSanitizer-detected UAF, resulting in a denial of service. The issue is fixed in version 2.21.2.

Affected products

  • RubyGems json >= 2.20.0, <= 2.21.1

Identifiers

  • CVE-2026-71847
  • GHSA-9hj4-r449-hfvc

Timeline

  • 2026-07-31: disclosed
  • 2026-08-07: advisory
  • 2026-08-07: patched: Fixed in version 2.21.2

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.