groundy
Security

Pre-Auth RCE in Stock Rails: The ruby2shell Paths Your WAF Never Sees

Ruby 2.0.10 fixes a pre-auth RCE in stock Rails. WAFs are compensating controls, not replacements. Operators must patch the interpreter and inventory bundled runtimes to close

Published 8 references
On this page12 sections

Patch the Ruby interpreter you control, then use network restrictions and WAF rules only to buy time for the runtimes you do not. Ruby disclosed ruby2shell, CVE-2026-132825, on 19 November 2026; the fixed builds are 3.3.14, 3.4.13 and 4.0.10. That ordering matters because the vulnerable operation sits in the interpreter, while several self-hosted products ship their own Ruby and move on their vendor’s release schedule.

The headline needs two qualifications. Veria Labs’ pre-authentication reachability in default Rails and classic Sinatra is self-reported, with the request path still unpublished. Ruby’s Critical rating and RCE proofs of concept are self-reported maintainer claims, limited to “some scenarios.” Neither establishes that every stock Rails application has a working remote exploit. Ethiack reported no public exploit, CISA KEV entry or credible in-the-wild exploitation as of 19–20 November.

The operational conclusion is nevertheless firm. An edge rule can narrow HTTP exposure, but it cannot repair the interpreter or inspect every file, message and job that later reaches case conversion. Cloudflare’s own guidance is unusually direct: “The WAF is a compensating control, not a replacement for patching. Exploits can reach the bug through paths a WAF does not see, and the only complete fix is to upgrade Ruby.” That is vendor guidance scoped to Cloudflare’s WAF, but the underlying limitation applies to any control that sees only part of an application’s input flow.

One byte past a 20-byte margin

Ruby allocates a case-conversion output buffer as the input length plus 20 bytes, according to Ethiack’s technical analysis. In 14 ISO-8859 and Windows-125x encodings, the sharp-s character ß uppercases to the two-byte sequence SS, while the affected code checks room for only one byte. A string containing 21 sharp-s characters therefore writes one byte beyond the buffer. Input length also lets an attacker influence the buffer’s size, Ethiack’s analysis adds.

The reachable operations include upcase, swapcase, downcase(:fold) and casecmp?. UTF-8 strings take a different code path and are not affected by this particular overflow. When upcasing, the overflowing byte is S (0x53); during case folding it is s (0x73). Copying the result also reads one byte out of bounds. Astra reports an independent AddressSanitizer reproduction showing a one-byte heap write onto the next chunk’s size least-significant byte on glibc 2.31.

That reproduction is evidence of memory corruption, not evidence of reliable code execution in an arbitrary production process. The distinction becomes important when assessing the conflicting severity claims below. A small, constrained write can be difficult to turn into RCE while still providing a dependable way to crash a service.

What pre-auth stock Rails reachability actually establishes

Veria’s claim is specific enough to demand immediate inventory: default Rails and classic-style Sinatra reach the flaw before authentication, Veria Labs reports. ComputingForGeeks narrows the Rails statement to middleware loaded by default in every new Rails application, API-only applications excepted. SecurityWeek independently relayed the same unauthenticated-network-reach framing, while still attributing it to Veria Labs.

Other frameworks and plain Rack are not exposed by default, according to Ethiack’s account. Nor does default middleware reachability prove that every endpoint accepts the necessary encoding and passes attacker-influenced bytes into one of the affected operations. Veria has not published the request path, so those application-level preconditions cannot yet be checked against a primary disclosure.

Treat the claim as a reason to examine stock middleware and encoding handling, not as proof of universal Rails exploitability. Oneleet says the known request path involves raw multipart bytes, but that statement still does not publish or independently validate Veria’s complete Rails path.

The disclosure window is short. Oneleet’s timeline has the fixed builds tagged on 18 November, followed by Ruby’s advisory and seven GHSAs on 19 November. Veria says it plans to publish a proof of concept about a week after disclosure, approximately 26 November; ComputingForGeeks records the same plan as 25 November, or later if major vendors have not shipped fixes, in its exploitation timeline. That is a planned release, not a guarantee, but it is a poor reason to postpone work that can be completed now.

Patch the interpreter, not the Gemfile

The affected upstream ranges are Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Upgrade to 3.3.14, 3.4.13 or 4.0.10 respectively. Ruby 3.2 and earlier are end of life and will not receive this fix, so those applications need to move to a supported series, according to Cloudflare’s affected-version guidance.

A bundle update does not accomplish that upgrade. All seven flaws fixed in this release live in the interpreter, as RapidFort explains. The practical checklist is therefore:

  1. Inventory the Ruby inside each running image or deployment, rather than inferring it from application gems or the host.
  2. Update interpreter pins and base images to a fixed build.
  3. Rebuild container images without cached layers that could retain the old runtime.
  4. Restart every Ruby process, including web workers, Sidekiq processes and cron jobs.
  5. Confirm that the running deployment, not merely the package definition or source pin, contains the fix.

