Ruby JSON ResumableParser Use-After-Free Enables Denial of Service
Vulnerability Disclosure · 2 sources · Updated 4mo ago · First seen Aug 7, 2026

A high-severity denial-of-service flaw tracked as CVE-2026-71847 was disclosed in the Ruby json package, affecting versions 2.20.0 through before 2.21.2. The bug resides in the native C extension behind JSON::ResumableParser, where truncated streaming JSON containing duplicate object keys can cause the parser to clear its input buffer while leaving stale internal pointers behind, creating a heap-use-after-free condition classified as CWE-416.
If an application accepts attacker-controlled JSON streams and later calls partial_value on the incomplete input, the parser can perform pointer operations on freed memory in its warning-handling path and crash the Ruby worker process. The issue impacts availability rather than confidentiality or integrity, and the fix in json 2.21.2 clears the freed buffer, nullifies parser state pointers, and adjusts warning generation logic to avoid cursor calculations when parser state is still present.
Why it matters
Impact assessment
This vulnerability affects Ruby applications that use the json gem's JSON::ResumableParser to process attacker-controlled streaming JSON. The primary impact is application availability: successful exploitation can crash a Ruby worker process, causing denial of service without evidence of confidentiality or integrity loss.
The exposure is likely narrower than a general Ruby ecosystem issue because exploitation requires a specific parser class, incomplete streamed input, duplicate object keys, and an application call to partial_value. No in-the-wild exploitation is reported in the provided references, but the attack is remotely reachable with low complexity where these conditions exist.
Affected populations
- Organizations running Ruby applications that ingest untrusted streaming JSON
- Services using the json gem native C extension
- Applications explicitly using JSON::ResumableParser and partial_value on incomplete input
Severity and business effect
- Availability impact is high; worker process termination can disrupt API, background job, or stream-processing services
- No stated confidentiality impact
- No stated integrity impact
- Potential operational and reputational impact if exposed internet-facing services can be repeatedly crashed
Scope and exploitation status
- Affected product: Ruby json package
- Affected versions: 2.20.0 through before 2.21.2
- Scope is targeted to a specific feature path rather than all JSON parsing
- No known exploitation in the wild stated in the references


