Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessSupply ~16 KB string in request payload
-
DeliveryApplication streams object to IO via JSON.dump
-
ExploitC generator advances write pointer past heap buffer end
-
ExecutionHeap corruption triggers process crash
-
ImpactDenial of service achieved
Vulnerability Assessment
| Weakness |
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires two concurrent conditions: (1) the application must invoke the streaming form of the JSON generator - specifically |
| Impact | The CVSS 3.1 vector (AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L) scores 3.7 (Low), which is broadly consistent with the observed threat profile. AC:H reflects the precision required: the attacker-controlled string must be near the 16 KB boundary, meaning generic fuzzing or untargeted attacks are unlikely to trigger the overflow without some knowledge of the threshold. The A:L rating is slightly conservative - a reliable process crash in a non-clustered Ruby application is more accurately A:H - but the vendor's assessment acknowledges only availability impact, with no confidentiality or integrity consequences confirmed. No EPSS data was supplied; however, given the AC:H vector and availability-only impact, opportunistic exploitation at scale is unlikely. No KEV listing and no public proof-of-concept are identified, reinforcing that this is a patch-at-next-cycle issue rather than an emergency. The primary real-world risk is in applications that accept attacker-influenced data and pipe it through the JSON streaming API without input size validation. |
| Exploit ScenarioDerived | An attacker submits a JSON serialization request to a Ruby web application - for example, an API endpoint that reflects user-supplied data - where the handler calls |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 30, 2026
Heap buffer overflow in the Ruby JSON gem's streaming generator (versions 2.9.0-2.19.8) enables reliable process crash via attacker-controlled serialized data. When applications invoke JSON.dump(obj, io) or JSON::State#generate(obj, io) to stream JSON to an IO object, the C-level generator can write past its internal buffer if the serialized object contains a string near 16 KB in size. Impact is confined to denial of service - reliable process termination - with no evidence of confidentiality or integrity impact. No public exploit code and no CISA KEV listing are identified at time of analysis; the CVSS score of 3.7 (Low) appropriately reflects the constrained attack conditions.
RemediationAI
Upgrade the Ruby JSON gem to version 2.19.9, which contains the vendor-confirmed fix per the GitHub release at https://github.com/ruby/json/releases/tag/v2.19.9 and the security advisory at https://github.com/ruby/json/security/advisories/GHSA-x2f5-4prf-w687. For applications unable to upgrade immediately, the most effective compensating control is to avoid the streaming IO form of the generator: replace JSON.dump(obj, io) with io.write(JSON.generate(obj)), which uses the non-streaming code path and is not affected by this overflow. Additionally, enforcing input size limits on any attacker-supplied strings before they enter the serialization pipeline will prevent the near-16 KB boundary from being reached. Note that switching to non-streaming serialization may increase peak memory usage for large objects, as the full JSON string is materialized in memory before writing.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in rubygems
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The Ruby JSON gem is a C extension (cpe:2.3:a:ruby:json:*:*:*:*:*:*:*:*) that provides high-performance JSON encoding and decoding for Ruby. Its generator maintains an internal heap-allocated buffer to accumulate JSON output before writing. In streaming mode - where output is directed to an IO object rather than returned as a string - the generator can advance past the end of this buffer (CWE-122: Heap-based Buffer Overflow) when it processes an object member whose string value approaches approximately 16 KB. The boundary check fails to account for the combined size of the string and any surrounding JSON syntax characters, allowing the write pointer to overrun the allocation. This class of bug in native C extensions is particularly impactful in Ruby runtimes because a heap corruption typically results in an unhandled SIGABRT or SIGSEGV, crashing the entire interpreter process.
Know when Ruby gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
AC:H retained for the ~16 KB string-size precision requirement; A:H assigned because the heap overflow reliably crashes the process, not merely degrades it.
Primary rating from Vendor (GitHub_M).
CVSS VectorVendor: GitHub_M
Lifecycle Timeline
1DescriptionCVE.org
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.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.
A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl
The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio
Ruby through 2.2.7, 2.3.x through 2.3.4, and 2.4.x through 2.4.1 can expose arbitrary memory during a JSON.generate call
Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi
Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in
Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit
An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub
An issue was discovered in Oniguruma 6.2.0, as used in Oniguruma-mod in Ruby through 2.4.1 and mbstring in PHP through 7
Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub
Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th
Ruby before 2.4.2, 2.3.5, and 2.2.8 is vulnerable to a malicious format string which contains a precious specifier (*) w
Heap-based buffer overflow in Ruby 1.8, 1.9 before 1.9.3-p484, 2.0 before 2.0.0-p353, 2.1 before 2.1.0 preview2, and tru
EUVD-2026-40626
GHSA-x2f5-4prf-w687
NVD
CVE.org
EPSS
Vulnrichment
Exploit-DB