UTF-8-only applications should not skip this release. The companion advisory GHSA-87fm-7w84-j2px covers an integer overflow in the same case-conversion code and carries no encoding limit in Ruby’s advisory. Five further flaws in the release affect Ruby’s regular-expression engine. Most require an application to compile or match an attacker-supplied pattern, an uncommon but real pattern in search, filtering and administrative features, Cloudflare notes.

Bundled Ruby inherits the vendor’s clock

A system package update does not repair a self-hosted product that carries its own interpreter, Ethiack warns. For those systems, the relevant artifact is the vendor’s fixed appliance or image, not the operating system’s Ruby package.

ComputingForGeeks performed lab checks on 19–20 November. Its snapshot shows why “Ruby has patched” and “this product is patched” are different statements:

DeploymentReported state on 19–20 NovemberDecision for operators
Alpine 3.22–3.24 and edgeFixed ruby 3.4.13-r0 packages were available, per ComputingForGeeks.Install the fixed package and restart all Ruby processes.
FedoraThe fixed 4.0.10 build was in updates-testing only in the same snapshot.Check the actual package channel and changelog rather than assuming a fixed build is installed.
GitLab Omnibus 19.6.0Lab inspection found bundled Ruby 3.3.13 and no patch release. Omnibus bumps were merged for 19.6 and 19.3, but a merge is not a shipped fixed release.Restrict access to trusted networks until a fixed vendor artifact is available and deployed.
GitHub Enterprise Server 3.22.5 and Chatwoot 4.20.0No fix had been announced in ComputingForGeeks’ checks.Use VPN or IP allowlisting as interim containment; continue to treat the embedded Ruby as vulnerable.
OpenProject 17.9.8The .ruby-version at the v17.9.8 tag, released 19 November, listed Ruby 4.0.10, and the release notes did not mention Ruby, per the lab checks.Inspect the package or image you actually deploy, confirm the interpreter the running service uses, and reconcile it against OpenProject’s own advisory before recording remediation; repository metadata alone does not establish the shipped artifact.
Mastodon 4.7.6Fixed in its Docker images, per the lab checks.Deploy the fixed image and restart the service; installs from source need a fixed Ruby on the host.
DiscourseThe Docker base image moved to Ruby 4.0.10 on 19 November, Cloudflare reports.Confirm the deployed image includes that change rather than relying on the upstream announcement alone.

This status is contested and perishable. SecurityWeek reported on 20 November that Veria described GitLab, Chatwoot, Mastodon, OpenProject and the Discourse base image as having “patched the bug,” while GitHub Enterprise Server remained affected. That account conflicts with the lab-checked GitLab and Chatwoot results. Resolve the discrepancy against each vendor’s advisory and released artifact, not against a version mentioned in secondary coverage.

Distribution packages need the same care. A distributor can backport a fix without changing Ruby’s upstream version number, so a version string alone cannot settle patch status. Oneleet advises searching the package changelog for the CVE and all seven GHSA identifiers.

What the edge removes, and what it does not

Cloudflare shipped two managed rules with Block as the default action on 20 November: one for ruby2shell and one for GHSA-87fm-7w84-j2px. They are in both the Cloudflare Free Managed Ruleset and Cloudflare Managed Ruleset, available to all customers including Free-plan users, according to Cloudflare’s announcement.

That protection is useful for HTTP content a rule can decode and inspect. It has a documented blind spot at the center of this incident. Oneleet says a WAF or IDS rule looking for runs of 21 URL-encoded ß characters cannot see raw bytes in multipart bodies, “which is where the known path is.” The same guidance warns that legitimate Latin-1 text can contain plenty of ß, so rules should run in detection mode first.

The tradeoff is therefore twofold: a rule can miss the raw multipart request path while also blocking legitimate text that matches its signature. Detection mode gives operators a chance to measure false positives before enabling a block action. It does not extend visibility into multipart bytes, non-HTTP imports or subsequent background processing. Nor does Cloudflare’s evidence establish equivalent coverage or false-positive behavior for other WAF products.

For an unfixed bundled product, Oneleet recommends placing self-hosted GitLab, GitHub Enterprise Server and Chatwoot behind a VPN or IP allowlist until the vendor ships a fix. That reduces exposure to untrusted networks; it does not patch the interpreter or address every authenticated, internal or file-based route.

Inventory the paths that never become HTTP requests

The useful unit of analysis is not an open port. It is a data flow in which attacker-influenced bytes eventually reach case conversion. For each flow, establish who controls the input, which encoding it carries, whether it reaches upcase, swapcase, downcase(:fold) or casecmp?, and whether any edge device actually sees the relevant bytes.

Oneleet identifies several candidates beyond ordinary request parameters:

  • CSV and Excel imports, including Excel exports encoded as Windows-1252 (Oneleet’s inventory).
  • Email and MIME parsing.
  • Legacy integrations and EDI feeds.
  • Search or filtering features that construct a Regexp from user input, relevant to the separate regular-expression flaws in the same release.

