Hacker News
Ruby2ßhell: Pre-authentication RCE on stock Rails
SecurityFirst seen 385 points165 comments
A bug in Ruby, a popular programming language, can let an attacker overwrite memory. It can be reached in default Rails apps, so it may allow remote code execution before login. Fixed Ruby versions are out now.
What happened
Researchers found a memory bug in Ruby's text-handling code. When Ruby changes certain letters to capital letters, it can write past the end of a small memory area. The bug is named Ruby2ßhell. Attackers may use it to run their own code on a server without logging in. Ruby 4.0.10, 3.4.13, and 3.3.14 fix it.
Key numbers and facts
- Affected Ruby versions: 4.0.0 to 4.0.9, 3.4.0 to 3.4.12, 3.3.0 to 3.3.13, and 3.2 and older.
- Fixed versions: 4.0.10, 3.4.13, and 3.3.14.
- The bug has been in Ruby since version 2.4.0.
- The memory overflow is only one byte. It happens when an input has 21 copies of the letter ß.
- GitLab 19.6.0, GitHub Enterprise Server 3.22.5, Mastodon 4.7.5, OpenProject 17.9.7, Discourse 2026.10.1, and Chatwoot 4.20.0 all bundle an affected Ruby.
How the bug works
The letter ß (a German letter) turns into the two letters SS when made uppercase. Ruby's code only checks room for one byte before writing. So the second byte can go past the end of the buffer. A buffer is a block of memory set aside for data. Writing past it can corrupt nearby memory. This only happens in some single-byte text encodings, such as certain ISO-8859 and Windows-125x formats. UTF-8 text is not affected.
Why it matters
Rails is a widely used web framework, and its default setup can reach this bug. That means many websites could be at risk before anyone logs in. Popular self-hosted tools like GitLab and Mastodon also bundle affected Ruby versions. Server owners should upgrade Ruby or install their software vendor's fixed release as soon as possible.
What to watch
- A proof of concept (a demo showing the attack) is planned for release in about one week.
- Vendors such as GitLab, GitHub, and Discourse will ship updates with fixed Ruby versions.
- Check your server's Ruby version and upgrade if it is in the affected list.
Glossary
- Ruby
- A programming language used to build websites and web apps.
- Rails
- A popular web framework that helps developers build websites using Ruby.