# GHSA-CJPR-JW2G-FW99: Ruby JSON: Out of Bound Write in parser when allow\_control\_characters: true is enabled

- Database: GitHub
- Severity: CVSS 6.5 (Medium)
- Published: 2026-12-01
- Modified: 2026-12-01

## Tracked as

- [CVE-2026-141523](https://cve.now/CVE-2026-141523.md): Ruby JSON: Out of Bound Write in parser when allow\_control\_characters: true is enabled

## Affected versions

- json (RubyGems): from 2.18.0, fixed in 2.18.2
- json (RubyGems): from 2.19.0, fixed in 2.19.3

## Description

### 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.

```ruby
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.

## References

- https://github.com/ruby/json/security/advisories/GHSA-cjpr-jw2g-fw99
- https://github.com/ruby/json/commit/75e2f6453a3bf79df086ac10e41dbc5b7f124a76
- https://github.com/ruby/json/commit/dcfbbcd36f240c18c3b89e5399105715f70162e3
- https://github.com/ruby/json
- https://github.com/ruby/json/releases/tag/v2.18.2
- https://github.com/ruby/json/releases/tag/v2.19.3

Page: https://cve.now/GHSA-CJPR-JW2G-FW99

Wrong or missing data? Send feedback: POST https://cve.now/api/v1/feedback (see https://cve.now/agents#feedback).
