Ruby oj Gem < 3.17.2 Stack Buffer Overflow

critical Nessus Plugin ID 333329

Synopsis

The remote host has a module installed that is affected by a stack buffer overflow vulnerability.

Description

The version of the oj Ruby gem installed on the remote host is prior to 3.17.2. It is, therefore, affected by a stack buffer overflow vulnerability.

- Oj.dump is vulnerable to a stack-based buffer overflow when a large :indent value is provided by the developer. fill_indent in dump.h calls memset(indent_str, ' ', (size_t)opts->indent) without validating the size. When opts->indent is set to INT_MAX (2,147,483,647), the (size_t) cast preserves the large value and memset writes 2 GB into the stack-allocated out buffer (4,184 bytes), corrupting the stack and crashing the process. (CVE-2026-54502)

Note that Nessus has not tested for this issue but has instead relied only on the application's self-reported version number.

Solution

Upgrade to oj version 3.17.2 or later.

See Also

https://github.com/ohler55/oj/security/advisories/GHSA-3v45-f3vh-wg7m

Plugin Details

Severity: Critical

ID: 333329

File Name: ruby_gem_oj_3_17_2.nasl

Version: 1.1

Type: Local

Agent: windows, macosx, unix

Family: Misc.

Published: 8/7/2026

Updated: 8/7/2026

Configuration: Enable thorough checks (optional)

Supported Sensors: Nessus Agent, Nessus

Risk Information

VPR

Risk Factor: Medium

Score: 4.9

Percentile: 57.96

CVSS v2

Risk Factor: High

Base Score: 7.5

Vector: CVSS2#AV:N/AC:L/Au:N/C:P/I:P/A:P

CVSS Score Source: CVE-2026-54502

CVSS v3

Risk Factor: Critical

Base Score: 9.8

Vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Vulnerability Information

CPE: cpe:/a:ohler55:oj

Required KB Items: Host/ruby/modules/enumerated

Patch Publication Date: 6/5/2026

Vulnerability Publication Date: 6/5/2026

Reference Information

CVE: CVE-2026-54502

CWE: 121

IAVB: 2026-B-0222