Skip to content
OpenAdvisories
High · 8.7 CVE-2026-71847 EUVD-2026-54576GHSA-9hj4-r449-hfvc

Ruby JSON: JSON::ResumableParser#partial_value dereferences a freed input buffer and crashes on truncated duplicate-key streams

Published Aug 7, 2026 · Updated Aug 7, 2026 · Assigned by GitHub_M

Description

Ruby JSON is a JSON implementation for Ruby. From 2.20.0 until 2.21.2, Ruby's JSON native C extension clears the consumed JSON::ResumableParser input buffer but leaves state.start, state.cursor, and state.end pointing into released storage. When partial_value reconstructs an incomplete object containing duplicate keys, the duplicate-key warning path calls cursor_position, which dereferences those stale pointers. This results in a heap-use-after-free and can terminate the Ruby process. An attacker who can supply JSON stream data to an application using JSON::ResumableParser may cause process termination when the application calls partial_value on incomplete attacker-controlled input containing duplicate object keys. This issue has been fixed in version 2.21.2.

Affected products

VendorProductAffectedFixed
ruby json >= 2.20.0, < 2.21.2 —

Fixed in Linux distributions

Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.

ReleasePackageFixed inAdvisory
Debian 14 ruby-json 2.21.2+dfsg-1 —
Debian 13 ruby-json No fix yet —
ReleasePackageFixed inAdvisory
Ubuntu 26.10 ruby-json No fix yet —
Ubuntu 26.04 LTS ruby-json No fix yet —
Ubuntu 24.04 LTS ruby-json No fix yet —
Ubuntu 22.04 LTS ruby-json No fix yet —
Ubuntu 20.04 LTS ruby-json No fix yet —
Show 3 more (older releases, extended support, other products)
ReleasePackageFixed inAdvisory
Ubuntu 18.04 LTS ruby-json No fix yet —
Ubuntu 16.04 LTS ruby-json No fix yet —
Ubuntu 14.04 LTS ruby-json No fix yet —
ReleasePackageFixed inAdvisory
SLES for SAP 16.0 hawk2 2.7.2+git.1788518533.7d4dadd6-160000.1.1 SUSE-SU-2026:24250-1
SLES 16.0 hawk2 2.7.2+git.1788518533.7d4dadd6-160000.1.1 SUSE-SU-2026:24195-1
ReleasePackageFixed inAdvisory
openSUSE Tumbleweed hawk2 2.7.2+git.1792148770.648dcddb-1.1 openSUSE-SU-2026:12153-1
openSUSE Leap 16.0 hawk2 2.7.2+git.1788518533.7d4dadd6-160000.1.1 openSUSE-SU-2026:22068-1

Wolfi

ReleasePackageFixed inAdvisory
Wolfi rolling cinc-auditor 7.1.7-r6 —
Wolfi rolling ruby3.2-rails-8.1 +2 8.1.3.1-r1 —

Affected packages

EcosystemPackageAffectedFixedRecord
RubyGems json >= 2.20.0, < 2.21.2 2.21.2 GHSA-9hj4-r449-hfvc

Advisories 4

References