What’s Vulnerable › Vulnerabilities
CVE-2026-54896: Oj: Heap Buffer Overflow in Oj.dump Exception Serialization via Large Indent
- Severity: low (CVSS 2.1 v4.0)
- Exploited in the wild: not listed in CISA KEV
- EPSS: 0.2% probability of exploitation in the next 30 days
- Public exploit or detection template: none known
- Published: 2026-07-01 · updated 2026-10-25
- Weakness: CWE-122
Description
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.
Affected products
- Rubygems Oj: before 3.17.3; 0.5, 0.5.1, 0.5.2, 0.6.0, 0.7.0, 0.8.0 (+288) — fixed in 3.17.3
- ohler55 oj: before 3.17.2
How to fix
Upgrade to a fixed version: Rubygems Oj 3.17.3. Check the vendor advisory for mitigations.
References
- https://github.com/ohler55/oj/security/advisories/GHSA-35w3-pjm6-wj95
- https://github.com/ohler55/oj/security/advisories/GHSA-35w3-pjm6-wj95
Get alerted when CVE-2026-54896 or the next vulnerability affects your stack