Back

HIGH

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

Published Jun 30, 2026

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.

Affected products

Remediation

Red Hat statement

Red Hat's only product shipping the Oj Ruby gem (Compliance Backend) already includes version 3.17.3, which contains the fix for this vulnerability. No Red Hat products are affected.

Red Hat mitigation

Upgrade the oj Ruby gem to version 3.17.2 or later.

Metrics

References (6)

Change history (0)

No recorded changes yet.

Sources
CVE.org / MITRE
Status PUBLISHED
Assigner GitHub_M
Published Jun 30, 2026
Updated Jul 1, 2026
Reserved Jun 16, 2026
CISA Vulnrichment
Updated Jul 1, 2026
NVD
Status Deferred
Modified Jul 1, 2026
Red Hat
Severity Moderate
Public date Jun 30, 2026
GHSA-2CW7-V8FF-P88R