Ruby2Shell Heap Overflow Exposes Rails and Sinatra Apps to Unauthenticated RCE
Vulnerability Disclosure · 9 sources · Updated 24m ago · First seen Nov 19, 2026

Ruby has patched Ruby2Shell (GHSA-34m4-m9fh-gqp5), a critical one-byte heap buffer overflow in string case conversion that can enable unauthenticated remote code execution. The flaw affects processing of certain legacy encodings; UTF-8 strings follow an unaffected code path. Veria Labs reports that default Ruby on Rails and classic-style Sinatra applications can expose the vulnerable functionality without authentication. Ruby maintainers are aware of proof-of-concept exploits achieving code execution in some scenarios, but sources report no known exploitation in the wild as of November 19, 2026. Researchers plan to publish their exploit in approximately one week.
Fixed Ruby versions are 3.3.14, 3.4.13 and 4.0.10, released November 18; affected Ruby 3.2 and earlier branches are unsupported and will not receive fixes. Identified releases of GitLab, GitHub Enterprise Server, Mastodon, OpenProject, Discourse and Chatwoot bundled vulnerable runtimes, although Discourse updated its Docker base image on November 19. Administrators should inventory and upgrade the Ruby runtime actually loaded by each application—including separately bundled copies—then rebuild affected containers and restart application servers. Where vendor fixes remain unavailable, restrict access to affected self-hosted services to reduce exposure.


