Critical Ruby Heap Overflow Enables Unauthenticated RCE

AI-generated image · Bay Street Wire
A one-byte overflow in Ruby's string case conversion exposes Rails and Sinatra users to remote code execution in default configurations.
A critical vulnerability in the Ruby programming language allows for remote code execution (RCE) via a one-byte heap overflow, as Veria Labs first reported. The flaw exists in Ruby's string case conversion, specifically when handling certain single-byte encodings where upcasing the character 'ß' writes two bytes while the loop only performs a one-byte bounds check.
Veria Labs reports that the vulnerability is reachable without authentication in the default configurations of the Rails and Sinatra (classic style) frameworks. While other frameworks and plain Rack are not exposed by default, application code that upcases strings received in legacy encodings may still be vulnerable. The issue has existed since Ruby version 2.4.0.
Beyond frameworks, several popular self-hosted software packages bundle affected Ruby versions. Veria Labs identifies the following as affected:
* **GitLab 19.6.0** (Ruby 3.3.13) * **GitHub Enterprise Server 3.22.5** (Ruby 4.0.9) * **Mastodon 4.7.5** (Ruby 4.0.9) * **OpenProject 17.9.7** (Ruby 4.0.9) * **Discourse 2026.10.1** (Ruby 3.4.7) * **Chatwoot 4.20.0** (Ruby 3.4.4)
Remediation requires upgrading Ruby to versions 3.3.14, 3.4.13, or 4.0.10, or installing the fixed releases provided by software vendors. Veria Labs notes that UTF-8 strings are not affected as they utilize a different code path.

