CVE-2026-54592 Oj: Stack Buffer Overflow in Oj::Doc#each_child via Deeply Nested Input

High 7.5 Published Updated

A stack buffer overflow in the Oj Ruby gem allows attackers to cause a denial of service via deeply nested JSON input.

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-54592?

CVE-2026-54592 is a high-severity memory corruption 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. In versions prior to 3.17.3, Oj::Doc#each_child, when invoked recursively over a deeply nested JSON document, overflows a fixed-size stack buffer and aborts the process, leading to DoS. In a two-step chain in ext/oj/fast.c, doc_each_child increments doc->where past the where_path[MAX_STACK = 100] array with no bounds check and never restores it (the doc->where-- is missing), so calling each_child recursively from inside the yield block drives doc->where beyond the array. On the next entry the function copies the path into the 800-byte stack-local buffer save_path[MAX_STACK] using wlen = doc->where - doc->where_path, so when the previous recursive call left doc->where past where_path[100] the wlen exceeds MAX_STACK and the memcpy overflows save_path on the C stack; because the Oj::Doc parser imposes no JSON nesting-depth limit (relying on a C-stack pressure check), deeply nested attacker input reaches this path. This issue has been fixed in version 3.17.3.

Weakness: CWE-787, CWE-125

Which versions are affected by CVE-2026-54592?

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

PackageAffectedFixed in
oj RubyGemsAll versions3.17.3
oj RubyGemsAll versions3.17.3

How do I fix CVE-2026-54592?

Upgrade oj to 3.17.3 or later.

Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.

Is CVE-2026-54592 being exploited?

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

Sources

Also known as DEBIAN-CVE-2026-54592, GHSA-3m6q-jj5j-38c9, MINI-45mf-hr3r-4jqr, MINI-4jvm-38qx-qg9r, MINI-7vw4-xcwv-w6w3, MINI-cvr9-2qpm-8962 and 7 more.

Is CVE-2026-54592 in your software?

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

Check your SBOMs for free