# CVE-2026-54696: Ruby JSON heap buffer overflow in JSON generator streaming

Source: https://junglewise.ai/threats/cve-2026-54696-ruby-json-heap-buffer-overflow-in-json-generator-streaming  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-30. Updated: 2026-07-23  
License: CC BY 4.0 with a link back

CVE-2026-54696 · Severity: low · CVSS 3.7 · Published 2026-06-30

A vulnerability in the Ruby JSON library can cause applications to crash when processing specifically crafted data. This occurs when the library is used to stream JSON data to an output destination, such as a file or network socket. An attacker who can control the content of strings being processed could use this to cause a denial-of-service, potentially disrupting business operations.

Technologies: [json (RubyGems)](https://junglewise.ai/threats/technologies/rubygems-json). Vendors: [RubyGems](https://junglewise.ai/threats/vendors/rubygems).

## Quick answers

**Is CVE-2026-54696 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-54696 being exploited in the wild.

**How severe is CVE-2026-54696?** Low severity, with a CVSS score of 3.7, published 30 June 2026.

**Which products and versions are affected?** json (RubyGems) ECOSYSTEM:introduced=2.9.0,fixed=2.19.9.

**Is there a fix for CVE-2026-54696?** Yes. json (RubyGems): upgrade to 2.19.9 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-54696 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2026-54696?** Check whether you run json (RubyGems) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- json (RubyGems): upgrade to 2.19.9 or later

  ```sh
  bundle update json
  ```


## Technical details

A heap-based buffer overflow exists in the Ruby 'json' gem's IO-streaming path. The root cause is an incorrect capacity check in 'fbuffer_do_inc_capa()' within 'ext/json/fbuffer/fbuffer.h', where the code checks total capacity instead of remaining capacity before appending data. When an attacker-controlled string near 16 KB is processed via 'JSON.dump(obj, io)' or 'JSON::State#generate(obj, io)', it can trigger an out-of-bounds write. This leads to a reliable process crash (Denial of Service). The issue is specific to the IO-streaming path and is fixed in version 2.19.9.

## Affected products

- Ruby json >= 2.9.0, < 2.19.9

## Identifiers

- CVE-2026-54696
- GHSA-x2f5-4prf-w687

## Timeline

- 2026-06-11: disclosed: Initial disclosure in ruby/json repository
- 2026-06-11: patched: Version 2.19.9 released
- 2026-06-30: advisory: NVD publication date
- 2026-07-23: advisory: GitHub Advisory published

## References

- [https://api.github.com/users/susdrip](https://api.github.com/users/susdrip)
- [https://github.com/susdrip](https://github.com/susdrip)
- [https://api.github.com/users/susdrip/gists%7B/gist_id%7D](https://api.github.com/users/susdrip/gists%7B/gist_id%7D)
- [https://api.github.com/users/susdrip/repos](https://api.github.com/users/susdrip/repos)
- [https://avatars.githubusercontent.com/u/278577938?v=4](https://avatars.githubusercontent.com/u/278577938?v=4)
- [https://api.github.com/users/susdrip/events%7B/privacy%7D](https://api.github.com/users/susdrip/events%7B/privacy%7D)

## Related threats

- [Ruby JSON heap-use-after-free in ResumableParser](https://junglewise.ai/threats/cve-2026-71847-ruby-json-heap-use-after-free-in-resumableparser)
- [Ruby JSON format string injection in JSON parser](https://junglewise.ai/threats/cve-2026-33210-ruby-json-format-string-injection-in-json-parser)
- [Out-of-bounds Read in Ruby JSON Parser](https://junglewise.ai/threats/cve-2025-27788-out-of-bounds-read-in-ruby-json-parser)
- [Unsafe object creation in json RubyGem](https://junglewise.ai/threats/cve-2020-10663-unsafe-object-creation-in-json-rubygem)
- [JSON gem has Improper Input Validation vulnerability](https://junglewise.ai/threats/cve-2013-0269-json-gem-has-improper-input-validation-vulnerability)
