{"id":50361,"date":"2026-11-19T13:18:37","date_gmt":"2026-11-19T07:48:37","guid":{"rendered":"https:\/\/www.getastra.com\/blog\/?p=50361"},"modified":"2026-11-19T13:18:44","modified_gmt":"2026-11-19T07:48:44","slug":"ruby2shell","status":"publish","type":"post","link":"https:\/\/www.getastra.com\/blog\/security-advisory\/ruby2shell\/","title":{"rendered":"Ruby2shell: Critical Ruby Heap Overflow, Who Is Affected, and How to Fix It"},"content":{"rendered":"\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\"><strong>Last updated:<\/strong> November 19, 2026, 12:49 PM IST. ruby2shell is an evolving situation.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"TLDR\"><\/span>TLDR;<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>ruby2shell is a one-byte heap buffer overflow (GHSA-34m4-m9fh-gqp5) in Ruby\u2019s case conversion of strings in single-byte encodings such as ISO-8859-1 and Windows-1252.<\/li>\n\n\n\n<li>Ruby rates it Critical. A CVE ID is pending and no CVSS score is published yet.<\/li>\n\n\n\n<li>Ruby maintainers know of proof-of-concept exploits (PoCs) that achieve RCE in some scenarios. A public PoC is planned about a week after disclosure.<\/li>\n\n\n\n<li>Affected: Ruby 3.3.13 and earlier, 3.4.0 to 3.4.12, and 4.0.0 to 4.0.9. Fixed in 3.3.14, 3.4.13, and 4.0.10.<\/li>\n\n\n\n<li>Action: upgrade Ruby and restart your application processes.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">After <a href=\"https:\/\/www.getastra.com\/blog\/security-advisory\/php2shell-php-vulnerabilities\/\" target=\"_blank\" rel=\"noreferrer noopener\">php2shell<\/a>, http2shell, and <a href=\"https:\/\/www.getastra.com\/blog\/security-advisory\/nginx2root\/\" target=\"_blank\" rel=\"noreferrer noopener\">nginx2roo<\/a>t, we got ruby2shell on the day of GTA 6. Ruby is a programming language that runs web frameworks such as Rails and a large amount of self-hosted software. ruby2shell is a one-byte heap overflow in string case conversion that Ruby\u2019s maintainers say may allow remote code execution (RCE). <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1421\" height=\"580\" src=\"\/cdn-cgi\/image\/quality=80,format=auto,onerror=redirect,metadata=none\/https:\/\/cdn-blog.getastra.com\/2026\/11\/0f6b5446-ruby2shell.png\" alt=\"\" class=\"wp-image-50362\"\/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Ruby rates it Critical, with a CVE ID pending. Stephan Lipp, a security researcher from AdaLogic, reported it to Ruby, and the Ruby project published the advisory on November 19, 2026. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The researchers state it is reachable without authentication over the network in the default configuration of Rails and Sinatra (classic style). Other frameworks and plain Rack are not exposed by default, though application code that upcases strings in a legacy encoding may be vulnerable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Technical_Details_of_Ruby2shell\"><\/span>Technical Details of Ruby2shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Ruby2shell is an off-by-one error (CWE-193) in the case conversion loop for several ISO-8859 and Windows-125x encodings, present since Ruby 2.4.0. Most of these encodings have no capital form of the German character \u00df. Upcasing it produces two bytes (SS), but the loop checks for room for only one. The output buffer is the input length plus a fixed margin, so a crafted string with enough such characters writes one byte past the end of the buffer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The overflow is reached through <code>upcase<\/code>, <code>swapcase<\/code>, <code>downcase(:fold)<\/code>, and <code>casecmp?<\/code>. UTF-8 strings take a different code path and are unaffected. The written byte is <code>S<\/code> (0x53) when upcasing or <code>s<\/code> (0x73) when case-folding, and the attacker controls the buffer size through the input length. Copying the result out of the buffer also reads one byte out of bounds.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The attack vector is the network, with no authentication or user interaction required. No CVSS score or vector is published yet. The sources do not publish exploit steps, and the upstream fix is commit <code>d582f8f<\/code>.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Affected_Products_or_Versions_by_Ruby2shell\"><\/span>Affected Products or Versions by Ruby2shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">ruby2shell affects Ruby on every platform, back to version 2.4.0. Frameworks that call the vulnerable code in their default setup, and self-hosted products that bundle an affected Ruby, inherit the exposure.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Ruby 4.0: 4.0.0 to 4.0.9. Fixed in 4.0.10.<\/li>\n\n\n\n<li>Ruby 3.4: 3.4.0 to 3.4.12. Fixed in 3.4.13.<\/li>\n\n\n\n<li>Ruby 3.3: 3.3.13 and earlier. Fixed in 3.3.14.<\/li>\n\n\n\n<li>Ruby 3.2 and older: affected back to 2.4.0. These end-of-life versions have no patch.<\/li>\n\n\n\n<li>Frameworks affected by default: Rails and Sinatra (classic style).<\/li>\n\n\n\n<li>Bundled Ruby in the latest versions (as of November 19, 2026, 04:35 UTC): 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.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Detection_of_Ruby2shell\"><\/span>Detection of Ruby2shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Exposure depends on the Ruby version your application runs, which may differ from the system Ruby. The sources publish no indicators of compromise (IOCs) or network signatures for ruby2shell.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Run <code>ruby -v<\/code> in the same environment and container image your application uses, and compare it with the affected ranges.<\/li>\n\n\n\n<li>Check the bundled Ruby version of any self-hosted product against the vendor\u2019s release notes.<\/li>\n\n\n\n<li>Review container images and CI base images for affected versions.<\/li>\n\n\n\n<li>Search application code for <code>upcase<\/code>, <code>swapcase<\/code>, <code>downcase(:fold)<\/code>, and <code>casecmp?<\/code> applied to strings in ISO-8859 or Windows-125x encodings.<\/li>\n\n\n\n<li>Inventory any Ruby 3.2 or older runtime, since these have no patch.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Mitigation_for_Ruby2shell\"><\/span>Mitigation for Ruby2shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Upgrade Ruby to 3.3.14, 3.4.13, or 4.0.10. Rebuild container images on a fixed base and restart application processes so they load the new runtime. For self-hosted software, install the vendor\u2019s fixed release, since the products listed above bundle an affected Ruby. Ruby 3.2 and older receive no patch, so plan a move to a supported series.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><thead><tr><th>Ruby series<\/th><th>Affected versions<\/th><th>Fixed version<\/th><th>Status<\/th><\/tr><\/thead><tbody><tr><td>4.0<\/td><td>4.0.0 to 4.0.9<\/td><td>4.0.10<\/td><td>Patched<\/td><\/tr><tr><td>3.4<\/td><td>3.4.0 to 3.4.12<\/td><td>3.4.13<\/td><td>Patched<\/td><\/tr><tr><td>3.3<\/td><td>3.3.13 and earlier<\/td><td>3.3.14<\/td><td>Patched<\/td><\/tr><tr><td>3.2 and older<\/td><td>All releases back to 2.4.0<\/td><td>None<\/td><td>End of life, no patch<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Workaround_for_Ruby2shell\"><\/span>Workaround for Ruby2shell<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The sources list no official workaround, so upgrading is the only documented fix. Until you can upgrade, these general measures limit exposure and leave the flaw in place.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Identify the systems that could be affected, such as Rails or Sinatra applications and self-hosted products that bundle Ruby, and monitor them for unusual behavior or crashes.<\/li>\n\n\n\n<li>Limit or remove their internet exposure where possible, for example through a VPN, an allowlist, or trusted networks only.<\/li>\n\n\n\n<li>Take non-essential Ruby applications offline until they are patched.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_Astra_Helps\"><\/span>How Astra Helps<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As of now, we are monitoring the ruby2shell situation and will update this page once more details are confirmed. If you need help or guidance on ruby2shell, <a href=\"https:\/\/www.getastra.com\/contact-us\" target=\"_blank\" rel=\"noreferrer noopener\">talk to our team<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Disclaimer:<\/strong> This advisory reflects information available as of November 19, 2026, 12:49 PM IST. Details such as the CVE ID, CVSS score, and PoC availability may change. We will update this page as more information comes in.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>References:<\/strong> Ruby security advisory G<a href=\"https:\/\/github.com\/ruby\/ruby\/security\/advisories\/GHSA-34m4-m9fh-gqp5\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">HSA-34m4-m9fh-gqp5<\/a>, published November 19, 2026<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last updated: November 19, 2026, 12:49 PM IST. ruby2shell is an evolving situation. TLDR; After php2shell, http2shell, and nginx2root, we got ruby2shell on the day of GTA 6. Ruby is a programming language that runs web frameworks such as Rails and a large amount of self-hosted software. ruby2shell is a one-byte heap overflow in string &#8230; <a title=\"Ruby2shell: Critical Ruby Heap Overflow, Who Is Affected, and How to Fix It\" class=\"read-more\" href=\"https:\/\/www.getastra.com\/blog\/security-advisory\/ruby2shell\/\" aria-label=\"Read more about Ruby2shell: Critical Ruby Heap Overflow, Who Is Affected, and How to Fix It\">Read more<\/a><\/p>\n","protected":false},"author":138,"featured_media":50363,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[819],"tags":[],"class_list":["post-50361","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security-advisory"],"_links":{"self":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/users\/138"}],"replies":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/comments?post=50361"}],"version-history":[{"count":4,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50361\/revisions"}],"predecessor-version":[{"id":50367,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/posts\/50361\/revisions\/50367"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media\/50363"}],"wp:attachment":[{"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/media?parent=50361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/categories?post=50361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.getastra.com\/blog\/wp-json\/wp\/v2\/tags?post=50361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}