On November 18 Ruby published security advisories for seven vulnerabilities in its regular expression engine and string case conversion, with known PoCs showing some can lead to remote code execution, and released Ruby 4.0.10, 3.4.13 and 3.3.14 to fix them. Security engineer Moritz Sanft then published the details on his blog and on X: he asked Codex to map the CRuby pre-authentication attack surface reachable from Rails, and in under 24 hours Codex returned several bugs, two of which he says yield pre-auth RCE in many Ruby on Rails apps, with a plain rails new app already exploitable. OpenAI security staff helped with exploitation and coordinated disclosure, and OpenAI president Greg Brockman shared the post on X.
Key Takeaways
- ✓Official: Ruby fixed seven vulnerabilities in its regex engine and string case conversion, with known RCE PoCs for some
- ✓Versions: affected are 3.3.13 and earlier, 3.4.0 to 3.4.12 and 4.0.0 to 4.0.9; upgrade to 4.0.10, 3.4.13 or 3.3.14, as Ruby 3.2 and earlier are end of life and get no fix
- ✓Codex: Sanft had Codex map the Rails-reachable pre-auth attack surface, got bugs back in under 24 hours, and had an end-to-end exploit on a toy app by October 26
- ✓Attack path: Rack lets a multipart _method field override the request method and calls upcase on it, and the charset key picks the encoding, which triggers the heap overflow
- ✓Mitigation: the integer overflow only affects Rack 3.2.1 and earlier since Rack 3.2.2 caps multipart field size; OpenAI also invited WAF vendors to help defend
Key Decision Metrics at a Glance
Turn your technical choice into a development budget
Compare 40 dev plans & simulate token costs vs $20/mo subscriptions
Project Links & Resources
Direct AccessIn-Depth Technical Analysis
Background
After the PHP and Node bugs, security engineer Moritz Sanft wanted to look at Ruby, another language often exposed to the internet. He started on October 23, asked Codex to map the CRuby pre-authentication attack surface reachable from Rails, and triaged and steered its findings himself. In under 24 hours Codex came back with several bugs, two of which he says yield pre-auth remote code execution in many Ruby on Rails apps, with a plain rails new app already exploitable.
How the bugs work
Bug one (GHSA-34m4-m9fh-gqp5): the ISO-8859 family and several Windows encodings have no capital sharp s, so uppercasing it becomes two characters, while the buffer assumes a one-to-one mapping, giving a one-byte heap out-of-bounds write. Bug two (GHSA-87fm-7w84-j2px): rb_str_casemap keeps an intermediate length in an int, and certain Greek characters that expand on case mapping overflow it, causing an out-of-bounds write of about 4GB. Rack lets a multipart _method field override the request method and calls upcase on it, and the charset key picks the encoding, so one form field is enough to trigger either bug.
Benchmarks
This is not a benchmark story. Ruby's advisory lists seven vulnerabilities and says known PoCs show some can lead to RCE. Four are credited to Stephan Lipp (Ada Logics) and Anthropic, including GHSA-34m4, which Sanft says he found independently. Timeline: an exploit against a toy app on October 26, then OpenAI's Sylvie demonstrated RCE on a plain rails new app on November 5, and OpenAI's security team sent reports and working exploit proofs to the Ruby maintainers.
What developers should do
Affected versions are Ruby 3.3.13 and earlier, 3.4.0 to 3.4.12 and 4.0.0 to 4.0.9. Upgrade to 4.0.10, 3.4.13 or 3.3.14 now; Ruby 3.2 and earlier are end of life and will not be fixed. The integer overflow only affects Rack 3.2.1 and earlier because Rack 3.2.2 caps multipart field size, so upgrading Rack helps too. OpenAI has also invited WAF vendors to help defend against exploitation.
Benchmark side-by-side against alternatives, or calculate monthly token cost vs subscription break-even.
Discussion & Comments
0Sign in to join the discussion
Connect with AI developers to exchange benchmark insights.