Ruby Ships Fixes for 7 Flaws, Including Critical Ruby2Shell, Said to Hit Default Rails Apps Pre-Auth
Ruby has released fixes for seven memory-safety vulnerabilities, five of which have proof-of-concept exploits that could lead to remote code execution.

Ruby has patched seven memory-safety vulnerabilities in its regular expression engine and string case-conversion code, with five flaws potentially allowing remote code execution through crafted input. The project released updated versions to address these issues.
The Ruby programming language has addressed seven memory-safety vulnerabilities within its code, specifically in the regular expression engine and string case-conversion functionalities. Five of these vulnerabilities have been confirmed to have proof-of-concept exploits that could allow attackers to execute arbitrary code on affected systems. The project announced the availability of fixed versions: Ruby 4.0.10, 3.4.13, and 3.3.14, urging users to update to these versions to mitigate the risks.
The vulnerabilities include three rated as critical, three as high, and one as moderate. The critical vulnerabilities can be exploited remotely if an attacker can provide crafted input that the application processes. The maintainers noted that while proof-of-concept exploits exist for five of the flaws, there have been no reported incidents of actual attacks utilizing these vulnerabilities to date.
- 1Seven vulnerabilities identifiedFlaws in regex engine and string case-conversion
- 2Five flaws have PoCsPotential for remote code execution via crafted input
- 3Critical vulnerabilities ratedThree critical, three high, one moderate
- 4Fixed versions releasedRuby 4.0.10, 3.4.13, and 3.3.14 available
- 5Previous vulnerabilities patchedDifferent issues addressed on October 23
Regular expressions are a powerful tool used in programming to identify patterns within text. They allow developers to create complex search patterns to match strings, making them useful for tasks like validating input or searching through large datasets. However, if an application allows untrusted input to influence the creation of these patterns, it can lead to security vulnerabilities, including remote code execution. In this case, the vulnerabilities arise from improper handling of input that can lead to unexpected behavior in the regex engine.
All applications running on affected versions of Ruby are at risk, as the flaws exist in Ruby's own code. The ability for an attacker to exploit these vulnerabilities depends on how each application manages external input. Specifically, applications that compile regular expressions from user-controlled input are particularly vulnerable. Additionally, two of the flaws relate to string case conversions, which occur when applications manipulate the case of input strings.
The Ruby project provided a detailed security announcement and individual advisories for each flaw, outlining their severity and potential impact. The vulnerabilities were identified by several researchers, including Stephan Lipp and others, who contributed to the discovery of these critical issues. The project has requested CVE numbers for the vulnerabilities, which are currently not assigned, meaning that tracking them relies on GitHub advisory IDs in the meantime.
This is the second time in a month that Ruby has patched vulnerabilities in its regular expression engine. Previous updates in October addressed different issues related to compilation bugs that had been exploited in the wild. The maintainers have emphasized that the current vulnerabilities are distinct from those patched earlier, although they highlight the ongoing risks associated with improper input handling in applications.
While the fixes are now available, organizations must ensure that they are not just updating their application frameworks or gems but also the Ruby interpreter itself. The maintainers have indicated that older versions will not receive fixes, so users should transition to supported versions to maintain security. The urgency of these updates is underscored by the potential for remote code execution, which can have severe implications for application security.
What security teams should do
- Update to Ruby version 4.0.10, 3.4.13, or 3.3.14.
- Check applications for handling of external input that could influence regex patterns.
- Ensure that Ruby interpreters on application servers and container images are updated.