# CVE-2026-54897: Oj : Use-After-Free in Oj::Doc Iterators via Reentrant Close

- Severity: Low 2.1 (CVSS:4.0, scored by GitHub_M) `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`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.20%, higher than 10% of CVEs (2026-12-01)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-19T19:36:50.000Z
- Modified: 2026-10-25T17:10:00.197Z
- Also known as: GHSA-9ppp-w3g4-fh4q
- Weaknesses: CWE-416
- SSVC (CISA-ADP): exploitation poc, automatable no, technical impact partial
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- ohler55 oj: < 3.17.2
- oj (RubyGems): before 3.17.3

## Every score

- GitHub_M: CVSS:4.0 2.1 Low `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`
- GitHub: CVSS:4.0 High `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`

## References

- <https://github.com/ohler55/oj/security/advisories/GHSA-9ppp-w3g4-fh4q> (exploit, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-54897> (advisory)
- <https://github.com/ohler55/oj> (package)
- <https://github.com/rubysec/ruby-advisory-db/blob/master/gems/oj/CVE-2026-54897.yml> (web)
- <https://www.cve.org/CVERecord/SearchResults?query=CVE-2026-54897> (web)

## Sources

- CVE List: [CVE-2026-54897](https://www.cve.org/CVERecord?id=CVE-2026-54897), CVE Terms of Use, modified 2026-07-01
- GitHub Advisory Database: [GHSA-9ppp-w3g4-fh4q](https://github.com/advisories/GHSA-9ppp-w3g4-fh4q), CC-BY-4.0, modified 2026-10-06
- NVD: [CVE-2026-54897](https://nvd.nist.gov/vuln/detail/CVE-2026-54897), Public domain, modified 2026-10-25

---

Page: https://cve.day/CVE-2026-54897 · Whole record: https://cve.day/CVE-2026-54897.json · Rebuilt by cve.day 2026-11-25T22:59:26.856Z
