# Upgrade Ruby now: 4.0.10, 3.4.13, and 3.3.14 fix seven security bugs

> Ruby 4.0.10, 3.4.13, and 3.3.14 fix seven memory bugs in regular expressions and string case conversion, some of them usable for remote code execution. What's affected and how to upgrade.

- URL: https://velocitylabs.io/blog/2026/11/20/upgrade-ruby-4-0-10-3-4-13-3-3-14/
- Published: November 20, 2026
- Author: Chris Irish

On November 18, the Ruby team released [Ruby 4.0.10](https://www.ruby-lang.org/en/news/2026/11/18/ruby-4-0-10-released/), [3.4.13](https://www.ruby-lang.org/en/news/2026/11/18/ruby-3-4-13-released/), and [3.3.14](https://www.ruby-lang.org/en/news/2026/11/18/ruby-3-3-14-released/) to fix seven vulnerabilities in Ruby’s regular expression engine and in string case conversion. Three are rated critical, and the [security advisory](https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/) says the team is aware of proof-of-concept code showing some of them can be used for remote code execution.

Every Ruby 3.3, 3.4, and 4.0 release before these is affected, and Ruby 3.2 and older won’t get a fix. If you run a Ruby app, plan the upgrade for this week.

This is the second round in a month. On October 23, Ruby 4.0.9, 3.4.12, and 3.3.13 fixed [four regular expression bugs](https://www.ruby-lang.org/en/news/2026/10/23/regexp-fixes-for-gitlab-cves/) that GitLab found could be used for remote code execution on its servers (CVE-2026-89078, CVE-2026-93577, CVE-2026-97229, and CVE-2026-110264). If you upgraded then, you need to upgrade again. If you didn’t, the new releases include those fixes too.

## Which version to move to

| Your series | Affected releases | Upgrade to |
| --- | --- | --- |
| Ruby 4.0 | 4.0.0 through 4.0.9 | 4.0.10 |
| Ruby 3.4 | 3.4.0 through 3.4.12 | 3.4.13 |
| Ruby 3.3 | 3.3.0 through 3.3.13 | 3.3.14 |
| Ruby 3.2 and older | All of them, with no fix coming | A supported series |

Ruby 3.3 is down to security fixes only, so if you’re on it, the next upgrade is worth planning too.

## What the bugs are

CVE IDs have been requested but not assigned yet, so the Ruby team lists the bugs by their GitHub advisory IDs. Four are in compiling or printing a regular expression, and an attacker has to control the pattern:

- A double free when compiling a character class intersection (`&&`). Critical. ([GHSA-7x2q-68qv-6p8x](https://github.com/ruby/ruby/security/advisories/GHSA-7x2q-68qv-6p8x))
- An integer overflow in the size of a compiled pattern, which overflows a heap buffer. Critical. ([GHSA-3p8q-wmhx-vm2w](https://github.com/ruby/ruby/security/advisories/GHSA-3p8q-wmhx-vm2w))
- An out-of-bounds read in case-insensitive matching. High. ([GHSA-wpqw-5qxg-m68r](https://github.com/ruby/ruby/security/advisories/GHSA-wpqw-5qxg-m68r))
- A heap buffer overflow in `Regexp#to_s`. High. ([GHSA-7whj-cfh7-xgm4](https://github.com/ruby/ruby/security/advisories/GHSA-7whj-cfh7-xgm4))

The other three are reached through a crafted string instead:

- A one-byte heap overflow when changing the case of a string in some single-byte encodings, such as ISO-8859-1 and Windows-1252. Critical. ([GHSA-34m4-m9fh-gqp5](https://github.com/ruby/ruby/security/advisories/GHSA-34m4-m9fh-gqp5))
- An integer overflow when changing the case of a string whose result is over 4 GiB. High. ([GHSA-87fm-7w84-j2px](https://github.com/ruby/ruby/security/advisories/GHSA-87fm-7w84-j2px))
- An out-of-bounds read when matching a crafted string against a case-insensitive backreference, which can leak memory or crash the process. Moderate. ([GHSA-pvgc-g7gj-pv6h](https://github.com/ruby/ruby/security/advisories/GHSA-pvgc-g7gj-pv6h))

## Is your app exposed?

The most serious regex bugs need user input to become a regular expression. In Ruby that happens through `Regexp.new`, `Regexp.union`, `Regexp.compile`, or interpolation into a literal like `/#{params[:q]}/`, and search and filter features are a common place for it. For the October bugs, the Ruby team pointed out that `Regexp.timeout` doesn’t protect against them, and that limiting a pattern’s length isn’t reliable because some can be triggered by short patterns.

Searching your own code for those calls is a good start, but it won’t settle the question. Your gems run on the same Ruby, and the case conversion bugs depend on the encoding and size of strings that come from all over an app. The upgrade is usually the smaller job. A patch release in the same series only fixes bugs, so moving to it takes less time than proving you don’t need to.

## How to upgrade

1. Check the Ruby version production is actually running, not just the one in the repo: `ruby -v` on the server, or `RUBY_VERSION` in a console.
2. Change it everywhere it’s pinned: `.ruby-version`, the `ruby` line in your Gemfile, the `FROM ruby:` line in a Dockerfile, and your CI configuration. Then run `bundle update --ruby` so `Gemfile.lock` records the new version.
3. Make sure your host or base image offers the new release before you deploy.
4. Run your tests, deploy, and confirm production reports the new version.

If you’re on Ruby 3.2 or older, there’s no patch to apply. Moving to a supported series often means moving Rails and some of your gems with it, which is a bigger job, and better started now than after the next advisory.

## Where we can help

Keeping up with releases like these is what our [maintenance plans](https://velocitylabs.io/maintenance/) are for. Every plan includes security patches and dependency updates for your app and the servers it runs on, and starts with an Essentials code audit so we know what we’re looking after. The Standard plan also keeps your Ruby and Rails versions current, with a quarterly health check using the code audit’s scans. Plans start at $750 a month.

If you’re not sure which Ruby your app runs on, or who last updated it, start with a [Rails code audit](https://velocitylabs.io/code-audit/ruby-on-rails/). It checks whether your Ruby and Rails versions still get security fixes, scans your gems for known vulnerabilities, and gives you a plan with the most urgent fixes first. Essentials is a fixed $1,000, and if you hire us for hourly development within 30 days of the report, up to $1,000 of the fee comes off your first invoice.

If you’re on an end-of-life Ruby, our [Ruby on Rails upgrades](https://velocitylabs.io/ruby-on-rails/upgrades/) move Ruby, Rails, and your gems up one version at a time, with tests at each step. And if you just want help getting this patch out, [send us a message](https://velocitylabs.io/#contact).

## Sources

- [Security advisories: multiple vulnerabilities in Regexp and String case conversion](https://www.ruby-lang.org/en/news/2026/11/18/multiple-vulnerabilities-in-regexp-and-string/), ruby-lang.org, November 18, 2026
- [Regexp compilation fixes related to GitLab’s CVEs](https://www.ruby-lang.org/en/news/2026/10/23/regexp-fixes-for-gitlab-cves/), ruby-lang.org, October 23, 2026
