CVE-2026-54896: CWE-122: Heap-based Buffer Overflow in ohler55 oj
Oj (Optimized JSON) is a Ruby gem for JSON parsing and object marshalling. Versions prior to 3.17.2 have a heap-based buffer overflow vulnerability in Oj.dump when serializing Exception objects with a large indent value in object mode. The overflow occurs because the serializer does not account for the added indent bytes, leading to heap memory corruption. This issue is fixed in version 3.17.2.
AI Analysis
Technical Summary
CVE-2026-54896 describes a heap-based buffer overflow in the Oj Ruby gem (versions before 3.17.2). When using Oj.dump in object mode to serialize Exception objects with a large :indent value (e.g., 5000), the serializer allocates a buffer sized for the object's attributes but fails to account for the cumulative indent bytes added on each write. This results in overflowing the allocated heap buffer (e.g., 13,150 bytes), corrupting adjacent heap memory. The vulnerability is resolved in version 3.17.2.
Potential Impact
The vulnerability allows heap memory corruption during serialization of Exception objects with large indent values, which could potentially lead to application instability or crashes. The CVSS 4.0 score is low (2.1), indicating limited impact and complexity. There are no known exploits in the wild.
Mitigation Recommendations
Upgrade to Oj version 3.17.2 or later, where this heap-based buffer overflow vulnerability has been fixed. No other mitigation or temporary workaround is indicated.
CVE-2026-54896: CWE-122: Heap-based Buffer Overflow in ohler55 oj
Description
Oj (Optimized JSON) is a Ruby gem for JSON parsing and object marshalling. Versions prior to 3.17.2 have a heap-based buffer overflow vulnerability in Oj.dump when serializing Exception objects with a large indent value in object mode. The overflow occurs because the serializer does not account for the added indent bytes, leading to heap memory corruption. This issue is fixed in version 3.17.2.
CVSS v4.0
Score 2.1low
Affected software
Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2026-54896 describes a heap-based buffer overflow in the Oj Ruby gem (versions before 3.17.2). When using Oj.dump in object mode to serialize Exception objects with a large :indent value (e.g., 5000), the serializer allocates a buffer sized for the object's attributes but fails to account for the cumulative indent bytes added on each write. This results in overflowing the allocated heap buffer (e.g., 13,150 bytes), corrupting adjacent heap memory. The vulnerability is resolved in version 3.17.2.
Potential Impact
The vulnerability allows heap memory corruption during serialization of Exception objects with large indent values, which could potentially lead to application instability or crashes. The CVSS 4.0 score is low (2.1), indicating limited impact and complexity. There are no known exploits in the wild.
Mitigation Recommendations
Upgrade to Oj version 3.17.2 or later, where this heap-based buffer overflow vulnerability has been fixed. No other mitigation or temporary workaround is indicated.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-06-16T13:49:33.555Z
- Cvss Version
- 4.0
- State
- PUBLISHED
- Remediation Level
- null
- Gcve Source
- db.gcve.eu
Threat ID: 6a446e6e27e9c79719c50911
Added to database: 07/01/2026, 01:33:34 UTC
Last enriched: 07/01/2026, 01:37:17 UTC
Last updated: 07/01/2026, 01:51:15 UTC
Views: 3
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
External Links
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.