11/22/2026
Steve

The Ruby Bug Is One Byte. Finding Every Interpreter That Carries It Is the Whole Job.

The patch landed in a day. That is usually the end of the story.

Ruby released 4.0.10, 3.4.13 and 3.3.14 on 18 November, closing seven memory-safety bugs in its regular expression engine and in string case conversion. The advisory went up at midnight UTC on the 19th. By the 20th, GitLab had shipped a critical patch release to self-managed customers. The advice wrote itself: upgrade the interpreter, restart the processes, rebuild the images.

As of 22 November, GitHub Enterprise Server had no release that carried the fix. Not a delayed announcement, not a documented workaround: no fixed version at all. Veria Labs, the firm that named the bug Ruby2Shell, was still listing 3.22.5 as vulnerable on its tracking table at 03:52 UTC on 21 November, with the fixed-release column reading "None".

That gap is the story, and it is not really about Ruby.

A letter that is two letters

German has a character, ß, whose uppercase form is two characters, SS. Ruby's case-conversion loop allocates an output buffer the length of the input plus 20 bytes, then walks the string checking that there is room for one more byte. When it meets ß, it writes two.

Do the arithmetic with 21 of them in an ISO-8859-1 string. The input is 21 bytes, the buffer is 41, the output is 42. One byte lands past the end, and the byte is always S. Veria's write-up shows the loop checking room for one byte and then writing SS anyway. The fix is commit d582f8f in ruby/ruby.

The primitive has been in the code since Ruby 2.4.0, which shipped on Christmas Day 2016. It is reachable through upcase, swapcase, downcase(:fold) and casecmp?, across 14 single-byte encodings: ISO-8859-1, -2, -3, -4, -9, -10, -13, -14, -15, -16, and Windows-1250, -1252, -1254, -1257. UTF-8 takes a different path and is clean. So does capitalize, which is easy to confuse with the vulnerable calls.

Ruby rated the bug Critical. Four of the seven issues in the same release were reported by Stephan Lipp of Ada Logics and Anthropic. Veria says it found the case-conversion primitive independently and was first to demonstrate remote code execution, and credits Moritz Sanft, working with OpenAI, among the additional discoverers.

Why a stranger gets there before login

Most Ruby applications are UTF-8 from the socket to the database, so the obvious question is how a Latin-1 string ever reaches an upcase call without the application asking for one.

The framework asks for one. HTML forms can only send GET and POST, so Rails forms that need PUT, PATCH or DELETE carry a hidden _method field, and Rack::MethodOverride upcases it before anything else happens. In a multipart request, each part may declare its own character set, and Rack honours the declaration. The string that gets upcased arrives tagged with whatever encoding the client chose.

Semgrep traced that path at runtime on Rails 8.1 and 7.2, Sinatra 4.2 and 3.2, and Rack 3.2 and 2.2, and confirmed the client's encoding survives to the upcase call. The middleware sits near the top of the stack, which puts it ahead of routing, CSRF protection and authentication. No account, no valid route, no session.

Semgrep stopped short of building an exploit. Veria did not, and its proof of concept for stock Rails is scheduled for 25 November, or later if major vendors have not shipped a fix by then. That conditional matters here: part of the disclosure clock is in GitHub's hands.

There is a second pre-login path that has nothing to do with HTTP method handling. Rodauth's create_account feature compares the login field with its confirmation using casecmp?, which folds both strings. Sign-up is by definition unauthenticated. Semgrep read that from the source and notes it closes if the application disables login confirmation or runs JSON-only.

Removing the middleware does not finish the job either. In Rails, every multipart text parameter keeps the charset the client declared, API-only mode included, so a params[:name].upcase in a controller is the same bug behind a different door. Semgrep also lists what cannot carry it: headers arrive as binary strings under Puma, Unicorn, WEBrick, Thin and Falcon, and JSON bodies, query strings and ordinary URL-encoded forms are UTF-8. A WAF rule hunting repeated %DF in a URL is looking in the wrong place, because the bytes travel raw inside a multipart body.

The inventory problem

Here is why a one-day patch does not produce a one-day fix.

Nothing in a Gemfile changes when you are vulnerable, and nothing changes when you are fixed. Dependency scanners read the lockfile; the bug is in CRuby itself. A host often runs three or four interpreters, because version managers, system packages and products that bundle their own Ruby all install separately. GitLab keeps one in /opt/gitlab/embedded. The one that matters is the one inside the running process, not the one that answers ruby -v in your shell.

Then there is the restart. A Puma worker that started yesterday is still executing yesterday's code until it is replaced, so a patched file on disk is a fix nobody is using. Distribution backports make the version number useless as a signal: Debian, Ubuntu, RHEL and SUSE fold fixes into the version they already ship, and several of them ship Ruby 3.0, 3.1 or 3.2, which upstream will never patch.

