CVE-2026-54902

Oj: Use-After-Free in Oj::Parser SAJ Long Key Callback

MEDIUM
6.3
CVSS Score
Published: June 30, 2026 at 11:40 PM UTC
Updated: October 25, 2026 at 05:10 PM UTC
1 product affected across 1 vendorOj

Using oj by ohler55?

Get instant alerts when new vulnerabilities affect oj - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM6.3
Exploit prediction
EPSS 0.5%
SSVC
PoC

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 3.17.2
Affected range stops below 3.17.2, so it looks safe — our inference, not a vendor statement

Remediation

No guide yet

No remediation guidance has been written for this CVE yet, and no fixed version or vendor advisory is recorded against it.

References (1)

SSVC — Action Prioritization

SSVCPoCNot automatablePartial impact

SSVC signals action urgency (what to patch first), separate from CVSS which measures severity.

CVSS

6.3MEDIUMGitHub_M
Vector?

Quick Info

StatusDEFERRED
CWE
CWE-416

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card