Integer Overflow or Wraparound Affecting ruby-oj package, versions <3.14.2-1+deb12u1


Severity

Recommended
low

Based on default assessment until relevant scores are available.

Threat Intelligence

EPSS
0.41% (38th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-DEBIAN12-RUBYOJ-17796007
  • published2 Jul 2026
  • disclosed1 Jul 2026

Introduced: 1 Jul 2026

CVE-2026-54903  (opens in a new tab)
CWE-190  (opens in a new tab)

How to fix?

Upgrade Debian:12 ruby-oj to version 3.14.2-1+deb12u1 or higher.

NVD Description

Note: Versions mentioned in the description apply only to the upstream ruby-oj package and not the ruby-oj package as distributed by Debian. See How to fix? for Debian:12 relevant fixed versions and status.

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.