Ruby json: JSON generator heap buffer overflow when streaming to an IO
CVE-2026-54696GHSA-x2f5-4prf-w687
What to do
Vendor fix available. Upgrade each affected package to the fixed version on its release line (json 2.19.9), redeploy, then verify what is actually installed.
This page has no inventory attached, so it cannot say whether you are affected. A vendor fix is not proof that your deployment is fixed.
Affected packages
RubyGems json
- Affected
- >= 2.9.0, < 2.19.9
- Fixed in
- 2.19.9
Sources
- GitHub Advisory Database and maintainer security advisories on GitHub
GitHub-reviewed advisory GHSA-x2f5-4prf-w687 lists affected ranges: RubyGems json >=2.9.0 <2.19.9
VerifiedObserved Structured GitHub Advisory Database record (type=reviewed) from the GitHub REST API.
Severity and exploitation
- Exploitation
- No confirmed exploitation recorded. Patch Next marks exploitation only from CISA KEV.
- CVSS
- 3.7 · CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:L
- EPSS
- CVE-2026-54696: 0.41% estimated exploitation activity in the next 30 days; percentile 35.46 (FIRST EPSS, 2026-11-03). This is a model estimate, not proof of exploitation or customer exposure.
Source description
As published by the source; long descriptions are shortened.
Summary 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. Details Root cause is in ext/json/fbuffer/fbuffer.h, fbufferdoinccapa(). On the IO path, the buffer is grown to FBUFFERIOBUFFERSIZE (16383), but the early return checks total capacity instead of remaining capacity: If fb-len already contains JSON syntax bytes, and a string flush has 16383 - fb-len <= requested < 16383, this check returns even though there is not enough space left. fbufferappendreserved() then writes past the buffer: The minimal fix is to compare against the remaining capacity: PoC Verified results: Control: the same data through…
Dates and revisions
- Published by the source
- Last modified by the source
- Source last checked
- Revision 1 · created ·
Published from ghsa record GHSA-x2f5-4prf-w687
Agent brief
Preview the exact text before you copy it. Commands are read-only suggestions; review them before running anything.
# Patch Next advisory brief: CVE-2026-54696 Advisory: Ruby json: JSON generator heap buffer overflow when streaming to an IO IDs: CVE-2026-54696, GHSA-x2f5-4prf-w687 Record: https://patchnext.com/advisories/cve-2026-54696 (revision 1, source checked 26 Oct 2026, 15:52 UTC) Inventory: none attached. This brief comes from a public page and does not say whether any deployment is affected. Severity: Low (CVSS 3.7) Exploitation: no confirmed exploitation recorded. Patch Next confirms exploitation only from CISA KEV. Vendor response: Vendor fix available; fixed versions by package: json 2.19.9. A vendor fix does not mean a deployment is fixed. ## Affected components - RubyGems json: affected >= 2.9.0, < 2.19.9; fixed in 2.19.9 ## Suggested inspection (read-only) - RubyGems json: check the installed version with your package manager. ## Supported action Upgrade each affected component to a fixed version on its release line. For a transitive dependency, upgrade the parent package or add an override or constraint, then regenerate the lockfile. Redeploy every environment that ran an affected version. ## Required regression checks - Run the test suite and a production build. - Exercise the features that depend on json. - Repeat the inspection and confirm that only fixed versions remain installed. ## Rollback considerations - Keep the previous lockfile and deployment artifact. Rolling back reinstates the vulnerable version, so apply any documented mitigation while you fix forward. ## Unresolved questions - Which deployments run an affected version? - Exploitation status can change. Check again before lowering the priority. - Mark the work resolved only after the fixed version is verified in production. ## Sources - Verified: https://github.com/advisories/GHSA-x2f5-4prf-w687 (GitHub-reviewed advisory GHSA-x2f5-4prf-w687 lists affected ranges: RubyGems json >=2.9.0 <2.19.9) Commands are suggestions: review each one before running it.
Loading voting…