CVE-2026-54696: Ruby json: JSON generator heap buffer overflow 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. The issue is a heap out-of-bounds write
in the IO-streaming path and is demonstrated as a reliable process crash /
denial of service.
This was triaged on HackerOne as report #3785370. The issue was confirmed there and I was asked to open it here.
References
- github.com/advisories/GHSA-x2f5-4prf-w687
- github.com/ruby/json/commit/996bac686d64e4e3aaeae03b14a7f9ee9695ebdb
- github.com/ruby/json/releases/tag/v2.19.9
- github.com/ruby/json/security/advisories/GHSA-x2f5-4prf-w687
- github.com/rubysec/ruby-advisory-db/blob/master/gems/json/CVE-2026-54696.yml
- nvd.nist.gov/vuln/detail/CVE-2026-54696
Code Behaviors & Features
Detect and mitigate CVE-2026-54696 with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Learn more about Dependency Scanning →