{"id":"CVE-2026-54897","published":"2026-06-30T23:22:43Z","modified":"2026-07-01T12:43:02Z","title":"Oj : Use-After-Free in Oj::Doc Iterators via Reentrant Close","vendor":"ohler55","product":"oj","tier":"tail","description":{"text":"Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to 3.17.2, Oj::Doc iterators (each_value, each_child, each_leaf) were vulnerable to a heap use-after-free. When a Ruby block yielded during iteration calls doc.close or d.close, the document's heap memory is freed while the C iterator is still running. When control returns from the block, the iterator reads from the freed region, producing a use-after-free accessible from pure Ruby. This issue has been fixed in version 3.17.2.","provenance":"source","from":"CVE.org"},"cvss":{"score":2.1,"severity":"LOW","version":"4.0","vector":"CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N","provenance":"source","from":"CVE.org CNA"},"epss":{"score":0.00203,"percentile":0.10502,"provenance":"source"},"cwes":[{"id":"CWE-416","name":"Use After Free"}],"references":[{"url":"https://github.com/ohler55/oj/security/advisories/GHSA-9ppp-w3g4-fh4q","tags":["x_refsource_CONFIRM"]}],"priority":{"score":3.6,"factors":[{"name":"EPSS percentile","points":2.1},{"name":"CVSS severity","points":1.47}]},"vendorSlug":"ohler55","affectedVersions":[{"vendor":"ohler55","product":"oj","versions":["< 3.17.2"]}],"ssvc":{"exploitation":"poc","automatable":"no","technicalImpact":"partial","timestamp":"2026-07-01T12:42:39.442835Z","from":"CISA ADP","provenance":"source"},"affected":[{"ecosystem":"RubyGems","package":"oj","vulnerableRanges":["<3.17.3"],"patched":["3.17.3"],"from":["GHSA-9ppp-w3g4-fh4q"],"provenance":"source"}],"summary":{"text":"The flaw is a use-after-free in the Oj::Doc iterators (each_value, each_child, each_leaf) of the Oj (Optimized JSON) Ruby gem, where the document's heap memory is freed while the C iterator is still running. An attacker who can reach a Ruby block that calls close on the document during iteration can cause the iterator to read freed memory after the block returns; the attack needs no authentication or privileges and the code path is reachable from pure Ruby, with the flaw affecting Oj versions before 3.17.2.","provenance":"ai","model":"claude-haiku-5-5","generatedAt":"2026-11-20T22:23:45Z"},"euvd":{"id":"EUVD-2026-40853","exploited":false,"provenance":"source"}}