CVE-2026-71847 Ruby JSON: JSON::ResumableParser#partial_value dereferences a freed input buffer and crashes on truncated duplicate-key streams

High 8.7 Published Updated

An attacker can cause a denial of service by sending truncated JSON with duplicate keys to applications using Ruby's JSON::ResumableParser, triggering a use-after-free crash.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-71847?

CVE-2026-71847 is a high-severity use after free vulnerability in ruby json, published on 7 Aug 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

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.

Weakness: CWE-416

Which versions are affected by CVE-2026-71847?

2 open source packages ship an affected version, including json.

PackageAffectedFixed in
json RubyGemsFrom 2.20.02.21.2
json RubyGemsFrom 2.20.02.21.2

How do I fix CVE-2026-71847?

Upgrade json to 2.21.2 or later.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2026-71847 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-71847 exists.

Sources

Also known as DEBIAN-CVE-2026-71847, GHSA-9hj4-r449-hfvc, MINI-365r-85rp-h8vm, MINI-4mr4-8cv6-hc38, MINI-52mq-jrxr-7mxf, MINI-6w98-g8h8-q8pw and 7 more.

Is CVE-2026-71847 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free