<Vulnerability name="CVE-2026-54896">
    <DocumentDistribution xml:lang="en">Copyright © 2012 Red Hat, Inc. All rights reserved.</DocumentDistribution>
    <ThreatSeverity>Important</ThreatSeverity>
    <PublicDate>2026-06-30T23:20:27</PublicDate>
    <Bugzilla id="2495716" url="https://bugzilla.redhat.com/show_bug.cgi?id=2495716" xml:lang="en:us">
oj: Oj: Heap buffer overflow in exception serialization
    </Bugzilla>
    <CVSS3 status="draft">
        <CVSS3BaseScore>7.8</CVSS3BaseScore>
        <CVSS3ScoringVector>CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H</CVSS3ScoringVector>
    </CVSS3>
    <CWE>CWE-787</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.2, when in object mode, Oj.dump is vulnerable to a heap buffer overflow when serializing Exception objects with a large :indent value. The serializer allocates a buffer sized for the object's attributes but does not account for the indent bytes added on each write. With indent: 5000, the accumulation of 5,000-byte indent strings overflows the 13,150-byte heap allocation, corrupting adjacent heap memory. This issue has been fixed in version 3.17.2.
    </Details>
    <Details xml:lang="en:us" source="Red Hat">
A flaw was found in Oj (Optimized JSON), a Ruby gem used for processing JSON data. This vulnerability occurs when the software attempts to serialize (convert into a format for storage or transmission) Exception objects with a very large indentation setting. The internal process for handling this serialization does not properly manage memory, leading to a heap buffer overflow. This memory corruption could allow an attacker to disrupt the application, causing a denial of service, or potentially execute unauthorized code.
    </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-54896
https://nvd.nist.gov/vuln/detail/CVE-2026-54896
https://github.com/ohler55/oj/security/advisories/GHSA-35w3-pjm6-wj95
    </References>
</Vulnerability>