ruby2ßhell: Critical One-Byte Heap Overflow in Ruby Could Allow RCE Attacks
Ruby fixed a critical memory flaw that lets attackers run code on vulnerable servers without logging in.
Overview
Ruby maintainersThe developer or small team responsible for reviewing changes and publishing releases for an open-source project fixed a critical memory corruptionA class of software bugs where a program accidentally overwrites or misreads its own working memory flaw that allows remote code executionA flaw that lets an attacker run their own code on someone else's computer over a network on vulnerable serversA computer or program on a network that stores data and responds to requests from client devices. The bug affects Ruby's string case conversion code and can be reached over the network without logging in to applications running Ruby on Rails or classic-style Sinatra with default settings. The issue occurs in case conversion routines for several legacy single-byteA group of 8 bits, enough to store 1 character encodingsRewrite data in another form so it can be carried; no key, anyone can reverse it, including some ISO-8859 and Windows-125x variants. In those encodings, Ruby converts the German lowercase letter ß to SS when uppercasing it, which produces two output bytes from one input byte. The loop checks only whether the output buffer has room for one more byte, so if the conversion needs two bytes and only one fits, the second write crosses the buffer boundary. Affected releases include Ruby 3.3.0 through 3.3.13, 3.4.0 through 3.4.12, and 4.0.0 through 4.0.9.
Terms in this story
- maintainers
- The developer or small team responsible for reviewing changes and publishing releases for an open-source project. Supply chain attackers often target a volunteer maintainer with phishing emails or offers to help, hoping to gain publishing rights over a popular code library.
- memory corruption
- A class of software bugs where a program accidentally overwrites or misreads its own working memory. Buffer overflows and use-after-free bugs are forms of memory corruption that can crash an application or let an attacker redirect the processor to run malicious code. Security+ objective 2.3 lists the term
- remote code execution
- A flaw that lets an attacker run their own code on someone else's computer over a network. This is one of the most dangerous bug classes in the news because an attacker across the internet can send a crafted request and take control of a server.
- code execution
- A flaw that lets an attacker run any commands or program they choose on the target machine. When an advisory warns that a bug allows arbitrary code execution, an attacker who triggers the flaw can install malware, read files, or take over the program's account.
- servers
- A computer or program on a network that stores data and responds to requests from client devices. Online stores, email systems, and multiplayer games all run on servers in data centers or the cloud, making unpatched servers a primary target for intruders.
- Byte
- A group of 8 bits, enough to store 1 character. Memory sizes, network payloads, and buffer lengths are measured in bytes, and memory corruption bugs happen when a program writes even a single byte past the end of its buffer. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 1)
- encodings
- Rewrite data in another form so it can be carried; no key, anyone can reverse it. Students often confuse encoding with encryption at first, but systems encode data only so it travels safely through text protocols, not to keep it secret from anyone. From the CYBR 101 room CYBR 101: Ciphers and encryption (part 1)
- patched
- A software update released by a developer to fix a bug or close a security flaw. When a software flaw is discovered, the vendor ships a patch so administrators and ordinary users can update their systems before attackers exploit the bug. Security+ objective 4.3 lists the term
- CVE identifier
- The public tracking code assigned to a specific known security flaw in software or hardware. Every cataloged software flaw gets a unique CVE label so security teams, vendors, and news reports can talk about the exact same bug without confusion. Security+ objective 2.3 lists the term
- disclosure
- The process of reporting and publishing details about a newly discovered security flaw in software or hardware. In security news, disclosure refers either to a researcher privately alerting a vendor about a bug or to a company publicly notifying customers about a breach.
- heap buffer overflow
- A buffer overflow inside the pool of memory a program allocates dynamically while running. Attackers exploit a heap overflow in a browser or media parser by feeding it an oversized file that overwrites neighboring objects in memory and hijacks execution.
- runtime
- The environment in which a program executes, or the period of time while the program is actively running. A flaw in a container or language runtime can let a program escape its isolation, and runtime security tools watch what a program actually does in memory while it runs.
This page is a short description made for this site. The article itself, with its author's name and its own link, is on the Cyber Security News website. Cite the article, not this page.
Read the full article on Cyber Security News (opens in a new tab)
Course connections
Each line below connects this story to a Security+ objective (a skill on CompTIA's Security+ exam, a common first cybersecurity certification), a CYBR 101 week, or a cybersecurity job, and quotes the words that made the connection.
- Kind of story: Vulnerability and patch
"Ruby has patched a critical memory corruption flaw..." Found by reading the article; these exact words are in it - Security+ 2.3 Explain various types of vulnerabilities.
"Ruby has patched a critical memory corruption flaw that can allow remote code execution..." Found in the opening sentences - Security+ 2.5 Explain the purpose of mitigation techniques used to secure the enterprise.
"Ruby has patched a critical memory corruption flaw that can..." Found in the opening sentences - CYBR 101 week 3: cyber hygiene, privacy, OSINT and social engineering
"Ruby has patched a critical memory corruption flaw that can..." Found in the opening sentences
How a story is connected to the course, and every objective, week and job role