Contents

Ruby applications that compile attacker-controlled regular expressions should update to Ruby 4.0.9, 3.4.12, or 3.3.13, released on October 23, 2026. These releases fix bugs in the Onigmo regular expression engine linked to GitLab vulnerabilities that could lead to remote code execution.

Key points#

  • Applications that compile attacker-controlled strings as regular expression patterns are affected. Applications that use only developer-written patterns fall outside the disclosed scope.
  • Ruby 4.0.9, 3.4.12, and 3.3.13 include all fixes related to the four GitLab CVEs.
  • Regexp.timeout cannot prevent these bugs, and pattern length limits are not a reliable defense.
  • Administrators of self-managed GitLab instances must install the applicable patched GitLab release. GitLab.com has already been patched.

Which applications are affected#

The key question is whether an attacker can control the strings an application compiles as regular expressions. Relevant entry points include Regexp.new, Regexp.union, and Regexp.compile, as well as interpolation such as /#{input}/.

Review features that accept search patterns, validation rules, or configuration containing regular expression syntax. In GitLab, project users can supply patterns through features such as CI configuration, which the server compiles with Regexp.new.

Passing untrusted text to a fixed, developer-written regular expression is different from compiling that text as a pattern. The reported scope concerns pattern compilation. Applications that use only developer-written regular expression patterns are not affected by these bugs.

What the releases fix#

The fixes address memory handling flaws and integer overflows during regular expression compilation. GitLab confirmed that memory corruption caused by crafted patterns could lead to arbitrary code execution on the server.

| GitLab CVE | Underlying Ruby bug | Fixed version in Ruby 4.0 | |---|---|---| | CVE-2026-89078 | Double free after parsing fails following the alternation delimiter | | 4.0.0 | | CVE-2026-93577 and CVE-2026-97229 | Integer overflow when calculating the compiled pattern size | 4.0.8 | | CVE-2026-110264 | Internal ID overflow in patterns containing many repetitions | 4.0.9 |

For the other maintained branches covered by the announcement, Ruby 3.4.12 and 3.3.13 are the first releases to include all these fixes. Earlier Ruby 4.0 releases may include some fixes, but 4.0.9 is the update that includes them all.

How to update#

Use the patched release for your current Ruby branch—4.0.9, 3.4.12, or 3.3.13—or a later release containing the fixes. Check the Ruby versions used by deployed applications, including containers and background workers. Checking developers’ machines alone does not tell you what is running in production.

For self-managed GitLab, follow GitLab’s upgrade guidance for your installed release. GitLab distributed fixes through updates including 19.4.1 on September 23, 19.4.2 on October 12, and 19.5.1 on October 21. The October 21 announcement strongly recommended updating self-managed instances and stated that GitLab.com had already been patched.

After deployment, verify the running version and test features that accept regular expression patterns. If you cannot update Ruby immediately, Ruby’s recommended workaround is to stop compiling regular expression patterns from untrusted input. Timeout settings are not an equivalent substitute.

Mitigation limits and severity#

Regexp.timeout does not prevent these compilation-time bugs. Because some can be triggered by short patterns, limiting the maximum pattern length is not considered a reliable workaround.

GitLab assigned CVSS v3.1 scores of 10.0 to CVE-2026-97229 and CVE-2026-110264, reporting that unauthenticated code execution was possible under certain conditions. CVE-2026-89078 and CVE-2026-93577 have scores of 9.9. These ratings describe the GitLab vulnerabilities and do not mean that every Ruby application is remotely exploitable.

At the time of the announcement, Ruby had not requested its own CVEs for these bugs and was considering whether to do so. In the meantime, the team advised using GitLab’s CVE identifiers for security management. The absence of Ruby-specific CVEs is therefore no reason to postpone necessary updates.

Next steps#

Check the Ruby runtimes of your deployed applications today. If they compile attacker-controlled regular expression patterns, schedule an update to the patched release for their branch.

Source: https://gihyo.jp/article/2026/10/ruby-regexp-fixes-gitlab-cves

Contents