Ruby Security Releases: Upgrade to 4.0.10, 3.4.13, or 3.3.14

On November 18, the Ruby core team released Ruby 4.0.10, 3.4.13, and 3.3.14. These releases fix seven vulnerabilities in Ruby's regular expression engine and in the case conversion of strings. The core team is aware of proof-of-concept exploits showing that some of them can be used to trigger remote code execution, and it strongly recommends upgrading.

Ruby Central doesn't usually post about individual Ruby releases, but we are breaking precedent in this case because we want the message to get to people who don't watch ruby-lang.org. The official security advisory is the source of truth. Please read it.

Who is affected

  • Ruby 4.0.0 through 4.0.9
  • Ruby 3.4.0 through 3.4.12
  • Ruby 3.3.13 and earlier. That includes Ruby 3.2 and older, which have reached end of life.

Last month's regex fixes mattered primarily to applications which build regular expressions from untrusted input. Four of the seven fixes this time are similar, but two are not. They are memory-safety bugs in the case conversion of strings, and the advisory says that changing the case of a crafted string may allow remote code execution. The individual advisories add details. One applies to strings in some single-byte encodings, such as ISO-8859-1 and Windows-1252. The other applies when the converted result exceeds 4 GiB. If your application handles legacy-encoded text, such as email or imported files, an ordinary case conversion could be the trigger.

The seventh bug can disclose memory contents or crash the process when a crafted string is matched against a pattern that uses a case-insensitive backreference.

What to do

  • On Ruby 4.0, 3.4, or 3.3, upgrade to 4.0.10, 3.4.13, or 3.3.14.
  • On Ruby 3.2 or earlier, these versions have reached end of life and will not receive the fixes. We strongly recommend upgrading to a supported version. The maintenance branches page shows what is supported and for how long.
  • If your Ruby comes from somewhere else, such as a Linux distribution, a container image, or a hosting platform, watch for an updated package or image, then rebuild and redeploy.

The advisory doesn't list a workaround. Upgrading is the fix.

One more note. CVE identifiers have been requested but not yet assigned, so the advisory refers to each issue by its GitHub Security Advisory ID. If your tooling tracks vulnerabilities by CVE number, it may not flag these yet.

Thank you to the researchers who reported these issues, and to the Ruby core team and branch maintainers who shipped three releases on the same day.