Skip to main content

Ruby JSON CVE-2026-54696

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

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

2
Patch available
Jul 23, 2026 - 23:03 EUVD
Analysis Generated
Jun 30, 2026 - 23:40 vuln.today

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.

AnalysisAI

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.

Technical ContextAI

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.

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.

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

CVE-2026-71847 HIGH POC
8.7 Aug 07

Heap-use-after-free in the Ruby json gem's native C extension (versions 2.20.0 through 2.21.1) allows an unauthenticated

CVE-2026-46727 HIGH POC
8.1 May 22

Use-after-free in Ruby 4.x (before 4.0.5) lets remote attackers who can manipulate DNS response timing crash application

Share

CVE-2026-54696 vulnerability details – vuln.today

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