Back Heise.De ruby2ßhell: Remote code execution through 21 ß characters
This week, not only PHP admins , Java users and operators of WordPress and Nginx need to install updates. The programming language Ruby is also shipping a fix for a vulnerability rated Critical. Researchers at the penetration testing and security research firm Veria Labs named it ruby2ßhell, after php2shell, which kept website operators busy a few weeks ago.
In a refreshingly brief blog post, Veria Labs describes the problem: Affected Ruby versions contain a bug in how they process the ß character. An application written in Ruby is vulnerable if it uses the ISO-8859 or Windows-125x character sets and applies functions that change the case of strings. The researchers cite upcase , swapcase , downcase(:fold) and casecmp? as specific functions. The problem: When converting a string containing ß to uppercase, ß becomes SS — making the output one character longer. Internally, Ruby’s function reserves memory for the output equal to the input length plus 20 bytes of buffer space. So exploiting ruby2ßhell requires only passing a string containing 21 or more ß characters. The program then writes outside the reserved memory area and can potentially change other values in memory. This is not a complete attack, but — if exploited cleverly — it provides a starting point for remote code execution on the server. Specific attacks must be developed individually for each Ruby application.
Veria Labs has not provided proof-of-concept code for widely used Ruby software, but says it will do so in a week. The researchers say the Ruby frameworks Rails and Sinatra (classic style) are affected by the problem with their default settings. They also list common software written in Ruby and available for self-hosting, including GitLab, GitHub Enterprise, Mastodon and OpenProject. Operators of such applications should update quickly.
The Ruby team has released versions 3.3.14 , 3.4.13 and 4.0.10 , which fix the problem. No CVE number has been assigned yet, but Ruby has already published a security advisory .
This article was originally published in German . It was translated with technical assistance and editorially reviewed before publication.
The full story
This article is one source in a clustered incident — the cluster page carries the summary, timeline and every other outlet covering it.
