CVE-2026-54900 Oj: Negative-Size memcpy in Oj::Parser create_id Attribute Handling
An attacker can cause a denial of service via heap corruption in the Oj Ruby gem when parsing JSON with create_id enabled and long keys.
- 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-54900?
CVE-2026-54900 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, when in usual mode with create_id enabled, Oj::Parser#parse is vulnerable to heap corruption via a negative-size memcpy. When a JSON object key is exactly 65,535 bytes long, an integer truncation in form_attr (usual.c:63) converts the length to -1 before passing it to memcpy. This causes memcpy to copy SIZE_MAX bytes (interpreted as a huge size_t), corrupting heap memory and crashing the process. The issue has been fixed in version 3.17.2.
Which versions are affected by CVE-2026-54900?
2 open source packages ship an affected version, including oj.
| Package | Affected | Fixed in |
|---|---|---|
oj RubyGems | All versions | 3.17.3 |
oj RubyGems | All versions | 3.17.3 |
How do I fix CVE-2026-54900?
Upgrade oj to 3.17.3 or later.
Is CVE-2026-54900 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2026-54900 exists.
Public exploit code: 1 proofs of concept on GitHub.
Sources
Also known as DEBIAN-CVE-2026-54900, GHSA-9cv6-qcjw-4grx, MINI-384c-qxp5-2xcc, MINI-3f8r-g9gw-4vgc, MINI-5jfc-wp5r-9rh8, MINI-9pwc-4494-p948 and 7 more.