23 октября вышли Ruby 4.0.9, 3.4.12 и 3.3.13. Они исправляют три бага в Onigmo — движке регулярных выражений Ruby, — которые GitLab превратил в удалённое выполнение кода на своих серверах.
Откуда история
GitLab компилирует регулярные выражения, заданные пользователями (например, в CI-конфигурации), через Regexp.new. Специальные паттерны повреждали память при компиляции. GitLab закрыл это у себя, пропатчив поставляемый Ruby, и выпустил четыре CVE: CVE-2026-89078 (double free), CVE-2026-93577 и CVE-2026-97229 (переполнение размера скомпилированного паттерна), CVE-2026-110264 (переполнение внутренних ID в паттерне с множеством повторов). Последние две оценены в CVSS 10.0. Все баги нашёл Johan Carlsson (joaxcar) через баг-баунти GitLab.
Кого касается
Любого приложения, которое компилирует регулярное выражение из строки под контролем атакующего: Regexp.new, Regexp.union, Regexp.compile или интерполяция вида /#{input}/. Если в коде только «свои» регулярки — вы не затронуты.
Regexp.timeoutне защищает, ограничение длины паттерна — тоже: часть багов срабатывает на коротких строках.- В ветке 4.0 нужна именно 4.0.9: вышедшая днём ранее 4.0.8 не содержит фикс для CVE-2026-110264.
- Ruby 3.3 в режиме security-only, но фикс включён как исключение. Ruby 3.2 и старее исправлений не получат.
Нюанс с CVE
Ruby пока не запрашивал собственные CVE и просит отслеживать проблемы по номерам GitLab. Поскольку в записях GitLab затронутым продуктом указан только GitLab, сканеры зависимостей могут не связать их с установленной версией Ruby — проверять придётся вручную.
On Oct 23 the Ruby team released Ruby 4.0.9, 3.4.12 and 3.3.13. They fix three bugs in Onigmo, Ruby’s regex engine, which GitLab found could be turned into remote code execution on its servers.
Background
GitLab compiles user-supplied regexes (for example in CI configuration) with Regexp.new. Crafted patterns corrupted memory during compilation. GitLab fixed this on its side by patching the Ruby it ships and issued four CVEs: CVE-2026-89078 (double free), CVE-2026-93577 and CVE-2026-97229 (integer overflow in compiled pattern size) and CVE-2026-110264 (overflow of internal IDs in a pattern with many repeats). The last two are rated CVSS 10.0. All were found by Johan Carlsson (joaxcar) via GitLab’s bug bounty.
Who is affected
Any application that compiles a regex from an attacker-controlled string: Regexp.new, Regexp.union, Regexp.compile or interpolation such as /#{input}/. If your code only uses regexes written by your own developers, you are not affected.
Regexp.timeoutdoes not protect you, and capping pattern length does not reliably help either: some bugs trigger on short patterns.- On the 4.0 branch you need 4.0.9 specifically: 4.0.8, released a day earlier, lacks the fix for CVE-2026-110264.
- Ruby 3.3 is in security-only maintenance but gets the fix as an exception. Ruby 3.2 and older will not be fixed.
The CVE caveat
Ruby has not requested its own CVE IDs for now and asks users to track the issues by GitLab’s numbers. Since GitLab’s records list only GitLab as the affected product, dependency scanners may not match them against your Ruby version — check manually.