thethreatdeskFiled from the front lines of cybersecurity
VulnerabilitiesCritical

Ruby2Shell: a one-byte overflow in Ruby may expose default Rails apps

Ruby 4.0.10, 3.4.13 and 3.3.14 fix seven memory bugs. Researchers say the worst, CVE-2026-132825, is reachable without login in default Rails and Sinatra apps.

The Ruby core team has released Ruby 4.0.10, 3.4.13 and 3.3.14 to fix seven memory-safety bugs in the interpreter's regular expression engine and its string case conversion code. Three are rated critical, and the maintainers say proof-of-concept code shows some of them can be used to run code.

Ruby2Shell

The one drawing the most attention is CVE-2026-132825, a one-byte heap overflow that happens when Ruby changes the case of text in single-byte encodings such as ISO-8859-1 or Windows-1252. Veria Labs, which named it Ruby2Shell, says the bug can be reached without authentication in default Rails applications and classic Sinatra apps, through the way Rack handles incoming requests. That claim comes from the researchers, not the Ruby maintainers. Veria says it will release its exploit about a week after disclosure, so the window to patch is short.

The other bugs

Only Ruby2Shell has a CVE so far. The others are tracked by GitHub advisory IDs. Credit for four of the findings goes to Ada Logics and Anthropic. No attacks have been reported.

Patch the interpreter, not just gems

Updating Rails or other gems does not help here. The fix is in Ruby itself, so app servers, background workers and container base images all need the new interpreter, followed by a restart or rebuild. Ruby 3.2 and earlier are end-of-life and will not get fixes. Teams should also look at code that builds regular expressions from user input.

Who's affected

Teams running Ruby 3.3, 3.4 or 4.0, especially internet-facing Rails and Sinatra apps, and anyone shipping Ruby in container images.

What to do

Upgrade to Ruby 4.0.10, 3.4.13 or 3.3.14, rebuild images and restart app servers and workers before the public exploit lands. Retire Ruby 3.2 and older.

Tracked flaws:CVE-2026-132825