Skip to main content
EPSS 0.4%top 68%

CVE-2026-71847: CWE-416: Use After Free in ruby json

0
High
Published: 08/07/2026 (08/07/2026, 18:31:28 UTC)
Source: CVE Database V5
Vendor/Project: ruby
Product: 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

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vuln. Confidentiality
None
Vuln. Integrity
None
Vuln. Availability
High
Subsq. Confidentiality
None
Subsq. Integrity
None
Subsq. Availability
None
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

Affected software

ruby

json

Affected versions
>=2.20.0 <2.21.2

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 08/07/2026, 19:11:05 UTC

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.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

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 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

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

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses