CVE-2026-54898

Oj: Use-After-Free in Oj::Parser SAJ Callback via Input Mutation

LOW
2.1
CVSS Score
Published: June 30, 2026 at 11:24 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
LOW2.1
Exploit prediction
EPSS 0.2%
SSVC
PoC

Description

Oj (Optimized JSON) is a JSON parser and Object marshaller packaged as a Ruby gem. In versions prior to 3.17.2,Oj::Parser#parse is vulnerable to a heap use-after-free when a SAJ/SAJ2 callback mutates the input JSON string during parsing. The C engine holds a raw const byte * pointer into the Ruby string's internal buffer. If a callback (e.g. hash_start) resizes the string — for example by calling String#replace with a longer value — Ruby reallocates the string buffer and frees the old one. The C parser's pointer is left dangling; the next character read at parser.c:607 is a use-after-free. 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

2.1LOWGitHub_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