# Regexp compilation fixes related to GitLab's CVE-2026-89078, CVE-2026-93577, CVE-2026-97229 and CVE-2026-110264

DevFeed: [Regexp compilation fixes related to GitLab's CVE-2026-89078, CVE-2026-93577, CVE-2026-97229 and CVE-2026-110264](<https://devfeed.tech/articles/regexp-compilation-fixes-related-to-gitlab-s-cve-2026-89078-cve-2026-93577-cve-2026-97229-and-cve-2026-110264-96745.md>)

Original publisher: [Read original article](<https://www.ruby-lang.org/en/news/2026/10/23/regexp-fixes-for-gitlab-cves/>)

Published: 2026-10-23T03:11:22Z

Content type: release

Language: en

Sources: [Ruby-lang](<https://devfeed.tech/sources/ruby-lang.md>)

Topics: [Regular expression](<https://devfeed.tech/topics/regular-expression.md>), [Memory Safety](<https://devfeed.tech/topics/memory-safety.md>), [Parser](<https://devfeed.tech/topics/parser.md>)

Tags: [2026](<https://devfeed.tech/tags/2026.md>), [code-execution](<https://devfeed.tech/tags/code-execution.md>), [compilation](<https://devfeed.tech/tags/compilation.md>), [compile](<https://devfeed.tech/tags/compile.md>), [compiler](<https://devfeed.tech/tags/compiler.md>), [cve](<https://devfeed.tech/tags/cve.md>), [engine](<https://devfeed.tech/tags/engine.md>), [gitlab](<https://devfeed.tech/tags/gitlab.md>), [integer-overflow](<https://devfeed.tech/tags/integer-overflow.md>), [regexp](<https://devfeed.tech/tags/regexp.md>), [regular-expressions](<https://devfeed.tech/tags/regular-expressions.md>), [release](<https://devfeed.tech/tags/release.md>), [releases](<https://devfeed.tech/tags/releases.md>), [remote-code-execution](<https://devfeed.tech/tags/remote-code-execution.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

## AI overview

Ruby 4.0.9, 3.4.12 and 3.3.13 fix three Onigmo regular-expression compilation bugs associated with four CVEs GitLab identified after attacker-controlled patterns caused memory corruption and could enable remote code execution. The bugs include a parser double free, overflow in compiled-pattern size, and overflow of internal pattern IDs. They affect applications that compile attacker-controlled strings using APIs such as Regexp.new, Regexp.union or Regexp.compile, or interpolate them into regexp literals. Applications using only developer-written patterns are not affected. Regexp.timeout and pattern-length limits do not reliably protect against these issues. The recommended action is to upgrade to one of the patched releases or later; if upgrading is not possible, avoid compiling regexps from untrusted input. The article says Ruby has not yet requested CVE identifiers for its fixes and plans to discuss how Ruby should document and classify this risk.

## Source excerpt

We have released Ruby 4.0.9, 3.4.12 and 3.3.13. They fix several bugs in Ruby's regular expression engine (Onigmo) that GitLab found could be used for remote code execution on GitLab servers. GitLab published four CVEs for these issues, and the Ruby releases contain the fixes for the underlying bugs in Ruby. Background GitLab compiles regular expressions supplied by its users, such as patterns in CI configuration, with Regexp.new. GitLab found that specially crafted patterns could corrupt memory while Ruby compiles them, and that this could be turned into remote code execution on GitLab servers. GitLab addressed these issues in its own releases by patching the Ruby it ships, and assigned the following CVE identifiers: CVE-2026-89078: Double Free issue in Regular Expression Parser (GitLab 19.4.1) CVE-2026-93577: Integer Overflow issue in Regular Expression Compiler (GitLab 19.4.1) CVE-2026-97229: Integer Overflow issue in CI/CD Regular Expression Compiler (GitLab 19.4.2) CVE-2026-110264: Integer Overflow issue in Regular Expression Compiler (GitLab 19.5.1) Fixes in Ruby The following table shows the change in Ruby that fixes the bug behind each CVE, and the first release of each series that contains it. GitLab CVE Bug in Ruby Change Ruby 4.0 Ruby 3.4 Ruby 3.3 CVE-2026-89078 Double free when parsing a pattern fails after an alternation #13332 4.0.0 3.4.12 3.3.13 CVE-2026-93577, CVE-2026-97229 Integer overflow in the size of a compiled pattern #19020 4.0.8 3.4.12 3.3.13 CVE-2026-110264 Overflow of internal IDs in a pattern with many repeats #16801 4.0.9 3.4.12 3.3.13 Ruby 4.0.9, 3.4.12 and 3.3.13 contain all of these fixes. Who is affected These bugs are reached only when an application compiles a regular expression from a string that an attacker controls, for example by passing it to Regexp.new, Regexp.union or Regexp.compile, or by interpolating it into a regexp literal such as /#{input}/. Applications that only use regular expressions written by their own developers