Ruby2Shell (GHSA-34m4-m9fh-gqp5)

17 points by bezdomni 10 hours ago on lobsters | 5 comments

UTF-8 strings take a different code path and are not affected.

So, it is pretty much a nothingburger?

patrickthomson | 4 hours ago

Ruby bends over backwards to hide the details of string encoding from the user, and to interpret them in a way that keeps control flow going. Correct Ruby string handling entails a lot of force_encoding! at interface boundaries. So I think if you specified one of the affected encodings in something like a Content-Encoding header, you could hit this path pretty easily (probably as part of Rack internals), though I don't know anything about how one would get shell after that.

Source: long, long ago I helped implement the String class for a Ruby implementation, and it was one of the most maddening specs I've ever had to work with. "Strings are mutable blobs of bytes with a mutable tag describing their interpretation" is the wrong design, as Python learned.

byroot | 2 hours ago

No, it's very real, because Rack allow to send strings in arbitrary encodings via multipart chunks.

This behavior is likely to be removed from future versions of rack (currently in review). I already added a feature in Rails to monkey patch it out.

Now this only allow triggering a single byte of overflow, but it's kinda crazy how agents are capable of turning that into an actual RCE.

LeahNeukirchen | 6 hours ago

Supposedly, it's triggerable in a Rails default configuration. But I'm not sure yet how...

mperham | 4 hours ago

pretty much a nothingburger?

Vacuous hype seems to be the story of most of these security alerts.