Velocity Labs

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

On November 18, the Ruby team released Ruby 4.0.10, 3.4.13, and 3.3.14 to fix seven vulnerabilities in Ruby’s regular expression engine and in string case conversion. Three are rated critical, and the security advisory 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 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:

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)
  • An integer overflow when changing the case of a string whose result is over 4 GiB. High. (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)

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 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. 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 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.

Sources

Need help with your app?

We build custom software, rescue apps that are stuck, and keep them running. Tell us what you're dealing with.