Description
Ruby JSON is a JSON implementation for Ruby. Versions 2.9.0 through 2.19.8 are vulnerable to heap buffer overflow when the JSON generator is provided with an oversized streamed object. When streaming to an IO JSON.dump(obj, io) and JSON::State#generate(obj, io) can write past the internal JSON generator buffer when a streamed object contains an
attacker-controlled string near 16 KB. Exploitation would result in a reliable process crash/denial of service. This issue has been fixed in version 2.19.9.
Published: 2026-06-30
Score: 3.7 Low
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

The vulnerability is a heap buffer overflow triggered when the JSON generator receives an oversized streamed object that contains an attacker‑controlled string around 16 KB. The buffer overflow occurs during JSON.dump or JSON::State#generate when streaming to an IO, causing the internal buffer to be overrun and leading to a process crash or denial of service. No code execution or credential compromise is possible; the impact is limited to local process disruption, classified as denial of service.

Affected Systems

Affected is the Ruby JSON library (gem), version 2.9.0 through 2.19.8, maintained by ruby:json. The vulnerability is resolved starting with version 2.19.9. Any Ruby application that uses JSON.dump or JSON::State#generate with a streamed IO on these versions is potentially impacted.

Risk and Exploitability

The CVSS score of 3.7 indicates low severity, and the EPSS score is not available, with no listing in the CISA KEV catalog. Exploitation requires the attacker to control the streamed object passed to JSON.dump or similar functions, which is likely only possible if the application accepts arbitrary JSON from an untrusted source. The attack vector is inferred from the description; a local or remote attacker with such control can trigger a crash to cause denial of service. Because the crash does not leak data or allow privilege escalation, the risk is moderate and confined to the application process.

Generated by OpenCVE AI on June 30, 2026 at 23:31 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade Ruby JSON gem to version 2.19.9 or later
  • Implement input validation to limit streamed string size and reject objects exceeding 16 KB
  • Configure the application to avoid streaming untrusted data to JSON.dump or JSON::State#generate, or restart services upon crash

Generated by OpenCVE AI on June 30, 2026 at 23:31 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-x2f5-4prf-w687 Ruby json: JSON generator heap buffer overflow when streaming to an IO
History

Wed, 01 Jul 2026 14:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'poc', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 01 Jul 2026 03:45:00 +0000

Type Values Removed Values Added
First Time appeared Ruby
Ruby json
Vendors & Products Ruby
Ruby json

Tue, 30 Jun 2026 22:45:00 +0000

Type Values Removed Values Added
Description Ruby JSON is a JSON implementation for Ruby. Versions 2.9.0 through 2.19.8 are vulnerable to heap buffer overflow when the JSON generator is provided with an oversized streamed object. When streaming to an IO JSON.dump(obj, io) and JSON::State#generate(obj, io) can write past the internal JSON generator buffer when a streamed object contains an attacker-controlled string near 16 KB. Exploitation would result in a reliable process crash/denial of service. This issue has been fixed in version 2.19.9.
Title Ruby JSON: JSON generator heap buffer overflow when streaming to an IO
Weaknesses CWE-122
CWE-131
CWE-787
References
Metrics cvssV3_1

{'score': 3.7, 'vector': 'CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L'}


cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-07-01T13:20:56.931Z

Reserved: 2026-06-15T22:58:06.562Z

Link: CVE-2026-54696

cve-icon Vulnrichment

Updated: 2026-07-01T13:20:52.104Z

cve-icon NVD

No data.

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-07-01T03:30:05Z

Weaknesses
  • CWE-122

    Heap-based Buffer Overflow

  • CWE-131

    Incorrect Calculation of Buffer Size

  • CWE-787

    Out-of-bounds Write