CVE-2026-141523: Ruby JSON Out Of Bound Write Vulnerability

MODERATE
Advisory Identifier: GHSA-cjpr-jw2g-fw99
CVSS 6.5
CWE-787
Published
Advisory Summary

CVE-2026-141523 is a MODERATE (CVSS 6.5) out of bound write vulnerability (CWE-787: Out-of-bounds Write) affecting Ruby JSON libraries in the RubyGems ecosystem. The issue involves out of bound write in parser when `allow_control_characters: true` is enabled. Remediation is available by upgrading affected packages to version 2.18.2, 2.19.3.

CVE-2026-141523 at a Glance

CVE Identifier CVE-2026-141523
GHSA Identifier GHSA-cjpr-jw2g-fw99
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-787: Out-of-bounds Write
Affected Product Ruby JSON
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability High (A:H)

How to Fix CVE-2026-141523

To remediate this vulnerability, upgrade all affected Ruby JSON dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

json fixed: 2.18.2
Upgrade json to 2.18.2
json fixed: 2.19.3
Upgrade json to 2.19.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for json

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-141523, inspect your project dependencies for Ruby JSON:

inspect dependencies for json

Analyze the terminal output to locate any version of Ruby JSON in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.18.2), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-787: Out-of-bounds Write, where the product writes data past the end, or before the beginning, of the intended buffer. In Ruby JSON, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-141523 Affected Ruby JSON Versions

2 component(s)
Fixed Versions:
2.18.22.19.3
Product / Package Ecosystem Affected Versions Fixed Version
json
RubyGems
≥ 2.18.0
< 2.18.2
2.18.2
json
RubyGems
≥ 2.19.0
< 2.19.3
2.19.3

References

Frequently Asked Questions

What is CVE-2026-141523?
CVE-2026-141523 is a security vulnerability in Ruby JSON involving Out of Bound Write in parser when `allow_control_characters: true` is enabled under CWE-787: Out-of-bounds Write.
Which Ruby JSON versions are affected?
Affected versions include releases prior to 2.18.2, 2.19.3 across affected packages: json.
What version fixes CVE-2026-141523?
Upgrading to 2.18.2, 2.19.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is json affected?
Yes, json is affected in releases prior to 2.18.2, 2.19.3. Upgrade your dependency to 2.18.2, 2.19.3 or later.
What is the CVSS score of CVE-2026-141523?
CVE-2026-141523 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H.
What CWE is associated with CVE-2026-141523?
CVE-2026-141523 is classified under CWE-787: Out-of-bounds Write (The product writes data past the end, or before the beginning, of the intended buffer.).
How can I check RubyGems dependencies for CVE-2026-141523?
Run the dependency tree command: 'inspect dependencies for json'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-cjpr-jw2g-fw99",
  "modified" : "2026-12-01T21:15:43Z",
  "published" : "2026-12-01T21:15:43Z",
  "aliases" : [ "CVE-2026-141523" ],
  "summary" : "Ruby JSON: Out of Bound Write in parser when `allow_control_characters: true` is enabled",
  "details" : "### 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.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "json"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.18.0"
      }, {
        "fixed" : "2.18.2"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "json"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "2.19.0"
      }, {
        "fixed" : "2.19.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/ruby/json/security/advisories/GHSA-cjpr-jw2g-fw99"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/json/commit/75e2f6453a3bf79df086ac10e41dbc5b7f124a76"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/json/commit/dcfbbcd36f240c18c3b89e5399105715f70162e3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/ruby/json"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/json/releases/tag/v2.18.2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/ruby/json/releases/tag/v2.19.3"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-787" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-12-01T21:15:43Z",
    "nvd_published_at" : null
  }
}