<Vulnerability name="CVE-2026-54592">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Important</ThreatSeverity>
    <PublicDate>2026-06-30T23:16:24</PublicDate>
    <Bugzilla id="2495750" url="https://bugzilla.redhat.com/show_bug.cgi?id=2495750" xml:lang="en:us">
oj: Oj: Denial of Service via deeply nested JSON input
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>7.5</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-120</CWE>
    <Details xml:lang="en:us" source="Mitre">
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-&gt;where past the where_path[MAX_STACK = 100] array with no bounds check and never restores it (the doc-&gt;where-- is missing), so calling each_child recursively from inside the yield block drives doc-&gt;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-&gt;where - doc-&gt;where_path, so when the previous recursive call left doc-&gt;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.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in Oj, a Ruby gem for JSON parsing. A remote attacker can exploit this vulnerability by providing a deeply nested JSON document. This can lead to a stack buffer overflow in the `Oj::Doc#each_child` function, causing the process to abort and resulting in a denial of service (DoS) for the affected system.
    </Details>
    <Statement xml:lang="en:us">
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.
    </Statement>
    <References xml:lang="en:us">
https://www.cve.org/CVERecord?id=CVE-2026-54592
https://nvd.nist.gov/vuln/detail/CVE-2026-54592
https://github.com/ohler55/oj/security/advisories/GHSA-3m6q-jj5j-38c9
    </References>
</Vulnerability>