Ruby maintainers have released security updates for seven flaws in the language’s regular expression engine and string case conversion. The fixes are in Ruby 4.0.10, 3.4.13 and 3.3.14; administrators should check the interpreter actually running in each application, worker and container, not just the Rails or gem versions.
The Ruby security advisory, published November 19 UTC, says proofs of concept demonstrate remote code execution for some of the bugs. That does not mean every application using an affected Ruby version is remotely exploitable: the path depends on how it processes outside strings or regular-expression patterns. The advisory does not report attacks in the wild.
Which Ruby versions need attention?
- Ruby 4.0.0 through 4.0.9: upgrade to 4.0.10 or a later fixed release.
- Ruby 3.4.0 through 3.4.12: upgrade to 3.4.13 or a later fixed release.
- Ruby 3.3.13 and earlier: upgrade to a supported fixed line; 3.3.14 is the fix for the 3.3 branch.
Ruby 3.2 and older are past end of life and will not receive these upstream fixes. Plan a move to a supported release, and check with your operating-system or application vendor for its own support and backport guidance. A vendor-patched package may retain an older-looking upstream version number, so compare package release details with the vendor advisory.
The seven vulnerabilities have GitHub Security Advisory identifiers, but the maintainers had requested rather than received CVE numbers when they published the notice. Use the GHSA identifiers when checking scanners and tracking remediation.
Why the input path changes the risk
Two flaws involve changing the case of a crafted string, including GHSA-34m4-m9fh-gqp5, a one-byte heap overflow. Review places that normalize outside text with methods such as upcase and downcase, including imports, form fields and background jobs. The individual advisory describes specific encoding conditions; simply finding a call to a case-conversion method does not prove it is exploitable.
Several other issues require a crafted regular-expression pattern. For example, GHSA-7x2q-68qv-6p8x is a double-free during compilation of a crafted pattern. Search for code that builds patterns from user-supplied filters, search expressions or configuration and passes them to Regexp.new. Matching untrusted text against a fixed developer-written expression is not the same exposure for those pattern-dependent flaws.
There is an important exception: GHSA-pvgc-g7gj-pv6h concerns a crafted subject string matched with a case-insensitive backreference. Ruby warns it can disclose memory or crash the process. Review the individual advisories before treating any one code search as a complete exposure test.
How to check and update deployments
- Inventory the running runtime. On each host or inside each relevant container, run
ruby -vandwhich rubyin the same environment as the service. A shell on an administrator’s laptop or host may point to a different interpreter than the application. - Include more than web servers. Check background workers, scheduled jobs, build and CI images, and separately packaged or embedded Ruby runtimes. Ask appliance and managed-service vendors whether their products are affected and when their fixes will be available.
- Update the actual interpreter. Install the fixed Ruby release or the vendor’s patched package using your normal supported deployment process. Updating Rails or application gems alone does not replace the interpreter.
- Rebuild and restart. Rebuild container images from a patched base, redeploy them, and restart long-running web and worker processes. Verify the version or vendor package revision in the new running environment, not just in a build file.
- Prioritize exposed input paths. Review applications that compile external patterns or normalize untrusted strings. Restrict unnecessary user-defined regular expressions while patching, but do not assume this addresses the case-conversion flaws or replaces the update.
For third-party products, avoid replacing a bundled interpreter independently unless the vendor supports it: doing so can break the application or invalidate its support path. Track the vendor’s advisory and apply its tested release.
What is known about exploitation
The maintainers describe code-execution proofs of concept for five issues, while a sixth has a proof of attacker-controlled memory corruption and a seventh can disclose memory or crash a process. A proof of concept establishes that a technique can work under certain conditions; it is not evidence that a particular internet-facing service has been compromised. Independent reporting notes that the published advisories did not report attacks.
Ruby’s October regular-expression fixes were separate bugs. TechsCurrent previously covered an exploited GitLab vulnerability from that period; the new Ruby advisory does not establish that GitLab or any other named product is exploitable through these seven flaws. Check each product’s own guidance before drawing that conclusion.