Update dependency json to v2.19.9 [SECURITY] - #144
Merged
Conversation
renovate
Bot
force-pushed
the
renovate/rubygems-json-vulnerability
branch
from
July 27, 2026 14:46
f3e1cb6 to
c2fdfa3
Compare
renovate
Bot
force-pushed
the
renovate/rubygems-json-vulnerability
branch
from
July 27, 2026 14:47
c2fdfa3 to
61a0581
Compare
silug
approved these changes
Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR contains the following updates:
'= 2.19.5'→'= 2.19.9'Ruby json: JSON generator heap buffer overflow when streaming to an IO
CVE-2026-54696 / GHSA-x2f5-4prf-w687
More information
Details
Summary
JSON.dump(obj, io)andJSON::State#generate(obj, io)can write past theinternal 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,fbuffer_do_inc_capa().On the IO path, the buffer is grown to
FBUFFER_IO_BUFFER_SIZE(16383), but theearly return checks total capacity instead of remaining capacity:
If
fb->lenalready contains JSON syntax bytes, and a string flush has16383 - fb->len <= requested < 16383, this check returns even though there isnot enough space left.
fbuffer_append_reserved()then writes past the buffer:The minimal fix is to compare against the remaining capacity:
PoC
Verified results:
Control: the same data through
JSON.dump([big])without an IO argument returnsnormally. The bug is specific to the IO-streaming path.
Impact
A remote attacker can trigger a heap out-of-bounds write if they control a
string field that an application serializes through
JSON.dump(obj, io)orJSON::State#generate(obj, io). The demonstrated impact is reliable denial ofservice. I am not claiming code execution or information disclosure.
Severity
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:LReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.