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.
| GHSA | Issue | Possible impact | Reported by |
|---|---|---|---|
| GHSA-34m4-m9fh-gqp5 | Heap buffer overflow in case conversion of strings (one byte) | Changing the case of a crafted string may allow remote code execution | Stephan Lipp (Ada Logics), Anthropic |
| GHSA-87fm-7w84-j2px | Integer overflow in case conversion of strings (leads to a heap buffer overflow) | Changing the case of a crafted string may allow remote code execution | baba__yaga (HackerOne) |
| GHSA-7x2q-68qv-6p8x | Double free in regular expression compilation | May allow remote code execution in applications that compile attacker-controlled patterns | Stephan Lipp (Ada Logics), Anthropic |
| GHSA-3p8q-wmhx-vm2w | Heap 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 patterns | aphantom (HackerOne) |
| GHSA-wpqw-5qxg-m68r | Out-of-bounds read in case-insensitive regular expression matching | May allow remote code execution in applications that use attacker-controlled patterns | Stephan Lipp (Ada Logics), Anthropic |
| GHSA-7whj-cfh7-xgm4 | Heap buffer overflow in Regexp#to_s | Converting a crafted regex to a string may allow information disclosure or remote code execution in applications that compile attacker-controlled patterns | Stephan Lipp (Ada Logics), Anthropic |
| GHSA-pvgc-g7gj-pv6h | Out-of-bounds read in case-insensitive backreference matching | Matching a crafted string may disclose memory contents or crash the process | Hiroya 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
| Series | Affected versions | Fixed version |
|---|---|---|
| 4.0 | 4.0.0 to 4.0.9 | 4.0.10 |
| 3.4 | 3.4.0 to 3.4.12 | 3.4.13 |
| 3.3 | 3.3.13 and earlier | 3.3.14 |
| 3.2 and earlier | End of life | No 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]}/iYou can find candidates with a search like this.
grep -rnE 'Regexp\.(new|compile|union)|/[^/]*#\{' app lib configRegexp.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 withdocker build --pullso a cached old image is not reused, and confirm withruby -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 outdatedto see what is behind. - For applications with few tests, exercise the main screens and batch jobs in a staging environment before releasing to production.
Related links
We handle Ruby and Rails version updates and the operation of applications running on AWS through our AWS Operations Service. For AWS security settings, try our free security assessment.
References
- ruby-lang.org: Security advisories: multiple vulnerabilities in Regexp and String case conversion (2026-11-18)
- ruby-lang.org: Security
- GHSA-34m4-m9fh-gqp5 (Heap buffer overflow in case conversion of strings (one byte))
- GHSA-87fm-7w84-j2px (Integer overflow in case conversion of strings (leads to a heap buffer overflow))
- GHSA-7x2q-68qv-6p8x (Double free in regular expression compilation)
- GHSA-3p8q-wmhx-vm2w (Heap buffer overflow in regular expression compilation (caused by an integer overflow in the regex engine))
- GHSA-wpqw-5qxg-m68r (Out-of-bounds read in case-insensitive regular expression matching)
- GHSA-7whj-cfh7-xgm4 (Heap buffer overflow in Regexp#to_s)
- GHSA-pvgc-g7gj-pv6h (Out-of-bounds read in case-insensitive backreference matching)
Frequently Asked Questions
QIf we never build regular expressions from user input, do we still need to update?
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?
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?
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)?
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?
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.
