CVE-2026-141523: Ruby JSON: Out of Bound Write in parser when `allow_control_characters: true` is enabled

Published Dec 1, 2026
·
Updated

Summary

Parsing invalid JSON with the allowcontrolcharacters: 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, allowcontrolcharacters: true)

Impact

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

Other sources

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

— MITRE

Affected Software

3 affected componentsFixes available
rubygems/json>=2.18.0<2.18.2, >=2.19.0<2.19.3
rubygems/json>=2.19.0<2.19.3
2.19.3
rubygems/json>=2.18.0<2.18.2
2.18.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade rubygems/json to a version that resolves this vulnerability.

    Fixed in 2.19.3
  2. Upgrade

    Upgrade rubygems/json to a version that resolves this vulnerability.

    Fixed in 2.18.2
  3. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 1.9.3
  4. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.18.2
  5. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 2.19.3

Event History

Dec 1, 2026
CVE Published
via MITRE·08:40 PM
Data Sourced
via MITRE·08:40 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·09:15 PM
Data Sourced
via GitHub·09:15 PM
DescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·09:15 PM
Affected Software
Data Sourced
via NVD·09:17 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Which applications are exposed?

Applications that parse attacker-controlled JSON with JSON.parse while allow_control_characters is enabled are exposed on affected Ruby JSON versions.

2

What does an attacker need to send to trigger the issue?

The input must be invalid JSON containing sufficient padding before a backslash that is immediately followed by an ASCII control character. Exploitation does not require authentication or user interaction.

3

What is the likely impact of successful exploitation?

The malformed escape sequence can cause an out-of-bounds write and heap-memory corruption. The more likely outcome is a Ruby VM crash, resulting in denial of service for the application parsing the input.

4

Which versions contain the fix?

The issue is fixed in Ruby JSON versions 2.18.2 and 2.19.3.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203