Critical Ruby String Case-Conversion Vulnerabilities Could Lead to Remote Code Execution

Published November 20, 2026. We will update this post as new information becomes available.
On November 19, 2026, the Ruby development team disclosed multiple security vulnerabilities affecting the Ruby runtime, including two memory corruption flaws in string case conversion that could potentially allow remote code execution (RCE).
The vulnerabilities, tracked as CVE-2026-132825 (GHSA-34m4-m9fh-gqp5) and GHSA-87fm-7w84-j2px, were classified as Critical and High severity, respectively.
Security research conducted by OpenAI’s security researchers and the use of OpenAI Codex, demonstrated how these vulnerabilities could be exploited through unauthenticated HTTP requests against Ruby on Rails applications. OpenAI also contributed to exploit validation, coordinated disclosure, and remediation efforts.
These findings are particularly concerning because the vulnerabilities reside in Ruby’s core string-handling functionality, potentially exposing applications that process untrusted input through affected conversion paths.
Understanding the Vulnerabilities
Both vulnerabilities involve memory corruption during Ruby string case conversion. Although they share similarities, they originate from different flaws and require different exploitation techniques.
CVE-2026-132825: Heap Buffer Overflow in String Case Conversion (Critical)
The first vulnerability is a one-byte heap buffer overflow affecting Ruby’s handling of certain character encodings.
When converting strings to uppercase, some characters expand into multiple bytes. For example, the German sharp-s character (ß) can expand into “SS” when processed using encodings such as ISO-8859-1 or Windows-1252.
Under vulnerable conditions, Ruby fails to properly account for the additional space required during conversion, resulting in a write beyond the allocated memory buffer.
Although the overflow involves only a single byte, memory corruption vulnerabilities of this nature can potentially be exploited to manipulate application execution.
Published research demonstrated that the vulnerability can be reached through Rack’s multipart form processing in Ruby on Rails applications. Specifically, the _method parameter, commonly used to override HTTP methods in HTML forms, can provide an unauthenticated entry point to the vulnerable functionality.
Researchers successfully demonstrated remote code execution against vulnerable Rails applications without requiring authentication.
GHSA-87fm-7w84-j2px: Integer Overflow in String Case Conversion (High)
The second vulnerability involves an integer overflow when Ruby calculates the memory required for case conversion of exceptionally large strings.
Certain Unicode characters expand into multiple characters during conversion. When the resulting string exceeds the supported length calculation, an integer overflow can cause Ruby to allocate insufficient memory, potentially resulting in a heap buffer overflow.
Unlike the first vulnerability, exploitation requires a more complex sequence of operations and significant memory manipulation.
Published research demonstrated an RCE chain involving Rack multipart processing, WebSocket connections, heap manipulation, and memory disclosure.
The demonstrated exploit also included techniques to bypass Address Space Layout Randomization (ASLR), illustrating how a memory corruption issue can potentially be developed into a more sophisticated attack.
Why are these vulnerabilities concerning?
The primary concern is the demonstrated ability to turn vulnerabilities in Ruby’s internal string handling into remotely exploitable conditions through common web application functionality.
Several characteristics make these vulnerabilities particularly significant:
- Unauthenticated exploitation: Researchers demonstrated RCE without requiring valid credentials or prior access to the application.
- Framework-level exposure: Vulnerable functionality may be reached through standard request processing, even when application developers do not explicitly invoke Ruby’s affected string conversion methods.
- Multiple encoding options: The underlying behavior is not limited to a single character or encoding, making detection based solely on specific byte sequences insufficient.
- Different exploitation techniques: The two vulnerabilities demonstrate distinct paths to memory corruption and code execution, complicating efforts to develop comprehensive network-level mitigations.
Beyond a Single Character or Encoding
Imperva Threat Research’s analysis identified 103 Unicode characters that expand during case conversion, including 16 that expand from one character to three.
These characters can be represented through 41 character sets, including ISO-8859-1, Windows-1252, and ISO-8859-7.
This highlights an important challenge for security solutions: detecting a single suspicious character, such as ß, is not sufficient to address every potentially vulnerable conversion path.
Effective mitigation requires understanding how character encodings, application request processing, and vulnerable runtime behavior interact.
It is important to distinguish the broader set of expansion characters from confirmed exploitability. Not every character or encoding combination necessarily triggers either vulnerability.
Severity and Potential Impact
Ruby’s official security advisories classify the two vulnerabilities as follows:
| Vulnerability | Severity | Potential impact |
| CVE-2026-132825 / GHSA-34m4-m9fh-gqp5 | Critical | Heap buffer overflow, potentially leading to RCE |
| GHSA-87fm-7w84-j2px | High | Integer overflow and heap corruption, potentially leading to RCE |
Working exploitation research has demonstrated remote code execution in specific environments.
However, successful exploitation depends on factors including the affected Ruby version, application framework, memory allocator, and runtime configuration.
The existence of working exploitation research does not necessarily mean that all applications using vulnerable Ruby versions are remotely exploitable.
Who is affected?
The vulnerabilities affect the following Ruby versions:
| Ruby branch | Vulnerable versions | Fixed version |
| Ruby 4.0 | 4.0.0 to 4.0.9 | 4.0.10 |
| Ruby 3.4 | 3.4.0 to 3.4.12 | 3.4.13 |
| Ruby 3.3 | Up to 3.3.13 | 3.3.14 |
Older unsupported Ruby branches may also contain vulnerable code and should be migrated to supported, patched versions.
Internet-facing Ruby on Rails applications deserve particular attention due to the demonstrated unauthenticated exploitation paths.
Other applications built using Ruby, including Sinatra-based applications and products that bundle their own Ruby runtime, should also be evaluated based on their versions and exposure to untrusted input.
What you should do
Organizations running affected Ruby versions should prioritize the following actions:
- Upgrade Ruby immediately. Update to Ruby 3.3.14, 3.4.13, or 4.0.10, as appropriate. Updating application dependencies alone does not necessarily remediate vulnerabilities in the Ruby runtime.
- Identify vulnerable deployments. Review Ruby installations across application servers, containers, bundled runtimes, and internet-facing services.
- Review application exposure. Pay particular attention to applications that process unauthenticated HTTP requests, multipart form submissions, or untrusted strings using affected character encodings.
- Monitor suspicious requests. Investigate unusual multipart form submissions, unexpected character encodings, abnormal _method parameters, and exceptionally large HTTP requests.
- Maintain defense in depth. Use web application security controls to reduce exposure while ensuring vulnerable runtimes are patched.
How Imperva Protects You
Imperva Threat Research has analyzed the disclosed Ruby vulnerabilities and their exploitation techniques, identifying attack patterns that can be detected and mitigated at the network level.
For Cloud WAF, Imperva for Google Cloud, Imperva for AWS and Elastic WAF, Imperva developed and deployed dedicated mitigation rules to protect customers against exploitation attempts targeting these vulnerabilities. These protections are enabled by default, requiring no additional configuration or action from customers.
For WAF Gateway, manual mitigation steps will be provided as soon as possible and ADC content, will be released early next week.
Our mitigation approach accounts for the unique characteristics of these vulnerabilities, including specially encoded multipart parameters and character conversion patterns that could trigger memory corruption in vulnerable Ruby runtimes.
Imperva Threat Research continues to monitor emerging exploitation techniques and will update protections as needed to address new attack variations.
While these protections provide an important additional layer of security, we strongly recommend upgrading affected Ruby installations to patched versions as the primary remediation.
What’s Next?
Imperva Threat Research continues to investigate these vulnerabilities, including publicly available exploitation techniques and potential attack activity.
We will update this post as new information becomes available and provide additional guidance as appropriate.
The post Critical Ruby String Case-Conversion Vulnerabilities Could Lead to Remote Code Execution appeared first on Blog.