Ruby Patches Seven Flaws in Regexp and Case Conversion Code, Five of Them Potentially Enabling Remote Code Execution

The Ruby project disclosed seven vulnerabilities in its regular expression engine and its string case conversion code on 18 November 2026, and released fixed versions 4.0.10, 3.4.13 and 3.3.14 alongside the advisory. Ruby's advisory recommends that users upgrade to one of those releases.
Five of the flaws are memory-safety defects that the advisory says may allow remote code execution. The first is a one-byte heap-based buffer overflow in string case conversion, tracked as GHSA-34m4-m9fh-gqp5. A heap overflow writes past the end of a block of dynamically allocated memory and corrupts whatever sits next to it. A second, GHSA-87fm-7w84-j2px, is an integer overflow in the same case conversion path that leads to a heap-based buffer overflow. An integer overflow happens when a calculated size exceeds what the variable can hold and wraps around to a small, wrong value.
In regular expression compilation, GHSA-7x2q-68qv-6p8x is a double free, meaning the same memory is released twice. The advisory says it can be triggered with attacker-controlled patterns. GHSA-3p8q-wmhx-vm2w is a heap buffer overflow arising from an integer overflow. GHSA-wpqw-5qxg-m68r is an out-of-bounds read in case-insensitive regular expression matching, which the advisory also associates with possible remote code execution.
The remaining two are less severe on the stated impact. The advisory describes a heap-based buffer overflow in Regexp#to_s, where converting a crafted regexp to a string may allow information disclosure or remote code execution. GHSA-pvgc-g7gj-pv6h is an out-of-bounds read in case-insensitive backreference matching, where a pattern refers back to text captured earlier in the match. It may disclose memory contents or crash the process.
The affected range covers Ruby 3.3.13 and earlier, Ruby 3.4.0 through 3.4.12, and Ruby 4.0.0 through 4.0.9. The fixed releases are 4.0.10, 3.4.13 and 3.3.14. Ruby 3.3 is in its security maintenance phase. The advisory states that Ruby 3.2 and earlier have reached end of life and will not receive these fixes, so installations on 3.2 or older have no upstream remedy under this advisory and would need to move to a supported branch.
The project also noted that CVE identifiers had been requested but not yet assigned, so the advisory refers to the vulnerabilities by their GitHub Security Advisory (GHSA) identifiers. Teams that feed scanner output from CVE databases should expect a gap until those CVE numbers appear, and should search on the GHSA identifiers in the meantime.
In my view, the exposure is concentrated in code paths where untrusted input reaches the regexp engine or the case conversion routines. The advisory's own wording points there: the compilation bugs are tied to attacker-controlled patterns, and the case-insensitive matching and backreference issues depend on how input is matched. Services that compile user-supplied patterns, such as search features, log filters, validation rules or templating layers that accept expressions from outside the organisation, carry the most obvious risk. Applications that only run fixed, developer-written patterns against trusted data are a narrower concern, though the case conversion bugs could still matter for any string that crosses a trust boundary.
The practical sequence for operators is straightforward. Identify the Ruby minor version in each deployment, including bundled runtimes in containers and vendored interpreters, and move to the matching patched release. Systems on 3.3.13 or earlier, 3.4.12 or earlier, and 4.0.9 or earlier are in scope. Any system still running 3.2 or older falls outside the upstream fix and needs an upgrade to a supported line before it can be considered patched.
The broader context here is one that long-lived language runtimes know well. Regular expression engines and string handling sit beneath a very large share of web and automation code, so a defect in them reaches applications whose authors never wrote a regexp by hand. A patch release is quick to apply where dependency management is disciplined, and slow where a runtime is pinned deep inside an image or appliance. The useful outcome of an advisory like this is an accurate inventory, and for many teams that inventory is the part that takes longest.


