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.
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.
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)
If the allow_control_characters: true option is used to parse untrusted input, it could be used as a DOS vector.
{
"cwe_ids": [
"CWE-787"
],
"github_reviewed": true,
"github_reviewed_at": "2026-12-01T21:15:43Z",
"nvd_published_at": null,
"severity": "MODERATE"
}