MOOBON

Seven Vulnerabilities in Ruby's Regexp and String Case Conversion (November 2026)How to update to 4.0.10 / 3.4.13 / 3.3.14

Published November 21, 20267 min read

On November 18, 2026, seven vulnerabilities in Ruby's regular expressions (Regexp) and string case conversion were disclosed, and the fixed releases Ruby 4.0.10 / 3.4.13 / 3.3.14 were published. According to ruby-lang.org, the Ruby team is aware of PoCs showing that some of them can be used for remote code execution. This article covers the affected versions and applications, and how to check and update.

This article reflects information as of November 21, 2026, when CVE IDs had not yet been assigned. Check ruby-lang.org and the advisories in "Related links" for the latest information.

1. Overview

  • Seven issues in two areas. Two are in string case conversion; five are memory corruption or out-of-bounds reads in regular expression compilation, matching and string conversion.
  • Some can lead to remote code execution. The ruby-lang.org announcement says the Ruby team is aware of PoCs showing that some of the issues can be used for remote code execution. At the time of writing, we have not seen reports of exploitation in the wild.
  • CVE IDs are pending. Each issue is identified by a GitHub Security Advisory (GHSA) ID. The announcement does not give CVSS scores.
  • The fix is a Ruby update. ruby-lang.org strongly recommends upgrading to Ruby 4.0.10, 3.4.13 or 3.3.14.

2. The seven vulnerabilities

The advisories are listed below, string case conversion first, then regular expressions.

GHSAIssuePossible impactReported by
GHSA-34m4-m9fh-gqp5Heap buffer overflow in case conversion of strings (one byte)Changing the case of a crafted string may allow remote code executionStephan Lipp (Ada Logics), Anthropic
GHSA-87fm-7w84-j2pxInteger overflow in case conversion of strings (leads to a heap buffer overflow)Changing the case of a crafted string may allow remote code executionbaba__yaga (HackerOne)
GHSA-7x2q-68qv-6p8xDouble free in regular expression compilationMay allow remote code execution in applications that compile attacker-controlled patternsStephan Lipp (Ada Logics), Anthropic
GHSA-3p8q-wmhx-vm2wHeap buffer overflow in regular expression compilation (caused by an integer overflow in the regex engine)May allow remote code execution in applications that compile attacker-controlled patternsaphantom (HackerOne)
GHSA-wpqw-5qxg-m68rOut-of-bounds read in case-insensitive regular expression matchingMay allow remote code execution in applications that use attacker-controlled patternsStephan Lipp (Ada Logics), Anthropic
GHSA-7whj-cfh7-xgm4Heap buffer overflow in Regexp#to_sConverting a crafted regex to a string may allow information disclosure or remote code execution in applications that compile attacker-controlled patternsStephan Lipp (Ada Logics), Anthropic
GHSA-pvgc-g7gj-pv6hOut-of-bounds read in case-insensitive backreference matchingMatching a crafted string may disclose memory contents or crash the processHiroya Fujinami, Hiroshi SHIBATA

The advisories say PoCs exist for remote code execution in some scenarios for GHSA-34m4, GHSA-87fm and GHSA-7x2q, and that PoCs for GHSA-wpqw can corrupt memory in an attacker-controlled way. GHSA-pvgc does not mention remote code execution; its impact is information disclosure or a crash.

3. Affected and fixed versions

SeriesAffected versionsFixed version
4.04.0.0 to 4.0.94.0.10
3.43.4.0 to 3.4.123.4.13
3.33.3.13 and earlier3.3.14
3.2 and earlierEnd of lifeNo fix

All three fixed versions were released on November 18, 2026. Ruby 3.3 is in the security maintenance phase. Ruby 3.2 and earlier have reached end of life and will not receive these fixes.

4. Which applications are affected

String case conversion (almost every application)

GHSA-34m4 and GHSA-87fm occur when the case of a crafted string is changed. Processing like the following is in scope.

str.upcase      str.downcase      str.capitalize      str.swapcase
str.upcase!     str.downcase!     str.capitalize!     str.swapcase!

# case-insensitive comparison
str.casecmp?(other)

Normalizing email addresses, processing search keywords and handling HTTP header names all commonly apply these methods to external input. They are also used inside Rails and gems, so assume your application may be affected even if your own code does not call them directly.

Applications that build regular expressions from user input

Most of the five regex issues are described as affecting applications that compile or use attacker-controlled patterns, such as the following.

# building a regex from input, e.g. in search or user-defined filters
pattern = Regexp.new(params[:q], Regexp::IGNORECASE)
records.select { |r| r.name.match?(pattern) }

# interpolation does the same
/#{params[:q]}/i

You can find candidates with a search like this.

grep -rnE 'Regexp\.(new|compile|union)|/[^/]*#\{' app lib config
Regexp.escape keeps input from being interpreted as regex syntax; it was not presented as a mitigation for these bugs. The two case conversion issues also have nothing to do with regular expressions. Update Ruby whether or not you escape input.

If you cannot update right away, you can consider temporarily disabling features that build regular expressions from user input. That does not address the two case conversion issues.

5. Check which Ruby you run

Development and production sometimes run different Ruby versions. Check both what the repository specifies and what production actually runs.

