cve.bz

CVE-2026-71847 ruby json: Use After Free

8.7 highEPSS 0.4%Fix available

High (8.7) in ruby json. EPSS 0.4% estimated probability of exploitation activity in the next 30 days. Fixed in json 2.21.2.

On this page
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.

Severity

CVSS 4.0

8.7 high
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
EPSS
0.4% (unchanged from 0.4% a week ago; 0.4% 30 days ago) estimated probability of exploitation activity in the next 30 days; 38th percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: PoC · Automatable: yes · Technical impact: partial, assessed 2026-08-07. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-416 Use After Free
Published
Modified
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2026-71847 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-71847?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-71847?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-71847 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
ruby json>= 2.20.0, < 2.21.2

Packages (OSV)

AdvisoryEcosystemPackageAffectedFixed in
GHSA-9hj4-r449-hfvcRubyGemsjson>=2.20.0 <2.21.22.21.2

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13ruby-jsonno fix listedDEBIAN-CVE-2026-71847
Debian14ruby-json2.21.2+dfsg-1DEBIAN-CVE-2026-71847
Ubuntu14.04:LTS, 16.04:LTS, 18.04:LTS and 5 moreruby-jsonno fix listedUBUNTU-CVE-2026-71847
SUSELinux Enterprise High Availability Extension 16.0hawk22.7.2+git.1788518533.7d4dadd6-160000.1.1SUSE-SU-2026:24195-1
SUSELinux Enterprise High Availability Extension 16.1hawk-apiserver0.2.4+git.1792406875.6ed758a-160100.1.1SUSE-SU-2026:24712-1
SUSELinux Enterprise High Availability Extension 16.1hawk22.7.2+git.1789128469.a738abc1-160100.1.1SUSE-SU-2026:24712-1
SUSELinux Enterprise Server 16.1, Linux Enterprise Server for SAP applications 16.1python-Pillow11.3.0-160100.3.1SUSE-SU-2026:24712-1
SUSELinux Enterprise Server for SAP applications 16.0hawk22.7.2+git.1788518533.7d4dadd6-160000.1.1SUSE-SU-2026:24250-1
SUSELinux Enterprise Server for SAP applications 16.1hawk-apiserver0.2.4+git.1792406875.6ed758a-160100.1.1SUSE-SU-2026:24722-1
SUSELinux Enterprise Server for SAP applications 16.1hawk22.7.2+git.1789128469.a738abc1-160100.1.1SUSE-SU-2026:24722-1
openSUSELeap 16.0hawk22.7.2+git.1788518533.7d4dadd6-160000.1.1openSUSE-SU-2026:22068-1
openSUSELeap 16.1hawk-apiserver0.2.4+git.1792406875.6ed758a-160100.1.1openSUSE-SU-2026:22305-1
openSUSELeap 16.1hawk22.7.2+git.1789128469.a738abc1-160100.1.1openSUSE-SU-2026:22305-1
openSUSETumbleweedhawk22.7.2+git.1792148770.648dcddb-1.1openSUSE-SU-2026:12153-1

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This flaw has a Moderate impact. A heap-use-after-free in the Ruby json gem's native C extension can terminate the Ruby process (denial of service) when an application uses the JSON::ResumableParser streaming API and calls partial_value on incomplete, attacker-controlled input containing duplicate object keys. Red Hat products are not affected: the json gem versions shipped are either outside the vulnerable range (2.20.0-2.21.1), or - where an in-range version is present (Red Hat 3scale API Management's zync component, json 2.21.1) - the application only performs standard whole-buffer JSON.parse and never invokes the vulnerable JSON::ResumableParser#partial_value code path. Exploitation requires the specialized resumable/streaming parser API, which is not used by any affected Red Hat product.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.

ProductPackageStateAdvisory
Red Hat 3scale API Management Platform 23scale-amp2/zync-rhel9Not affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-71847.

References

Check your stackJSON