Impact
Ruby JSON’s ResumableParser contains a use‑after‑free bug that is triggered when an incomplete JSON stream containing duplicate keys is parsed with partial_value. The bug causes the parser to dereference stale pointers that point to freed memory, resulting in a heap‑use‑after‑free and the Ruby process terminating. The primary consequence is a denial of service by crashing the application.
Affected Systems
Versions of the Ruby JSON library from 2.20.0 up to and including 2.21.2 are affected. The vulnerability exists in the ruby:json package, which is typically bundled with Ruby interpreters that use the native C extension for JSON parsing. Upgrading to version 2.21.2 or later eliminates the flaw.
Risk and Exploitability
The CVSS score of 8.7 marks this as High severity. EPSS is not available, so the exploitation probability is unknown, and the vulnerability is not listed in CISA KEV. An attacker must be able to supply a JSON stream to an application that uses JSON::ResumableParser. The likely attack vector is if the application accepts external JSON input (for example, via web requests) and calls partial_value on incomplete data that contains duplicate keys. The vulnerability only triggers a process crash; no remote code execution is reported.
OpenCVE Enrichment
Github GHSA