What the repository specifies

cat .ruby-version
grep -nE '^\s*ruby ' Gemfile
grep -n -A1 'RUBY VERSION' Gemfile.lock
cat .tool-versions 2>/dev/null        # if you use asdf
grep -n '^FROM' Dockerfile*           # Docker base image

What production runs

# on the server, from the application directory
bundle exec ruby -v

# for a Docker image
docker run --rm <IMAGE> ruby -v

ruby 4.0.10, 3.4.13, 3.3.14 or later are fixed. Ruby from OS packages may include backported fixes without a version change; see the note in section 6.

6. Update to a fixed version

These are patch updates within each series, so application code usually does not need to change. After updating, restart every Ruby process, including Puma and Sidekiq. Without a restart, the old Ruby keeps running.

rbenv (ruby-build)

# update ruby-build to get the new version definitions
brew upgrade ruby-build                        # Homebrew
git -C "$(rbenv root)"/plugins/ruby-build pull # installed with git

rbenv install 3.4.13
rbenv local 3.4.13      # updates .ruby-version
ruby -v

asdf

asdf plugin update ruby
asdf install ruby 3.4.13
# change the ruby line in .tool-versions to 3.4.13

Gemfile and Gemfile.lock

# if the Gemfile pins the version directly, change it
ruby "3.4.13"
# (no Gemfile change needed if it says ruby file: ".ruby-version")

bundle install
bundle update --ruby    # updates RUBY VERSION in Gemfile.lock

For the 4.0 and 3.3 series, substitute 4.0.10 or 3.3.14.

Docker (Amazon ECS and similar)

# switch the base image to a fixed version (every FROM in multi-stage builds)
FROM ruby:3.4.13-slim

# rebuild and push to ECR
docker build -t <ACCOUNT>.dkr.ecr.<REGION>.amazonaws.com/<REPO>:<TAG> .
docker push <ACCOUNT>.dkr.ecr.<REGION>.amazonaws.com/<REPO>:<TAG>

# register a new task definition revision with the new image tag, then update the service
aws ecs update-service --cluster <CLUSTER> --service <SERVICE> \
  --task-definition <FAMILY>:<NEW_REVISION>
  • If you use a minor-version tag such as ruby:3.4-slim, rebuild with docker build --pull so a cached old image is not reused, and confirm with ruby -v.
  • Check Docker Hub to confirm the official image has published the fixed tag.
  • Updating Ruby inside a running container is undone by the next deployment.

Heroku and other PaaS

Update .ruby-version or the ruby line in the Gemfile and deploy. Check your provider's documentation or changelog to confirm it supports the fixed version. On the Elastic Beanstalk Ruby platform, check whether a platform version with the fixed Ruby has been released.

Ruby from OS packages

Ruby installed with apt or dnf cannot be updated until your distribution ships fixed packages. How fixes are applied and which package versions contain them differ by distribution, so check your distribution's security tracker for the status of these seven issues.

7. If you are on Ruby 3.2 or earlier

Ruby 3.2 and earlier have reached end of life and will not receive these fixes. The only path is to move to a supported series (3.3, 3.4 or 4.0). Since Ruby 3.3 is already in security maintenance, 3.4 or later is the practical target.

  • Older Rails versions may not support newer Ruby. Check that your Rails version supports the target Ruby first, and plan a Rails upgrade alongside it if needed.
  • Gems with native extensions may need updates for a newer Ruby. Run bundle outdated to see what is behind.
  • For applications with few tests, exercise the main screens and batch jobs in a staging environment before releasing to production.
FAQ

Frequently Asked Questions

QIf we never build regular expressions from user input, do we still need to update?
A

Yes. Two of the seven issues occur in string case conversion (upcase, downcase and so on). That processing is used widely in web applications and inside Rails and gems, so treat applications that do not use user-supplied patterns as affected too.

QAre we safe if we pass input through Regexp.escape?
A

Regexp.escape keeps input from being interpreted as regex syntax; it was not presented as a mitigation for these bugs. The details of which inputs trigger them have not been published, so update Ruby itself.

QDo we also need to upgrade Rails?
A

For a patch update within the same series (for example 3.4.x to 3.4.13), Rails usually does not need to change. If you are moving from Ruby 3.2 or earlier to 3.3 or later, first check that your Rails version supports the target Ruby.

QWhat are the CVE IDs and severity (CVSS)?
A

As of November 21, 2026, CVE IDs have been requested but not yet assigned. The ruby-lang.org announcement does not give CVSS scores. It says the Ruby team is aware of PoCs showing that some of the issues can be used for remote code execution.

QWhat if we use Ruby from OS packages?
A

Distributions such as Ubuntu, Debian and RHEL-based systems sometimes backport fixes without changing the version number. Check your distribution's security tracker for the status of these seven issues.

MOOBONISO/IEC 27001 CertificationAWS Partner Select Tier ServicesKinsta Agency Partner Badge
Copyright © 2026 MOOBON, Inc. All Rights Reserved.
Standard: ISO/IEC 27001:2022
Scope: Web system design support / Development, operation, and maintenance of in-house cloud services / Contract system development, operation, and maintenance / Server construction, operation, and maintenance