Intel

AIKIDO-2026-10977

json is vulnerable to Buffer Overflow

Buffer Overflow Pre-CVE
Found by Aikido Intel before public disclosure or CVE publication.
Published 4 days ago

73

High Risk

This Affects:

RUBYjson
0.0.1 - 2.19.5
Fixed in 2.19.6
Are you affected? Scan for Free

TL;DR

The Ruby json gem's native generator can compute output buffer capacity using an unchecked size_t multiply when repeating indent or spacing strings during JSON.generate. If the product overflows, the buffer may be allocated too small and subsequent writes can corrupt heap memory. The same release also allows an extremely large generator depth option that can drive excessive nesting work and availability loss. Before the patch, these conditions were reachable when generation options or structure are influenced by untrusted input. The patch multiplies buffer sizes safely and rejects pathological depth values.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range.

Background info

json is vulnerable to Buffer Overflow in versions 0.0.1 - 2.19.5.

How to fix this

Upgrade the json library to the patch version.