Skip to content
OriginalNewsSecurity

One German letter can take over a Ruby web app

Ruby patched seven memory-safety flaws, led by CVE-2026-132825, a one-byte heap overflow in string case conversion that researchers say is reachable without login in default Rails and Sinatra apps. The fix is Ruby 3.3.14, 3.4.13 or 4.0.10.

An infrared photograph of a fern frond forking into two stems against a pale ivory sky, the fronds rendered in dusty rose and magenta above dark green shadow
A fern frond splitting into two stems: one letter becoming two characters, one byte past the end of the buffer.
On this page

In brief

  • Ruby 4.0.10, 3.4.13 and 3.3.14 fix seven memory-safety flaws disclosed Nov 18, including the critical Ruby2Shell heap overflow.
  • CVE-2026-132825 is a one-byte heap overflow: upcasing the German sharp s writes two bytes where Ruby checked room for one.
  • Veria Labs says default Rails and classic Sinatra apps are reachable without login, because Rack upcases a form field before any app code runs.
  • Ruby 3.2 and earlier get no fix. GitHub Enterprise Server had no fixed release as of Nov 21; GitLab, Mastodon, Discourse and Chatwoot have shipped theirs.
  • No exploitation in the wild had been reported as of Nov 19, but Veria Labs plans to publish a proof of concept on Nov 25.

The German letter ß has no capital form in the single-byte encodings Ruby still supports. When Ruby changes its case, the letter becomes two characters, SS. The code that does the conversion checked for room for one. That one-byte mistake is now CVE-2026-132825, and researchers say it hands an unauthenticated attacker remote code execution on a default Rails application.

Ruby shipped the fixes on November 18, in versions 4.0.10, 3.4.13 and 3.3.14, and published the advisory the next day. The flaw it calls critical is one of seven memory-safety bugs in the same release, all of them in Ruby's own code, which means every application on an affected version carries them. Ruby says it knows of proofs of concept that turn some of them into code execution. One research group, Veria Labs, says it will publish its own proof of concept on November 25.

One byte past the end

Ruby strings carry an encoding, and Ruby still supports the legacy single-byte encodings alongside UTF-8: ISO-8859-1, Windows-1252 and a dozen relatives. In these encodings each character takes one byte, so changing the case of a string usually produces output of the same length. The sharp s breaks that assumption. Its uppercase form is two characters, and in 14 of these encodings Ruby writes both bytes while checking for room for only one.

Veria Labs, which found the flaw independently and was first to demonstrate code execution from it, describes the arithmetic plainly. The output buffer is allocated as the input length plus 20 bytes. Each ß adds one byte to the output, so a string with 21 of them overflows the buffer by one byte. The byte written past the end is the letter S. The attacker controls the size of the buffer through the length of the input, and copying the result out of the buffer then reads one byte out of bounds. The same loop sits in several encodings and has been there since Ruby 2.4.0. The methods that reach it are upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different code path and are not affected.

One byte sounds like nothing. Heap overflows of a single byte have been turned into code execution before, and Ruby's own advisory says it is aware of proofs of concept that do exactly that here, in some scenarios. The researchers' name for the flaw, Ruby2Shell, is a deliberate echo: Java4Shell, a Base64 flaw in OpenJDK that could take over a Java server, was disclosed days earlier.

The framework does it for you

The reach is what makes this flaw different from an ordinary library bug. In a default Rails application, the vulnerable conversion happens before any of the application's own code runs, and before any authentication check.

HTML forms can only send GET and POST requests. To simulate PUT, PATCH or DELETE, frameworks accept a _method parameter in a POST request. Rack, the interface most Ruby web frameworks build on, implements this in its MethodOverride middleware, which converts the value of _method to uppercase. Rails includes that middleware by default, and classic-style Sinatra applications enable it too. An attacker sends a multipart POST request whose _method part declares a legacy character set and contains a run of sharp s characters. The framework upcases the value while it is still routing the request.

Moritz Sanft traced that path through Rack in an analysis published the same day, in collaboration with OpenAI. Veria Labs reports that other frameworks and plain Rack applications are not exposed by default, though application code that changes the case of strings received in a legacy encoding may still be affected, wherever the string comes from.

Seven flaws, three of them critical

The case-conversion overflow is the worst of the batch, but it is not alone. Ruby's advisory lists seven vulnerabilities, three critical, three high and one moderate, according to The Hacker News. Two are in case conversion: the critical heap overflow and a high-severity integer overflow in the same code, GHSA-87fm-7w84-j2px, which also ends in a heap overflow. The other five are in the regular expression engine: a double free in pattern compilation, a heap overflow in compilation, a heap overflow in Regexp#to_s, and two out-of-bounds reads in case-insensitive matching.

Only the critical case-conversion flaw had a CVE number at disclosure. Ruby says it has requested identifiers for the rest, and until they are assigned, the GitHub advisory IDs are the only way to track the other six. The affected versions are Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Ruby 3.2 and earlier have reached end of life and will not receive the fix.

Credit for the findings goes to Stephan Lipp of Ada Logics and Anthropic, who reported four of the seven, and to baba__yaga, aphantom, Hiroya Fujinami and Hiroshi Shibata for the others. Sanft's work on the Rails reach was done with OpenAI.

Who is exposed, and what to do

The fix is the upgrade: Ruby 3.3.14, 3.4.13 or 4.0.10, depending on the branch you run. Rebuild container images and restart application processes so the fix is actually active. The harder cases are the products that bundle their own Ruby, where the fix has to come from the vendor. Veria Labs tracks those, and as of its November 21 update the picture is mostly good: GitLab shipped fixed releases in 19.6.1, 19.5.8 and 19.4.10, Mastodon in 4.7.6 and earlier branches, OpenProject in 17.9.8, Discourse in a new base image, Chatwoot in 4.20.1. The exception is GitHub Enterprise Server, where version 3.22.5 and earlier are still vulnerable and no fixed release exists yet.

No exploitation in the wild had been reported as of November 19, and the flaw is not in CISA's Known Exploited Vulnerabilities catalog. Cloudflare and CrowdSec have both shipped firewall rules that block the exploit request, and Cloudflare's own note says what matters: the firewall rule is a compensating control, not a replacement for patching, because exploits can reach the bug through paths a firewall does not see.

One number deserves a second look. NVD scores the flaw 7.4, according to CrowdSec's write-up, a high rather than critical rating, while Ruby calls it critical. The difference is the reach: a score measures the bug, and Ruby's rating measures the bug in the applications people actually run, where the framework performs the dangerous operation on an unauthenticated request. Act on Ruby's rating.

Veria Labs will publish its proof of concept on November 25, or later if major vendors have not shipped a fix by then. The patched Ruby releases have been out since November 18. The week between disclosure and a public exploit is the window to use.

Related reporting

More from grep.tips

All articles