Critical Ruby Flaw Exposes Default Rails and Classic-Style Sinatra Apps; Cloudflare Adds WAF Rules
Brief
ruby2shell can expose default Rails and classic Sinatra applications to pre-authentication code execution. Cloudflare has enabled WAF rules, but says upgrading Ruby is the only complete fix.
Who is affected
- Affected versions include Ruby 3.3.13 and earlier, 3.4.0–3.4.12, and 4.0.0–4.0.9; the bug has reportedly existed since Ruby 2.4.0.
- Rails and classic-style Sinatra are exposed in their default configurations. Other code may also be affected if it changes attacker-controlled strings in legacy single-byte encodings.
- Ruby 3.3.14, 3.4.13, and 4.0.10 fix ruby2shell and six other memory-safety flaws.
Cloudflare protection and next steps
- Cloudflare added blocking rules for ruby2shell and related integer overflow GHSA-87fm-7w84-j2px to its Free and paid managed rulesets. The Free rules run automatically; paid users should confirm the managed ruleset is deployed.
- Cloudflare warns that the WAF cannot cover traffic that bypasses it or other inputs such as email, file imports, queues, and background jobs.
- Upgrade Ruby, restart Ruby processes, rebuild container images, and update self-hosted products that bundle affected Ruby. Ruby 3.2 and earlier are end-of-life and will not receive this fix.
Generated by AI from the original article. Check the source for full details.