And there is no probe. Veria and Semgrep both ran the same 21-character string against ruby:3.4.12 and ruby:3.4.13 and got byte-identical output. Under valgrind, the vulnerable image reports an invalid write of size 1 at case_map in iso_8859_1.c. In production, nothing. You cannot ask a server whether it is patched.

That leaves inventory, and the inventory is mostly other people's release schedules. Six of the seven bugs in this batch still have only GitHub advisory identifiers, so anything keyed on CVE numbers cannot see them at all.

The one product with no fix

GitHub Enterprise Server is the clearest case because of what it is: the system of record for source code at a large company, usually reachable by every engineer, and often reachable from more places than its administrators believe.

GHES 3.22.5 was released on 17 November, a day before the Ruby advisory, and, per Semgrep's checks of the images, bundles Ruby 4.0.9. Its release notes list the high-severity fixes in that build as a set of Git CVEs; the 3.22.4 entry it supersedes lists a critical Active Storage file-read and remote code execution flaw, CVE-2026-66066. Neither mentions a case-conversion fix, and the notes page still listed 3.22.5 as the latest patch as of 22 November. Veria's table, updated on 21 November, still reads "None" for fixed release and "Vulnerable" for status.

The contrast with GitLab is the useful part. GitLab shipped 19.6.1, 19.5.8 and 19.4.10 on 20 November, with the patched Ruby inside its Linux packages and container images, and told anyone who compiles GitLab themselves to rebuild against Ruby 3.3.14 or 3.4.13. It kept the severity rating honest too: Critical, taken from the Ruby team, with a note that MITRE scores the CVE as High at 7.4.

The rest of the self-hosted field moved at different speeds. Chatwoot fixed it in 4.20.1. Mastodon fixed it in 4.7.6, 4.6.12, 4.5.22 and 4.4.29. OpenProject fixed it in 17.9.8 and 17.8.3. Discourse rebuilt its base image on 19 November, which fixes each forum only after that forum is rebuilt. Those four differences are a fair sample of what "patch your dependencies" means when the dependency is an interpreter baked into an appliance.

Three readings of one bug

The scoring argument is worth a paragraph, not a section, but it explains why two companies can look at the same CVE and reach different conclusions about urgency.

Ruby calls it Critical. The CVE record, assigned by MITRE and published on 19 November, carries 7.4 with a local vector and high attack complexity. Amazon rates it 8.1 with a network vector, which is closer to how a Rails application actually experiences it. NVD's record still reads "Received" and carries only MITRE's secondary score, so the number most scanners will eventually display has not been set. EPSS sat at 0.01976 on 21 November, the 81st percentile, up from 0.00174 two days earlier. CISA's SSVC entry lists a public proof of concept; the stock-Rails chain Veria describes is not public until 25 November.

Distribution tells the same story with different numbers. Debian's tracker shows bookworm fixed through DLA-4926-1 and trixie fixed through DSA-6644-1, with forky and sid still vulnerable. Ubuntu lists the CVE at medium priority, every series as "needs evaluation", and no fix as of 20 November. Amazon Linux 2023 shipped fixed packages on 20 November, while the deprecated ruby2.4, ruby2.6 and ruby3.0 topics on Amazon Linux 2 carry "No Fix Planned". Ruby 3.2 and earlier are past end of life and will not receive a fix from upstream at all.

AWS also published three WAF rules for its known-bad-inputs group, aimed at expansion patterns in _method values and multipart bodies, and left them in Count mode because they will match legitimate traffic. That is a reasonable default and a poor timeline: the rules need review before they block anything, and the window between a public proof of concept and a working exploit is the window you are reviewing in.

What patchability costs

The uncomfortable part of this story is that Ruby did almost everything right. Seven bugs, one release, three maintained branches, a clear advisory, a fix commit anyone can read. What it could not do is reach inside the products that bundle it.

For anyone buying or building software, the question that survives the news cycle is not how bad a bug is but which release of the thing you own carries the new interpreter, and when. For GitHub Enterprise Server customers, that question has no answer yet. For the rest, the answer depends on a rebuild, a restart and an inventory most organisations do not have.

The problem gets harder the further the runtime sits from the code you write. The same question applies to any product that ships someone else's stack inside it: the appliance, the controller, the device whose firmware image was frozen at a version number nobody tracks. Patchability is decided at design and procurement time, years before an advisory lands, and it is much cheaper to decide it deliberately than to discover it on a Tuesday.

At DMC we work with hardware companies on those decisions, the ones that determine whether a product can be serviced in year five or has to be forklifted. If you are building something with a third-party runtime in the control path and you want to pressure-test how patchable it will really be, let's talk.