Critical 2026 Advisory: CVE-2026-132825 (CVSS 9.8) - Ruby2Shell

Ruby RCE & Ruby2Shell (CVE-2026-132825) Vulnerability Scanner

Emergency Advisory: The Ruby core team released emergency security fixes for 7 regular expression and memory-safety flaws, including Ruby2Shell (CVE-2026-132825). An off-by-one heap overflow in string case-conversions (upcase, downcase) allows unauthenticated remote code execution in default Rails, Puma, Passenger, and Rack environments.

Continuously discover and audit your internet-facing Ruby on Rails, Sinatra, and Rack applications across all cloud providers and microservices before attackers weaponize heap corruption exploits.

  • Ruby & Rails Stack Fingerprinting: Detects Puma, Unicorn, Phusion Passenger, Thin, Falcon, and Rails session tokens across your entire perimeter.
  • Exact Interpreter Version Verification: Identifies unpatched Ruby runtimes (< 3.3.14, < 3.4.13, < 4.0.10) and flags unsupported EOL versions (Ruby 3.2 and older).
  • Safe, Non-Intrusive Network Scanning: Analyzes server headers, response cookies, and encoding behaviors without crashing live worker threads.
  • Clear Remediation Paths: Step-by-step guidance for interpreter upgrades and immediate Rack middleware UTF-8 validation rules.
bspeka-scanner // ruby_rce_audit
Critical Severity (CVSS 9.8) app.saas-platform.io:443
Ruby String Case-Conversion Heap Overflow RCE (CVE-2026-132825 / Ruby2Shell)
Target runs Phusion Passenger with Ruby 3.3.5. Vulnerable to off-by-one heap buffer overflow in string case-conversion functions when processing single-byte encodings (ISO-8859-1), leading to unauthenticated RCE.
Upgrade runtime to Ruby 3.3.14+ / 3.4.13+ & restart app workers
Informational app.saas-platform.io
Ruby on Rails Application Environment Identified
Detected standard Rails X-Runtime header and encrypted Rails session cookie format.
Low Severity app.saas-platform.io
Ruby Interpreter Version Disclosure
X-Powered-By header leaks 'Phusion Passenger 6.0.23 (Ruby 3.3.5)'. Suppress in production config.

Technical Breakdown: The 7 Ruby Flaws & Ruby2Shell

How memory-safety bugs in Ruby's case-folding routines and regular expression compiler allow unauthenticated remote execution.

The Ruby2Shell Off-By-One Heap Overflow

When Ruby converts strings to uppercase or lowercase (String#upcase, String#downcase) in single-byte encodings like ISO-8859-1 or Windows-1252, certain characters expand in size (e.g., German sharp S ß expanding to SS). An off-by-one error in buffer allocation calculations allows expanded characters to overwrite the byte immediately following the heap chunk, enabling heap metadata corruption.

7 Regular Expression Engine Flaws

The security release also resolves 6 additional vulnerabilities inside Ruby's Regexp compilation engine. Attackers supplying crafted regular expressions or input strings can trigger out-of-bounds reads and heap memory corruption. Maintainers confirmed working Proof-of-Concept exploits exist for 5 of these vulnerabilities.

Pre-Auth Attack Surface in Rails & Rack

Web applications built on Ruby on Rails, Sinatra, or raw Rack middleware frequently normalize query parameters, form headers, and multipart upload fields before authentication. When request parameters specify single-byte encodings, string manipulation methods automatically trigger the vulnerable C-level routines without requiring user login credentials.

Affected Ruby Versions & Fix Status

Identify which Ruby branches are vulnerable and the minimum patch release required.

Ruby Branch Vulnerable Versions Patched Version Status
Ruby 3.3 Series 3.3.0 through 3.3.13 3.3.14+ Critical RCE
Ruby 3.4 Series 3.4.0 through 3.4.12 3.4.13+ Critical RCE
Ruby 4.0 Series 4.0.0 through 4.0.9 4.0.10+ Critical RCE
Ruby 3.2 & Older (EOL) All versions (3.2.x, 3.1.x, 2.x) None (End of Life) Permanently Vulnerable (Upgrade Required)

Frequently Asked Questions

Common questions regarding Ruby2Shell (CVE-2026-132825) and securing your production applications.

What is Ruby2Shell (CVE-2026-132825)?
Ruby2Shell is the moniker given to CVE-2026-132825 (GHSA-34m4-m9fh-gqp5), a critical CVSS 9.8 remote code execution vulnerability in Ruby's string case-conversion routines. It occurs when single-byte strings (such as ISO-8859-1 or Windows-1252) undergo case transformation (e.g. upcase), where character expansion leads to a one-byte heap buffer overflow.
Are UTF-8 strings affected by this bug?
No. The heap buffer calculation bug specifically resides in the C routines handling single-byte character sets (such as ISO-8859-1, Windows-1252, etc.). However, in web frameworks like Rails, attackers can supply request content with specific charset headers, causing the framework to interpret input strings in single-byte encodings and trigger the vulnerability.
Can attackers exploit this pre-authentication?
Yes. In typical web architectures running Puma, Unicorn, or Passenger, parameters from HTTP headers, query strings, and multipart form uploads are processed and case-normalized by middleware or routing before user session verification or authentication logic executes.
What is the immediate zero-downtime mitigation?
If an immediate interpreter upgrade is delayed, insert Rack middleware at the top of your stack that inspects incoming requests and rejects or converts any request containing non-UTF-8 character encodings. Additionally, ensure application servers are restarted after applying OS package updates so that the running worker processes load the patched Ruby binary.
How does bspeka scan for Ruby RCE vulnerabilities?
bspeka performs non-intrusive external reconnaissance. It analyzes web server response headers (Puma, Passenger, Unicorn), identifies Rails framework fingerprints and session signatures, checks runtime versions, and alerts you to exposed and unpatched Ruby hosts without crashing running applications.

Audit Your Perimeter for Ruby2Shell & Regex RCE

Ensure your Ruby on Rails applications, Puma listeners, and API endpoints are protected against CVE-2026-132825 with continuous automated monitoring from bspeka.

Start 14-Day Free Audit