Ruby vulnerabilities: seven fixed, five have RCE PoCs
Ruby vulnerabilities in the regular expression engine and string case-conversion code have been fixed across three supported release lines. The Ruby project says five of the seven flaws have proof-of-concept exploits, or PoCs, showing that crafted input can achieve remote code execution, meaning an attacker may run code on the affected machine. The advisories report no attacks so far.
The fixes are Ruby 4.0.10, 3.4.13 and 3.3.14. The risk depends on whether an attacker can get specially crafted regular-expression patterns or strings into the affected code. Three vulnerabilities are rated critical, three high and one moderate.
The three critical flaws are GHSA-34m4-m9fh-gqp, a one-byte heap overflow when Ruby changes the case of a string in certain single-byte encodings, including ISO-8859-1 and Windows-1252; GHSA-7x2q-68qv-6p8x, a double free when Ruby compiles a crafted regular expression using character-class intersection, written as &&; and GHSA-3p8q-wmhx-vm2w, a heap overflow caused when the size of a compiled regular expression overflows during compilation. All three have proof-of-concept remote code execution.
The high-severity issues are GHSA-87fm-7w84-j2px, a heap overflow when a case change creates a result larger than 4 GiB; GHSA-7whj-cfh7-xgm4, a heap overflow when Ruby converts a crafted compiled regular expression back into text with Regexp#to_s; and GHSA-wpqw-5qxg-m68r, an out-of-bounds read during case-insensitive matching. The first two have remote-code-execution PoCs. The amount of data needed for GHSA-87fm-7w84-j2px makes it out of reach for most requests. The PoC for GHSA-wpqw-5qxg-m68r demonstrates memory corruption controlled by an attacker, while remote code execution remains possible but has not been demonstrated.
The moderate issue, GHSA-pvgc-g7gj-pv6h, is another out-of-bounds read. It occurs when Ruby matches a case-insensitive backreference against a crafted subject string. The advisory says it may expose memory contents or crash the process. The project has requested CVE numbers for all seven flaws, but none has been assigned yet. Until that changes, the GitHub advisory IDs are the identifiers available for scanners and software inventories.
Every application using an affected Ruby version contains the vulnerable code, but the practical exposure depends on how the application accepts outside input. The regular-expression flaws generally require an application to build a pattern from attacker-controlled input and then compile or run it. Matching untrusted text against a pattern written by the developers does not create the same risk, except for the moderate case involving a fixed pattern with a case-insensitive backreference and a crafted subject string.
The two case-conversion flaws do not use regular expressions. They matter when an application changes the case of imported or other external text. Website owners and IT teams should therefore check Ruby code that processes user submissions, uploaded content, imported records or other text from outside the application.
Ruby 4.0.0 through 4.0.9 are fixed by 4.0.10. Ruby 3.4.0 through 3.4.12 are fixed by 3.4.13. Ruby 3.3.13 and earlier are fixed by 3.3.14. Ruby 3.2 and earlier are end of life and will not receive a fix, so the project recommends moving to a supported line. With 3.3.14, the project changed Ruby 3.3 from security maintenance to legacy maintenance, with support still scheduled to end at the end of March 2027.
Updating application gems or a framework is not enough because these fixes are inside the Ruby interpreter. Teams must update the Ruby version running on application servers, background workers and container images, then restart the relevant services or rebuild the images.
This is the second Ruby regular-expression engine patch in one month. On October 23, the project released Ruby 4.0.9, 3.4.12 and 3.3.13 for compilation bugs found by GitLab. Those bugs were behind four critical GitLab flaws, one of which was targeted in an attempted attack against Alpine Linux's own GitLab server. CISA later added that earlier issue to its KEV catalog, the list of Known Exploited Vulnerabilities. Those are different bugs from the seven fixed now, and the new advisories do not say that GitLab or another named product can be attacked through them. The earlier incident nevertheless demonstrated that a regular expression built from user input can provide a practical route onto a server.
For organisations running Ruby applications, AEU-I provides security-first IT, infrastructure and consulting. That service is relevant when teams need help reviewing the infrastructure around affected application runtimes and planning the required updates.
The seven findings were credited to Stephan Lipp of Ada Logics and Anthropic for four discoveries, and to baba__yaga, aphantom, Hiroya Fujinami and Hiroshi SHIBATA for the other three.