Ruby2ßhell runs code on stock Rails before login, and a JVM fix waited two months

4 hours ago

A one-byte overflow in Ruby's case conversion lets anyone run code on a stock Rails app without logging in, and the fix is a Ruby upgrade. Also from Thursday's Hacker News front page: a JVM Base64 fix that waited two months to merge, PHP 8.6, and Zerodha's blob store on SQLite. Ruby2ßhell: Pre-authentication RCE on stock Rails, by Veria Labs https://verialabs.com/ruby2shell/ Discussion: https://news.ycombinator.com/item?id=50556287 Multiple vulnerabilities in Regexp and String case conversion, the Ruby security advisory https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/ Discussion: https://news.ycombinator.com/item?id=50554038 Someone reported java4shell bug in September 2026 (OpenJDK pull request 32781) https://github.com/openjdk/jdk/pull/32781 Discussion: https://news.ycombinator.com/item?id=50558906 black3r on Oracle asking the author to hold the fix: https://news.ycombinator.com/item?id=50562104 The Adoptium issue it quotes: https://github.com/adoptium/adoptium-support/issues/1480 What's New in PHP 8.6 https://www.php.net/releases/8.6/en.php Discussion: https://news.ycombinator.com/item?id=50557870 williamdclt on partial function application: https://news.ycombinator.com/item?id=50560160 Distributed, high-performance blob storage on SQLite, by Sarat Chandra at Zerodha https://zerodha.tech/blog/high-performance-distributed-blob-storage/ Discussion: https://news.ycombinator.com/item?id=50557537 CyrusGrissom on replication: https://news.ycombinator.com/item?id=50558304

Ask about this presentation

Chapters

  1. 0:00Ruby2ßhell runs code on stock Rails
  2. 0:24Upgrade Ruby itself
  3. 0:56Upcasing ß overflows by one byte
  4. 1:25GitLab and GitHub Enterprise wait for a fix
  5. 1:47The JVM's Base64 fix waited two months
  6. 2:22PHP 8.6 partial function application
  7. 2:52Zerodha's blob store on SQLite
Show transcript
  1. On Thursday's HN front page, a bug in how Ruby changes the case of text lets a stranger run their own code on a stock Rails app, with no account. It has been in Ruby since version 2.4. Also on the page: a Java crash fix that waited two months to merge, PHP 8.6, and a stockbroker's blob store built on SQLite.

    Slide text

    Ruby2ßhell runs code on stock Rails before login, and a JVM fix waited two months

  2. Ruby2ßhell reaches Rails and classic-style Sinatra in their default setup, so if you run either one, upgrade the Ruby underneath it. Each supported line has a patch release out. Ruby 3.2 and older are past end of life and stay vulnerable. The same releases fix six more memory bugs, most of them in the regular expression engine, which matter to any app that compiles a pattern a user typed. A working exploit for stock Rails goes public on November 25th.

    Slide text

    Ruby2ßhell is fixed by a new Ruby, and a Rails upgrade alone does nothing

    Ruby 4.0
    4.0.10
    Ruby 3.4
    3.4.13
    Ruby 3.3
    3.3.14
    Ruby 3.2 and older
    End of life, no fix
    Rails · exposed by default Sinatra classic · exposed by default Plain Rack · not by default
  3. Most of Ruby's single-byte encodings, Windows-1252 among them, have no capital sharp S. So upcasing one writes two letters, double S, while the loop checks for room one byte at a time. The output buffer gets twenty spare bytes, so a string with twenty-one of them writes one byte past the end. Swapping or folding case reaches the same loop. Strings in UTF-8 take a different path and are safe.

    Slide text

    Upcasing ß writes two bytes where Ruby checked room for one

    # Windows-1252, ISO-8859 and friends
    "ß".upcase                 # => "SS"
    buffer = input + 20 bytes
    ("ß" * 21).upcase          # 1 byte past the end
    upcase swapcase downcase(:fold) casecmp? UTF-8 · not affected
  4. Self-hosted apps that bundle their own Ruby ignore the one on the server, so the fix has to come from the vendor. Mastodon, OpenProject and Discourse have shipped one. GitLab, GitHub Enterprise Server and Chatwoot are still vulnerable in every current version, six days before the exploit is due.

    Slide text

    GitLab and GitHub Enterprise Server ship their own Ruby, and have no fix yet

    GitLab
    19.6.0 and earlier · no fix yet
    GitHub Enterprise Server
    3.22.5 and earlier · no fix yet
    Chatwoot
    4.20.0 and earlier · no fix yet
    Mastodon
    Fixed in 4.7.6
    OpenProject
    Fixed in 17.9.8
    Discourse
    Fixed base image
    Status at 23:59 UTC, November 19
  5. The bug now called java4shell is in the JVM's fast Base64 decoder for x86 chips with AVX-512. A malformed input with a short tail makes it write past its output buffer and corrupt the heap. Albert Yang, an OpenJDK developer, posted a fix in September, linked to crash reports from June. On October 1st, Oracle asked Yang to hold the pull request. Oracle's own fix, with Yang as co-author, merged on November 16th, under the title Base64 optimization improvements.

    Slide text

    The fix for the JVM’s Base64 heap overflow waited two months to merge

    Jun 9
    JVM crashes reported
    Sep 9
    Fix posted to OpenJDK
    Oct 1
    Oracle asks to hold it
    Nov 4
    Pull request closed
    Nov 16
    Oracle’s fix merges

    “Got an email from Oracle asking me to NOT proceed with a PR until receiving approval.”

    — albertnetymk, October 1
  6. PHP 8.6 adds partial function application. Put a question mark where an argument goes, and the call hands back a closure that waits for it, so the arrow function goes away. The release also adds a polling API on epoll and kqueue, which lets PHP event loops get past the old limit of about a thousand connections. In the thread, williamdclt likes partials but worries that one now looks almost exactly like a function call.

    Slide text

    PHP 8.6 lets you pass some arguments now and the rest later

    PHP 8.5
    array_filter($versions, fn ($v) => version_compare($v, '8.6', '>='));
    PHP 8.6
    array_filter($versions, version_compare(?, '8.6', '>='));
    Io\Poll · epoll, kqueue \Time\Duration clamp() SortDirection
  7. The trading platform Zerodha saves chart layouts and workspaces for about twenty million customers. Its new server, Blobasaur, is written in Rust and speaks the Redis protocol, so every service kept its client library. SQLite allows one writer per file, so each node spreads keys across many files and compresses every blob first. Three small nodes keep latency near two milliseconds through a whole trading session. In the thread, CyrusGrissom points out that the post never mentions replication.

    Slide text

    Zerodha put its blob store on SQLite files and kept its Redis clients

    16 shards vs 1
    3.3× the write throughput
    Average payload
    63.6 KiB sent, 5.5 KiB stored
    Production
    3 nodes, p99 about 2 ms all trading day
    Not built yet
    Automatic failover, live rebalancing

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built with ❤️ in New York