Impact
Oj is a Ruby gem that parses JSON. Prior to version 3.17.2, its iterators (each_value, each_child, each_leaf) contain a heap use-after-free. When a Ruby block yields during iteration calls doc.close or d.close, the document's heap memory is freed while the C iterator continues, causing a use-after-free that can be triggered from pure Ruby. This use-after-free aligns with CWE-416 and involves reentrant memory access (CWE-364).
Affected Systems
The affected product is the Oj Ruby gem, versions older than 3.17.2, developed by the vendor ohler55.
Risk and Exploitability
The CVSS score of 2.1 is low, and the EPSS score of less than 1% indicates a very low probability of exploitation. The flaw is not listed in CISA’s KEV catalog. Exploitation requires invoking doc.close or d.close during an iterating block, which is observable from Ruby code. No public exploits are documented in the provided references.
OpenCVE Enrichment
Github GHSA