RubySec

Providing security resources for the Ruby community

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

Oj - Integer Overflow in Oj.load 2GB String Handling

Published: June 19, 2026

SECURITY IDENTIFIERS

GEM

oj

PATCHED VERSIONS

>= 3.17.3

DESCRIPTION

Summary

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.

RELATED