Ruby Patches Ruby2Shell Heap Overflow; Remote Exploitation Depends on Application Conditions

· Original article ↗

Summary

Ruby fixed CVE-2026-132825, a one-byte heap overflow in case conversion for certain legacy encodings. RCE has been demonstrated in some scenarios, but exploitability varies; fixed releases are Ruby 3.3.14, 3.4.13, and 4.0.10.

Key points

  • Ruby2Shell affects case conversion of specially crafted strings in certain legacy single-byte encodings, including ISO-8859-1 and Windows-1252; UTF-8 uses an unaffected code path.
  • The flaw can write one byte beyond the heap buffer when ß expands to SS during conversion. A Veria Labs example uses 21 sharp-s characters.
  • Ruby maintainers say proofs of concept have achieved remote code execution in some scenarios. Exploitability depends on the application and runtime; the main Veria Labs remote exploit had not been publicly released in the article.
  • Fixed releases are Ruby 3.3.14, 3.4.13, and 4.0.10. Ruby 3.2 and older are end-of-life and will not receive upstream fixes.
  • Rails and classic-style Sinatra may expose the vulnerable path by default on affected releases; other frameworks may require application code to process attacker-controlled strings through the relevant conversion.
  • Upgrade and verify the Ruby runtime actually used by applications, containers, workers, and bundled products. Use vendor-provided updates for products that embed Ruby.
  • The article recommends monitoring for crafted legacy-encoded requests, Ruby worker crashes, unexpected child processes, and outbound connections; these are detection suggestions, not confirmed indicators of exploitation.

Article Details

Vulnerability Types
  • One-byte heap-based buffer overflow
  • Memory corruption
Severity
Ruby project advisory: Critical; CVSS 3.1: 7.4 (High)
Affected Versions
  • Ruby 4.0.0–4.0.9
  • Ruby 3.4.0–3.4.12
  • Ruby 3.3.13 and earlier
  • Ruby 3.2 and older, including versions back to 2.4.0
Exploitation Status
reported
Exploit Availability
claimed_or_private
Patch Status
available
Workarounds
  • Avoid attacker-controlled input in vulnerable legacy encodings.
  • Strictly normalize external strings to UTF-8 before affected case-conversion operations.
  • Where no vendor fix is available, temporarily restrict public exposure with a VPN or reverse-proxy allowlist.

MITRE ATT&CK

CVE

People

Products

Related Articles