
Advisory and technical analysis of CVE-2026-132825, a heap-based buffer overflow in Ruby string case conversion, with affected versions, detection steps, and patched releases.
RUBY2SHELLCRITICAL SECURITY RESEARCH • RUBY RUNTIME • MEMORY CORRUPTION
A HEAP-BASED BUFFER OVERFLOW IN RUBY STRING CASE CONVERSION
CVE-2026-132825 • CWE-122 • Ruby Security
Ruby2Shell is a memory-corruption vulnerability affecting Ruby's string case-conversion functionality.
The vulnerability allows a specially crafted string processed using certain non-UTF-8 encodings to trigger a one-byte heap-based buffer overflow.
Depending on the application and exploitation conditions, memory corruption could potentially result in application crashes or more severe security consequences.
The issue affects multiple Ruby release branches and was addressed through upstream security patches.
| Attribute | Details |
|---|---|
| CVE ID | CVE-2026-132825 |
| Vulnerability Name | Ruby2Shell |
| Vendor | Ruby |
| Component | String Case Conversion |
| Vulnerability Type | Heap-Based Buffer Overflow |
| CWE | CWE-122 |
| CVSS | 7.4 / 10 |
| Severity | HIGH |
| Attack Vector | Local (CVSS) |
| Published | November 19, 2026 |
| Potential Impact | Memory Corruption / Potential RCE |
The vulnerability exists in Ruby's internal string case-conversion implementation.
Certain characters can expand during case conversion.
For example:
"ß".upcase
# => "SS"
When processing particular character encodings, including:
Ruby can incorrectly handle the output buffer size.
This results in a one-byte write beyond the allocated heap buffer.
String#upcase
String#downcase
String#swapcase
The underlying problem involves incorrect output-buffer handling during string case conversion.
A specially crafted input can cause a write outside the allocated buffer boundary.
Security consequences:
Important: Remote code execution is a potential exploitation outcome, not an automatic consequence of every vulnerable Ruby installation.
Potentially relevant environments include:
| Environment | Security Consideration |
|---|---|
| Ruby applications | Vulnerable string processing |
| Ruby on Rails | Review attacker-controlled request processing |
| Sinatra | Review input-handling paths |
| Rack applications | Review request parsing and middleware |
| Custom Ruby services | Inspect encoding conversion operations |
Applications that process untrusted input through affected code paths deserve particular attention.
| Ruby Branch | Affected Versions | Fixed Version |
|---|---|---|
| Ruby 3.3 | Before 3.3.14 | 3.3.14 |
| Ruby 3.4 | 3.4.0 – 3.4.12 | 3.4.13 |
| Ruby 4.0 | 4.0.0 – 4.0.9 | 4.0.10 |
🔴 Ruby 3.2 and earlier are end-of-life and do not receive these upstream fixes.
Check the installed Ruby version:
ruby -v
Locate the Ruby executable:
which ruby
Inspect installed Ruby packages:
dpkg -l | grep ruby
Check RubyGems:
gem environment
For applications using Bundler:
bundle exec ruby -v
Note: Check container images, application runtimes, and independently installed Ruby versions. The system Ruby version alone may not represent every deployed runtime.
The recommended solution is to upgrade to a patched Ruby release.
Ruby 3.3.14
Ruby 3.4.13
Ruby 4.0.10
🔴 There is no known workaround that fully mitigates the vulnerability. Restricting untrusted non-UTF-8 input is only an interim risk-reduction measure.
CVSS 3.1: 7.4 / 10 — HIGH
CVSS:3.1/AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H
| Metric | Value |
|---|---|
| Attack Vector | Local |
| Attack Complexity | High |
| Privileges Required | None |
| User Interaction | None |
| Scope | Unchanged |
| Confidentiality | High |
| Integrity | High |
| Availability | High |
The published CVSS score describes a local attack vector. Potential remote exploitation scenarios require separate analysis of application-specific attack paths.
Official and technical resources:
UNDERSTAND • DETECT • PATCH • PROTECT
RUBY2SHELL | CVE-2026-132825 | 2026
Security Research • Vulnerability Analysis • Defensive Security

Open-source XDR and SIEM platform for threat detection, log analysis, file integrity monitoring, vulnerability assessment, and compliance management across endpoints and cloud workloads.

Open-source network IDS/IPS/NSM engine for real-time traffic inspection, intrusion detection and prevention, protocol analysis, and rule-based threat hunting.

Zeek is a powerful network analysis framework that is much different from the typical IDS you may know.