Queued payloads and background jobs also belong in the audit when they process these files or messages. A web rule cannot inspect a payload that arrives through a mail gateway, integration feed or job producer and is case-folded later by a worker.

This is an inventory hypothesis, not a demonstration that all these routes are practically exploitable. No published reproduction demonstrates a working CSV, mail, EDI or queue exploit. Cloudflare’s own post does concede that exploitation can reach ruby2shell through paths its WAF does not see.

Two code-level controls can reduce exposure while an upgrade is pending, with strict limits. Converting untrusted input to UTF-8 before case conversion addresses this bug’s legacy-encoding code path only if it happens consistently before every affected call. It is not a release-wide exemption because GHSA-87fm-7w84-j2px has no encoding limit. Refusing to compile regular expressions from user input addresses a precondition of the separate regex flaws, not the case-conversion overflow. Neither control substitutes for the interpreter fix.

Why scanners stayed quiet

A clean dependency scan is weak evidence here. Oneleet reports that the NVD record had no CPE, preventing Grype from matching it; Dependabot would not alert; bundler-audit checks gems rather than the interpreter; and Tenable listed the CVE without a plugin yet. Those observations are a point-in-time coverage assessment, not a permanent statement about each tool.

The practical response is to inventory runtime versions directly inside images and bundled products, then reconcile them with vendor advisories and distro changelogs. Gem health and scanner silence cannot supply that missing evidence.

Severity disagreement does not change the patch decision

The MITRE CNA’s self-reported CVSS 3.1 score is 7.4 (High), with vector AV:L/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H. Its local attack vector and high complexity conflict with Ruby’s self-reported Critical rating and Veria’s network-unauthenticated framing. RapidFort’s advice is to plan around the network-reachable assessment until the scores converge.

WatchTowr supplies a useful counterweight to automatic RCE assumptions. Principal threat intelligence specialist Yordan Ganchev told SecurityWeek that production exploitation is “a complete odyssey,” citing memory layout, allocator behavior, runtime configuration, application preconditions and ASLR. WatchTowr expects malformed requests most likely to cause denial of service and service disruption.

Nozomi’s completed product analysis shows why application-specific assessment matters. It found only limited, authenticated impact on Guardian and CMC: an authenticated user could temporarily stop the web interface and appliance synchronization, with self-recovery after the attack. The fix was scheduled for N2OS 26.7, with internal-firewall allowlisting as interim guidance, in Nozomi’s advisory. That result cannot be generalized to Rails, but it contradicts any blanket assumption that every affected Ruby deployment yields pre-auth RCE.

I would not wait for Veria’s public proof of concept or for the severity scores to converge before upgrading a runtime I control. The fixed builds and patch mechanics are clear, and even the more skeptical assessment leaves a credible service-disruption risk. For a bundled product without a confirmed fixed artifact, restrict network access, use HTTP filtering as a time-boxed compensating control and track the vendor release. Do not record that deployment as remediated until its embedded Ruby is actually fixed.

Frequently Asked Questions

Which Ruby versions are fixed for the ruby2shell vulnerability?

The affected upstream ranges are Ruby 3.3.13 and earlier, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9. Upgrade to 3.3.14, 3.4.13 or 4.0.10 respectively. Ruby 3.2 and earlier are end of life and will not receive this fix, so those applications need to move to a supported series, according to Cloudflare’s affected-version guidance.

Does a WAF rule fully protect against ruby2shell exploitation?

Cloudflare’s own guidance is unusually direct: “The WAF is a compensating control, not a replacement for patching. Exploits can reach the bug through paths a WAF does not see, and the only complete fix is to upgrade Ruby.” That is vendor guidance scoped to Cloudflare’s WAF, but the underlying limitation applies to any control that sees only part of an application’s input flow.

What should operators do for self-hosted products that bundle their own Ruby interpreter?

A system package update does not repair a self-hosted product that carries its own interpreter, Ethiack warns. For those systems, the relevant artifact is the vendor’s fixed appliance or image, not the operating system’s Ruby package.

References

Follow the links in the article for context. The supporting material is collected here for further reading.

  1. ruby2shell WAF protectionblog.cloudflare.comAccessed
  2. CVE-2026-132825 ruby2shell RCE via heap overflowethiack.comAccessed
  3. ruby2shell security advisorygetastra.comAccessed
  4. ruby2shell cve-2026-132825 check patchcomputingforgeeks.comAccessed
  5. Ruby patches ruby2shell vulnerabilitysecurityweek.comAccessed
  6. ruby2shell cve-2026-132825oneleet.comAccessed
  7. ruby2shell cve-2026-132825 ruby containersrapidfort.comAccessed
  8. ruby2shell advisorysecurity.nozominetworks.comAccessed

Join the discussion

Share a useful perspective or ask a question about this article.

Discussion guidelinesComments privacy