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

Medium 6.3 Published Updated

An integer overflow in the Oj Ruby gem allows attackers to cause heap corruption and potential code execution by parsing JSON strings larger than 2GB.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2026-54903?

CVE-2026-54903 is a medium-severity vulnerability in ohler55 oj, published on 30 Jun 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

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

Weakness: CWE-190

Which versions are affected by CVE-2026-54903?

2 open source packages ship an affected version, including oj.

PackageAffectedFixed in
oj RubyGemsAll versions3.17.3
oj RubyGemsAll versions3.17.3

How do I fix CVE-2026-54903?

Upgrade oj to 3.17.3 or later.

Is CVE-2026-54903 being exploited?

It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54903 exists.

Sources

Also known as DEBIAN-CVE-2026-54903, GHSA-475m-ph3x-64gp, MINI-3r5f-hmpv-fv9p, MINI-3vmv-3pvq-r2xp, MINI-5w8g-63hf-r5c9, MINI-76xg-qm5p-56pr and 7 more.

Is CVE-2026-54903 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free