CVE-2026-71847: CWE-416: Use After Free in ruby json
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.
AI Analysis
Technical Summary
Ruby JSON versions 2.20.0 through 2.21.1 contain a use-after-free vulnerability in the native C extension's JSON::ResumableParser. When parsing incomplete JSON objects with duplicate keys, the parser clears the input buffer but leaves internal pointers referencing freed memory. The duplicate-key warning path calls a function that dereferences these stale pointers, causing a heap-use-after-free condition that can crash the Ruby process. This issue is exploitable by supplying crafted JSON stream data to applications using JSON::ResumableParser. The vulnerability was fixed in version 2.21.2.
Potential Impact
An attacker able to supply JSON stream data to an application using JSON::ResumableParser can cause a heap-use-after-free leading to process termination (crash). This results in a denial of service condition. There is no indication of code execution or data corruption beyond process termination.
Mitigation Recommendations
Upgrade Ruby JSON to version 2.21.2 or later, where this vulnerability is fixed. No other mitigation or workaround is indicated.
CVE-2026-71847: CWE-416: Use After Free in ruby json
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.
CVSS v4.0
Score 8.7high
Affected software
ruby
json
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Ruby JSON versions 2.20.0 through 2.21.1 contain a use-after-free vulnerability in the native C extension's JSON::ResumableParser. When parsing incomplete JSON objects with duplicate keys, the parser clears the input buffer but leaves internal pointers referencing freed memory. The duplicate-key warning path calls a function that dereferences these stale pointers, causing a heap-use-after-free condition that can crash the Ruby process. This issue is exploitable by supplying crafted JSON stream data to applications using JSON::ResumableParser. The vulnerability was fixed in version 2.21.2.
Potential Impact
An attacker able to supply JSON stream data to an application using JSON::ResumableParser can cause a heap-use-after-free leading to process termination (crash). This results in a denial of service condition. There is no indication of code execution or data corruption beyond process termination.
Mitigation Recommendations
Upgrade Ruby JSON to version 2.21.2 or later, where this vulnerability is fixed. No other mitigation or workaround is indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-08-07T18:26:53.523Z
- Cvss Version
- 4.0
- State
- PUBLISHED
Threat ID: 6a762a7bbf8831d539f90bf6
Added to database: 08/07/2026, 18:56:59 UTC
Last enriched: 08/07/2026, 19:11:05 UTC
Last updated: 09/21/2026, 22:01:37 UTC
Views: 61
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.