Use After Free Affecting json package, versions >=2.20.0, <2.21.2


Severity

Recommended
0.0
high
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.25% (17th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-RUBY-JSON-18599450
  • published9 Aug 2026
  • disclosed7 Aug 2026
  • creditUnknown

Introduced: 7 Aug 2026

NewCVE-2026-71847  (opens in a new tab)
CWE-416  (opens in a new tab)

How to fix?

Upgrade json to version 2.21.2 or higher.

Overview

json is a JSON implementation as a Ruby extension in C.

Affected versions of this package are vulnerable to Use After Free through JSON::ResumableParser#partial_value in ext/json/ext/parser/parser.c. An attacker can crash the Ruby process by supplying truncated streaming JSON with duplicate object keys and causing the application to call partial_value on the incomplete parse. The vulnerable warning path computes a cursor position for resumable-parser deprecation messages after the parser has already cleared and released its input buffer, leaving stale pointers in state.start, state.cursor, and state.end. When that duplicate-key path runs, it dereferences freed memory and terminates the process.

CVSS Base Scores

version 4.0
version 3.1