{"id":"CVE-2026-141523","aliases":["CVE-2026-141523","GHSA-cjpr-jw2g-fw99"],"related":[],"kind":"vulnerability","state":"published","title":"Ruby JSON: Out of Bound Write in parser when `allow_control_characters: true` is enabled","summary":"Ruby JSON is a JSON implementation for Ruby. From 2.18.0 until 2.18.2 and 2.19.3, JSON.parse can perform an out-of-bounds write when allow_control_characters is enabled and attacker-controlled invalid JSON contains sufficient padding before a backslash immediately followed by an ASCII control character. This malformed escape sequence can defeat the parser's bounds checks, potentially corrupting heap memory and more likely crashing the Ruby VM, which can cause denial of service in applications that parse untrusted input with the affected option. This issue is fixed in versions 2.18.2 and 2.19.3.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Ruby JSON is a JSON implementation for Ruby. From 2.18.0 until 2.18.2 and 2.19.3, JSON.parse can perform an out-of-bounds write when allow_control_characters is enabled and attacker-controlled invalid JSON contains sufficient padding before a backslash immediately followed by an ASCII control character. This malformed escape sequence can defeat the parser's bounds checks, potentially corrupting heap memory and more likely crashing the Ruby VM, which can cause denial of service in applications that parse untrusted input with the affected option. This issue is fixed in versions 2.18.2 and 2.19.3.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nParsing 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.\n\n### Details\n\nIf an ASCI control character is preceded by a backslash, the bound checks can be defeated.\n\nOriginally fixed as a regular bug in `json` `1.9.3`.\n\n### Proof of concept\n\nThe issue can easily be reproduced with a backslash followed by a control character. Some padding is required.\n\n```ruby\nrequire \"json\"\ndoc = '\"' + (\"A\" * 4096) + \"\\\\\\x01\" + '\"'\nJSON.parse(doc, allow_control_characters: true)\n```\n\n### Impact\n\nIf the `allow_control_characters: true` option is used to parse untrusted input, it could be used as a DOS vector.","format":"markdown","source":"ghsa"}],"published":"2026-12-01T20:40:10.234Z","modified":"2026-12-01T21:30:04.283Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H","score":6.5,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H","score":6.5,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H","score":6.5,"rating":"MEDIUM"}],"cwes":["CWE-787"],"affected":[{"ranges":[{"version":">= 2.18.0, < 2.18.2","status":"affected"},{"version":">= 2.19.0, < 2.19.3","status":"affected"}],"vendor":"ruby","product":"json","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"2.18.0","status":"affected","fixed":"2.18.2"}],"ecosystem":"RubyGems","package":"json","purl":"pkg:gem/json","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"2.19.0","status":"affected","fixed":"2.19.3"}],"ecosystem":"RubyGems","package":"json","purl":"pkg:gem/json","source":"ghsa"}],"references":[{"url":"https://github.com/ruby/json/security/advisories/GHSA-cjpr-jw2g-fw99","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ruby/json/commit/75e2f6453a3bf79df086ac10e41dbc5b7f124a76","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ruby/json/commit/dcfbbcd36f240c18c3b89e5399105715f70162e3","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ruby/json/releases/tag/v2.18.2","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ruby/json/releases/tag/v2.19.3","tags":["web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/ruby/json","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-141523","url":"https://www.cve.org/CVERecord?id=CVE-2026-141523","licence":"CVE Terms of Use","modified":"2026-12-01T20:40:10.234Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-cjpr-jw2g-fw99","url":"https://github.com/advisories/GHSA-cjpr-jw2g-fw99","licence":"CC-BY-4.0","modified":"2026-12-01T21:30:04.283Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-141523","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-141523","licence":"Public domain","modified":"2026-12-01T21:17:11.827Z"}],"updatedAt":"2026-12-01T21:37:24.826Z"}