# CVE-2026-54902: Oj: Use-After-Free in Oj::Parser SAJ Long Key Callback

- Severity: Medium 6.3 (CVSS:4.0, scored by GitHub_M) `CVSS:4.0/AV:N/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.50%, higher than 44% of CVEs (2026-12-02)
- Public exploit code or proof of concept: one link below, marked "exploit"
- Published: 2026-06-19T20:47:28.000Z
- Modified: 2026-10-25T17:10:00.197Z
- Also known as: GHSA-m578-w5vf-rfcm
- 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 version 3.17.2, is vulnerable to Use-After-Free when in SAJ mode. The Oj::Parser does not protect cached object keys (≥ 35 bytes) from garbage collection, and a Ruby callback that triggers GC inside hash_end can cause the key string to be reclaimed while the C parser still holds a pointer to it. The subsequent access to the freed string VALUE results in a segfault, confirmed by an RIP pointing to address 0x4242 (a canary-style pattern suggesting control over the freed memory's content). 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 6.3 Medium `CVSS:4.0/AV:N/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-m578-w5vf-rfcm> (exploit, web)
- <https://github.com/ohler55/oj> (package)

## Sources

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

---

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