Security alert · Critical
Ruby: seven memory-safety flaws in regex and string handling, remote code execution possible
· 4 minutes read · Centoculus Security Team
Known since
Affected: Ruby 4.0.0–4.0.9, 3.4.0–3.4.12, 3.3.13 and earlier (3.2 and older: end of life, no fix)
What happened
On 19 November 2026 the Ruby project published a security announcement about seven memory-safety flaws in the Ruby interpreter. The flaws are in the regular expression engine and in the code that changes the case of strings. Fixed versions came out on 18 November: Ruby 4.0.10, 3.4.13 and 3.3.14.
The maintainers write: "We are aware of PoCs that prove some of them can be used to trigger remote code execution." Their advisories rate three flaws critical, three high and one moderate. No CVE IDs have been assigned yet. The project has requested them and tracks the flaws by their GitHub advisory IDs:
- GHSA-34m4-m9fh-gqp5 (critical): a one-byte heap overflow when the case of a crafted string is changed. It affects certain single-byte encodings such as ISO-8859-1 or Windows-1252. A remote code execution proof of concept exists.
- GHSA-7x2q-68qv-6p8x (critical): a double free when a crafted regular expression is compiled. A remote code execution proof of concept exists.
- GHSA-3p8q-wmhx-vm2w (critical): an integer overflow during regex compilation that causes a heap overflow. A remote code execution proof of concept exists.
- GHSA-87fm-7w84-j2px (high): an integer overflow in case conversion that causes a heap overflow when the result is larger than 4 GiB. A remote code execution proof of concept exists, but according to The Hacker News the size needed puts it out of reach for most requests.
- GHSA-7whj-cfh7-xgm4 (high): a heap overflow in
Regexp#to_swith a crafted compiled regular expression. It can disclose information or run code, and a remote code execution proof of concept exists. - GHSA-wpqw-5qxg-m68r (high): an out-of-bounds read in case-insensitive regex matching. The proof of concept corrupts memory in a way the attacker controls. Code execution is possible but has not been shown.
- GHSA-pvgc-g7gj-pv6h (moderate): an out-of-bounds read when a case-insensitive backreference is matched against a crafted string. It can disclose memory contents or crash the process.
The advisories report no attacks so far. The proof-of-concept code has not been published.
Who is affected
These Ruby versions are affected:
- Ruby 4.0.0 through 4.0.9 (fixed in 4.0.10)
- Ruby 3.4.0 through 3.4.12 (fixed in 3.4.13)
- Ruby 3.3.13 and earlier (fixed in 3.3.14)
- Ruby 3.2 and earlier have reached end of life and will not get these fixes
The flaws are in Ruby itself, so every application on an affected version contains them. Whether an attacker can reach them depends on the application:
- Regex flaws: these matter mainly when an application builds a regular expression from input an attacker controls and then compiles or runs it. Matching untrusted text against a pattern the developers wrote themselves carries no such risk, with one exception: the moderate flaw GHSA-pvgc-g7gj-pv6h is triggered when a crafted string is matched against a fixed pattern that uses a case-insensitive backreference.
- Case-conversion flaws: these have nothing to do with regular expressions. They are triggered when the application changes the case of a crafted string, for example when it processes imported or outside text.
Servers that do not run Ruby are not affected. Updating gems or a framework such as Rails does not help. What matters is the Ruby interpreter that runs your application servers, background workers and container images.
What to do now
- List every place Ruby runs: application servers, job and background workers, cron scripts and container images. Remember Ruby version managers (rbenv, rvm, asdf, chruby) as well as the system Ruby.
- Update to Ruby 4.0.10, 3.4.13 or 3.3.14, depending on which line you use. If Ruby comes from your distribution's packages, install the security updates from your distribution and check its security tracker for these advisories. If you use a version manager, install the new version and switch your applications to it, for example in
.ruby-version, your Gemfile or your deployment configuration. - Rebuild container images on a fixed Ruby base image and deploy them again.
- Restart all Ruby processes, such as Puma, Unicorn, Passenger, Sidekiq and other workers, so that they load the new interpreter. Processes that are still running keep using the old version.
- Move applications still on Ruby 3.2 or older to a supported line. These versions will not be fixed. Ruby 3.3 is supported until the end of March 2027.
- Until the update is done, ask your developers whether the application builds regular expressions from user input or changes the case of untrusted text. Such code paths should be updated first.
How to check whether you are affected
- Run
ruby -vas the user that runs the application, in the application directory, so that version managers pick the right version. Any version below 4.0.10, 3.4.13 or 3.3.14 within its line is affected, as is any 3.2 or older. - Check the interpreter that is actually running. For example, run
ls -l /proc/<PID>/exefor a Puma or Sidekiq process, ordocker run --rm <image> ruby -vfor a container image. - If Ruby comes from distribution packages, look up the package version and compare it with your distribution's security advisory for these flaws. Distribution packages may contain the fixes under a different version number.
- Unexpected crashes (segmentation faults) of Ruby processes in your application or system logs can point to attempts to trigger memory corruption. Such crashes are worth investigating.
Sources
Related posts
Alerts ·
WordPress plugin vulnerabilities: 8 plugins, including WPvivid Backup
Vulnerabilities in eight WordPress plugins were disclosed on 20 November 2026, among them WPvivid Backup, NextGEN Gallery and Optimole. The most serious, in Mang Board, lets unauthenticated visitors delete board posts.
Alerts ·
Drupal core: critical installer flaw can allow site takeover without login
Drupal fixed a critical flaw in the built-in installer (install.php). Under specific conditions it lets attackers without a login reinstall a site and take it over. Update to 10.6.22, 11.3.22 or 11.4.13, and block the installer.
Alerts ·
VMware vCenter Server: critical authentication bypass fixed after zero-day attacks
Broadcom has fixed a critical authentication bypass in VMware vCenter Server (VMSA-2026-0009). Mandiant says it was used in zero-day attacks from early September 2026. vCenter 8.0, 9.0 and 9.1 are affected. ESX hosts are not.