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

Medium 6.3 Published Updated

A use-after-free vulnerability in the Oj Ruby gem allows attackers to cause crashes or execute code by toggling symbol keys on a reused parser instance.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-54899?

CVE-2026-54899 is a medium-severity use after free vulnerability in ohler55 oj, published on 30 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official 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.

Weakness: CWE-416

Which versions are affected by CVE-2026-54899?

2 open source packages ship an affected version, including oj.

PackageAffectedFixed in
oj RubyGemsAll versions3.17.2
oj RubyGemsAll versions3.17.2

How do I fix CVE-2026-54899?

Upgrade oj to 3.17.2 or later.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2026-54899 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54899 exists.

Sources

Also known as DEBIAN-CVE-2026-54899, GHSA-2cw7-v8ff-p88r, MINI-2pg7-5c55-2xfc, MINI-3976-3wf6-x2jj, MINI-53jm-38p8-cr98, MINI-695p-3hf6-jh82 and 7 more.

Is CVE-2026-54899 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free