Technology1 min read

Ruby2ßhell: Pre-authentication RCE on stock Rails

By · Published by Everything Blog

In short

The vulnerability, tracked as GHSA-34m4-m9fh-gqp5, stems from a single-byte heap overflow triggered during string case conversion routines in specific ISO-8859 and Windows-125x encodings. Default setups of Ruby on Rails, classic Sinatra, and bundled distributions like GitLab, Discourse, and GitHub Enterprise Server are fully exposed to remote code execution. Supplying 21 instances of the German "ß" character causes the engine to write two bytes while only verifying space for one. Systems must be upgraded to Ruby 3.3.14, 3.4.13, or 4.0.10 to prevent compromise.

Key points

  • Default deployments of major platforms including GitLab, Mastodon, OpenProject, and GitHu…: Default deployments of major platforms including GitLab, Mastodon, OpenProject, and GitHub Enterprise Server face immediate remote code execution risks.
  • Administrators should urgently upgrade their environments to Ruby versions 3.3.14, 3.4.13…: Administrators should urgently upgrade their environments to Ruby versions 3.3.14, 3.4.13, or 4.0.10 to remediate the vulnerability.
  • Security teams have a one-week remediation window before a functional proof-of-concept ex…: Security teams have a one-week remediation window before a functional proof-of-concept exploit is scheduled to be publicly released.

Sources checked by our analysis pipeline: 1

ruby2ßhell

A one-byte heap overflow to remote code execution in Ruby's string case conversion. Reachable without authentication in the default configuration of common Ruby web frameworks and self-hosted software.

- Severity

- Critical

- Fixed in

- 3.3.14, 3.4.13, 4.0.10

- Access needed

- Network, no authentication

- Advisory

- GHSA-34m4-m9fh-gqp5 CVE pending

Affected software

Ruby versions

Ruby series | Affected | Fixed in |

---|---|---|

4.0 | 4.0.0 to 4.0.9 | 4.0.10 |

3.4 | 3.4.0 to 3.4.12 | 3.4.13 |

3.3 | 3.3.0 to 3.3.13 | 3.3.14 |

3.2 and older | All releases back to 2.4.0 | EOL |

Your deployment

The bug is reachable from the following frameworks in their default configuration. Other frameworks are not exposed by default, but application code that upcases strings received in a legacy encoding may also be vulnerable.

Framework | Status on an affected Ruby |

---|---|

Rails | Affected |

Sinatra (classic style) | Affected |

Other frameworks and plain Rack | Not exposed by default |

Self-hosted software

The latest version of the following popular software bundles an…

Technology