Heap-based Buffer Overflow Affecting oj package, versions <3.17.3


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

Social Trends
Exploit Maturity
Proof of Concept
EPSS
0.12% (3rd 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-RUBY-OJ-17393869
  • published22 Jun 2026
  • disclosed19 Jun 2026
  • creditUnknown

Introduced: 19 Jun 2026

NewCVE-2026-54896  (opens in a new tab)
CWE-122  (opens in a new tab)

How to fix?

Upgrade oj to version 3.17.3 or higher.

Overview

Affected versions of this package are vulnerable to Heap-based Buffer Overflow in the fill_indent function when serializing Exception objects with a large indentation value. An attacker can corrupt adjacent heap memory and potentially execute arbitrary code or cause a crash by supplying crafted input with excessively large indent values during serialization.

Workaround

This vulnerability can be mitigated by avoiding the use of extreme indentation values and not exposing the indentation option to untrusted users.

CVSS Base Scores

version 4.0
version 3.1