Skip to main content

Ruby JSON EUVDEUVD-2026-40626

| CVE-2026-54696 LOW
Heap-based Buffer Overflow (CWE-122)
2026-06-30 GitHub_M GHSA-x2f5-4prf-w687
3.7
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Supply ~16 KB string in request payload
  2. Delivery
    Application streams object to IO via JSON.dump
  3. Exploit
    C generator advances write pointer past heap buffer end
  4. Execution
    Heap corruption triggers process crash
  5. Impact
    Denial 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 JSON.dump(obj, io) or JSON::State#generate(obj, io) where io is an IO object, not a String; and (2) the object being serialized must contain an attacker-controlled string value approaching 16 KB in length. Non-streaming calls such as JSON.generate(obj) or obj.to_json are not affected. Exploitation is further constrained by the near-16 KB precision requirement (AC:H), meaning attackers must have enough visibility into or influence over the serialized data to size their payload near the boundary. Authentication is not a prerequisite at the network level (PR:N in the CVSS vector), but the attacker's ability to inject string content into a streamed object depends entirely on application-level data-flow; applications that only serialize internally generated data are not exposed.

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 JSON.dump(payload, response_io) to stream the response. By crafting a string value in the payload that is just under 16 KB, the attacker causes the C-level generator to write past its internal buffer on the heap, crashing the Ruby worker process and returning a 500 error or connection reset to the client. Repeated requests can sustain a denial-of-service condition if worker processes are not rapidly recycled. No public proof-of-concept code is identified at time of analysis.

Monitor Track and reassess. Why: LOW severity (CVSS 0.1-3.9).
Patch available 0.3% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – 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

json 2.9.0, < 2.19.9

Affected Packages

rubygems json fix: 2.19.9

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

Vendor (GitHub_M) PRIMARY 3.7 LOW
AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
vuln.today AI 5.9 MEDIUM

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.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:H/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
High
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
Low

Lifecycle Timeline

1
Patch available
Jul 23, 2026 - 23:03 EUVD

DescriptionCVE.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

EPSS Score
0.3%
Top 78% exploitable
Prevalence
High
Core gem bundled with MRI Ruby, used across millions of Ruby applications
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
6 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA GitHub

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.

SignalValue
Severity LOW
CISA KEV No
Public POC Yes
EPSS 0.3%
Patch available Yes
Active threat No
Deciding rule
LOW severity (CVSS 0.1-3.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +18
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

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.

More in Ruby

View all
CVE-2017-17405 HIGH POC
8.8 Dec 15

Ruby before 2.4.3 allows Net::FTP command injection. Rated high severity (CVSS 8.8), this vulnerability is remotely expl

CVE-2017-17790 CRITICAL POC
9.8 Dec 20

The lazy_initialize function in lib/resolv.rb in Ruby through 2.4.3 uses Kernel#open, which might allow Command Injectio

CVE-2017-14064 CRITICAL POC
9.8 Aug 31

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

CVE-2016-2336 CRITICAL POC
9.8 Jan 06

Type confusion exists in two methods of Ruby's WIN32OLE class, ole_invoke and ole_query_interface. Rated critical severi

CVE-2026-77602 CRITICAL POC
9.9 Sep 23

Authenticated remote code execution in OpenC3 COSMOS (Ruby gem 'openc3' versions 5.1.0 through 7.2.1) lets any logged-in

CVE-2016-2337 CRITICAL POC
9.8 Jan 06

Type confusion exists in _cancel_eval Ruby's TclTkIp class method. Rated critical severity (CVSS 9.8), this vulnerabilit

CVE-2016-2339 CRITICAL POC
9.8 Jan 06

An exploitable heap overflow vulnerability exists in the Fiddle::Function.new "initialize" function functionality of Rub

CVE-2017-9225 CRITICAL POC
9.8 May 24

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

CVE-2026-44266 CRITICAL POC
9.8 Nov 03

Ruby code execution in Elo (npm @enspirit/elo) through 1.0.0 lets an attacker who controls Elo source gain arbitrary Rub

CVE-2026-27614 CRITICAL POC
9.3 Feb 25

Stored XSS in Bugsink error tracking tool before 2.0.13 allows unauthenticated attackers to inject persistent scripts th

CVE-2017-0898 CRITICAL POC
9.1 Sep 15

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

CVE-2013-4164 MEDIUM POC
6.8 Nov 23

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

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy