GHSA-cjpr-jw2g-fw99

Suggest an improvement
Source
https://github.com/advisories/GHSA-cjpr-jw2g-fw99
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-cjpr-jw2g-fw99/GHSA-cjpr-jw2g-fw99.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-cjpr-jw2g-fw99
Aliases
Published
2026-12-01T21:15:43Z
Modified
2026-12-01T21:30:04Z
Severity
  • 6.5 (Medium) CVSS_V3 - CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H CVSS Calculator
Summary
Ruby JSON: Out of Bound Write in parser when `allow_control_characters: true` is enabled
Details

Summary

Parsing invalid JSON with the allow_control_characters: true option enabled can result in an out of bound write, potentially corrupting the heap, but more likely a VM crash.

Details

If an ASCI control character is preceded by a backslash, the bound checks can be defeated.

Originally fixed as a regular bug in json 1.9.3.

Proof of concept

The issue can easily be reproduced with a backslash followed by a control character. Some padding is required.

require "json"
doc = '"' + ("A" * 4096) + "\\\x01" + '"'
JSON.parse(doc, allow_control_characters: true)

Impact

If the allow_control_characters: true option is used to parse untrusted input, it could be used as a DOS vector.

Database specific
{
    "cwe_ids":  [
        "CWE-787"
    ],
    "github_reviewed":  true,
    "github_reviewed_at":  "2026-12-01T21:15:43Z",
    "nvd_published_at":  null,
    "severity":  "MODERATE"
}
References

Affected packages

RubyGems / json

Package

Name
json
Purl
pkg:gem/json

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.18.0
Fixed
2.18.2

Affected versions

2.*
2.18.0
2.18.1

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-cjpr-jw2g-fw99/GHSA-cjpr-jw2g-fw99.json"

RubyGems / json

Package

Name
json
Purl
pkg:gem/json

Affected ranges

Type
ECOSYSTEM
Events
Introduced
2.19.0
Fixed
2.19.3

Affected versions

2.*
2.19.0
2.19.1
2.19.2

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/12/GHSA-cjpr-jw2g-fw99/GHSA-cjpr-jw2g-fw99.json"