CVE-2026-97229: GitLab runs code from a crafted regular expression in CI/CD configuration

ByLinuxtastic

November 29, 2026 #CVE, #GitLab

GitLab Community and Enterprise Edition compile the regular expressions found in a project’s CI/CD configuration with the Ruby regexp engine underneath them. In 19.2, 19.3 and 19.4 a crafted expression overflows an integer in that compiler, corrupts memory and, in GitLab’s own words, could under certain conditions let an unauthenticated user execute arbitrary code on the GitLab server. The underlying bug is in Ruby itself, so the same expression hurts any Ruby application that compiles patterns it did not write. CISA lists the GitLab flaw as exploited in the wild. If you run a self-managed GitLab on 19.2 below 19.2.8, 19.3 below 19.3.5 or 19.4 below 19.4.2, upgrade today; there is no configuration workaround. This page shows how to find the version, what the bug leaves in the logs, how to upgrade on each install method, and why a regexp timeout is not a defence.

CVE-2026-97229 at a glance.

ComponentGitLab CE/EE’s CI/CD configuration compiler, through the Onigmo regular-expression compiler in the Ruby runtime that GitLab bundles (Omnibus packages, the Docker image and the Helm chart all ship their own Ruby). The same Ruby bug is tracked as GHSA-22mf-ggw7-pxfx and affects Ruby 3.3 below 3.3.13, 3.4 below 3.4.12 and 4.0 below 4.0.8
Affected versionsGitLab CE and EE 19.2.0 to 19.2.7, 19.3.0 to 19.3.4 and 19.4.0 to 19.4.1 (GitLab patch release of 12 October 2026). Earlier lines are out of support and not assessed
Fixed inGitLab 19.2.8, 19.3.5 and 19.4.2, released 12 October 2026; the fixed Ruby releases are 3.3.13, 3.4.12 and 4.0.8 (Ruby news, 23 October 2026)
SeverityCVSS 3.1 10.0 Critical from the GitLab CNA (AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H); NVD carries that vector and has not published its own. Red Hat rates the Ruby packages Moderate with its own CVSS 3.1 of 9.8 (S:U). Ubuntu priority Medium for its Ruby packages. CWE-190, integer overflow
Exploited in the wildOn CISA’s Known Exploited Vulnerabilities catalogue, added 29 October 2026; federal remediation was due 1 November 2026. Ransomware use is recorded as Unknown. EPSS 0.743 (99.6th percentile) on 27 November 2026
Who is exposedany self-managed GitLab on an affected version that is reachable by someone who can get a CI/CD configuration compiled, which GitLab says can, under certain conditions, include an unauthenticated user. GitLab.com is patched by GitLab. Separately, any Ruby service that compiles regular expressions from user input on an unpatched Ruby. Not affected: 19.2.8, 19.3.5, 19.4.2 and later
PublishedCVE record 13 October 2026; this page built 29 November 2026, last updated 29 November 2026

What it is

A .gitlab-ci.yml file can carry regular expressions in several places: rules that match on branch names and variables, the coverage extractor, only and except clauses. GitLab compiles those patterns with Ruby’s Regexp class, which hands them to Onigmo, the regexp engine built into the Ruby interpreter. Onigmo computes the size of the compiled program as it goes, and a pattern constructed to make that size wrap past the integer that holds it ends with the compiler writing a program that does not fit where it put it. GitLab’s advisory calls the result an integer overflow in the CI/CD regular-expression compiler and rates it a full 10.0, because the memory being corrupted belongs to the Puma or Sidekiq process that runs the whole application, and Ruby’s own notice says plainly that neither Regexp.timeout nor a limit on pattern length reliably prevents it.

Ruby fixed the compiler in pull request #19020 and shipped the fix in 3.3.13, 3.4.12 and 4.0.8, with 3.3.13 released as an exception to that branch’s security-maintenance status. GitLab’s 12 October patch release bundles the patched interpreter, and its release notes list “Ruby regexp program size” and “repeat-range double-free” backports for Ruby 3.3 and 3.4 alongside the CVE entry. The report came from the researcher joaxcar through GitLab’s bounty programme. Ruby’s notice adds, in an update of 20 November 2026, that the CVE identifiers GitLab assigned are the ones to track for the Ruby issues, since no separate Ruby CVEs were issued; that is why the Debian, Ubuntu and Red Hat rows below are about ruby packages and not about GitLab, which none of them ship.

GitLab is a Linux server application in every supported form: the Omnibus .deb and .rpm packages, the Docker image and the Helm chart. The fixed releases carry the fixed Ruby, so the GitLab version is the thing to check and change. The same patch release fixes twenty-three other CVEs, five of them rated High, so an upgrade for this one is not wasted if you turn out to be unaffected.

Who is affected on Linux

No distribution packages GitLab; the rows below show what each tracker says about its Ruby interpreter, which is the half of the bug that reaches other software on the box. Each row is what the tracker showed on 29 November 2026; the link in a row is the tracker page, which will be newer than this one.

DistributionStatusFixed package
AlpineNot consulted—
DebianGitLab not packaged. ruby3.3 on trixie fixed by DSA-6614-1; ruby3.1 on bookworm still listed vulnerable; forky and sid vulnerabletrixie ruby3.3 3.3.13-0+deb13u1 (security archive now carries 3.3.14-0+deb13u1)
UbuntuGitLab “not in release” on 22.04, 24.04, 26.04 and 26.10 (Ubuntu removed the package as unmaintainable); priority Medium. Ruby package rows were not shown on the page as read—
RHEL, Rocky, Alma, CentOS StreamGitLab not packaged. Ruby packages rated Moderate; the page gives no per-release erratum listsee the Red Hat page for RHSA numbers as they appear
Fedora, openSUSE/SLE, ArchNot consulted—
GitLab Omnibus, Docker image, Helm chart (about.gitlab.com)Affected on 19.2.0–19.2.7, 19.3.0–19.3.4, 19.4.0–19.4.1GitLab 19.2.8, 19.3.5 or 19.4.2

How to check

Three questions: which GitLab is running, which Ruby it bundles, and whether strangers can reach it. The first answers the other two on a GitLab host, because the patched releases carry the patched Ruby; the Ruby line matters for any other Ruby application on the same machine.

# 1. GitLab version: below 19.2.8 / 19.3.5 / 19.4.2 on its line is affected
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION          # Omnibus
docker exec gitlab cat /opt/gitlab/embedded/service/gitlab-rails/VERSION   # Docker
curl -s -H "PRIVATE-TOKEN: $TOKEN" https://gitlab.example.com/api/v4/version   # any install

# 2. the bundled Ruby, and the system Ruby if other apps use it
/opt/gitlab/embedded/bin/ruby -v
ruby -v 2>/dev/null
dpkg -l 'ruby3.*' 'libruby*' 2>/dev/null | awk '/^ii/{print $2, $3}'
rpm -q ruby 2>/dev/null

# 3. is the instance open: a 200 here means anonymous users see the sign-in and explore pages
curl -s -o /dev/null -w '%{http_code}\n' https://gitlab.example.com/explore

If step 1 shows 19.2.8, 19.3.5, 19.4.2 or later, the GitLab side is fixed. Anything older on one of those three lines is affected whatever step 3 says: GitLab’s advisory places the attacker as unauthenticated under certain conditions, and an instance that only authenticated users can reach is still exposed to every one of them. A Ruby below 3.3.13, 3.4.12 or 4.0.8 in step 2 is the same bug for any Ruby program on that host that compiles a pattern from user input, which is more programs than people expect.

Because the item is on the KEV list, look back. A compiler overflow that reaches code execution has usually crashed the worker a few times first, so dying Puma and Sidekiq workers around pipeline creation are the signature; GitLab also published six self-managed detections for exploitation attempts in the patch-release post, which are the authoritative list.

# worker crashes: a segfault in puma or sidekiq is not normal
sudo grep -hiE 'segfault|SIGSEGV|\[BUG\]' /var/log/gitlab/puma/*.log /var/log/gitlab/sidekiq/current 2>/dev/null | tail -50
sudo journalctl -k --since -60d | grep -iE 'segfault.*(ruby|puma|bundle)'

# pipeline creation and CI lint calls from addresses you do not recognise
sudo zgrep -hE '"path":"/api/v4/(ci/lint|projects/[0-9]+/(ci/lint|pipeline))' /var/log/gitlab/gitlab-rails/api_json.log* \
  | grep -oE '"remote_ip":"[^"]+"' | sort | uniq -c | sort -rn | head

# a new process tree under the git user that is not gitlab's own
ps -u git -o pid,ppid,etime,comm,args | grep -vE 'puma|sidekiq|gitaly|gitlab-|bundle|ruby|git-upload|git-receive|ps'

A shell, a downloader or a crypto-miner running as the git user is not a false positive; a run of Puma segfaults followed by a quiet period is worth treating the same way. The GitLab process can read every repository and every CI variable on the instance, so a compromise means rotating every secret CI has ever held, not only the server’s own credentials. Restoring a Linux Server covers rebuilding, and GitLab’s own backups restore cleanly onto a fresh install of the fixed version.

How to fix it

Upgrade GitLab to the patched release on your line. The Omnibus package restarts the services itself; the Docker and Helm routes replace the running containers. Stay within the line you are on (19.2, 19.3 or 19.4) unless you have read the upgrade path for jumping lines.

# Omnibus on Debian/Ubuntu (swap gitlab-ce for gitlab-ee as appropriate)
sudo apt-get update && sudo apt-get install gitlab-ee
# Omnibus on RHEL family
sudo dnf update gitlab-ee
# Docker: pull the fixed tag for your line and recreate the container
docker pull gitlab/gitlab-ee:19.4.2-ee.0 && docker compose up -d
# Helm: upgrade the chart to the version that ships 19.4.2 / 19.3.5 / 19.2.8
helm repo update && helm upgrade gitlab gitlab/gitlab --reuse-values

# confirm
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
sudo gitlab-ctl status

There is no mitigation. GitLab’s advisory lists none for this CVE, and the only one Ruby offers is not to compile regular expressions from untrusted sources, which a CI system cannot do and still be a CI system. For other Ruby applications on the host, upgrade the interpreter to 3.3.13, 3.4.12 or 4.0.8, or to the distribution’s fixed package where there is one.

Do not reach for Regexp.timeout, a maximum pattern length or a web-application firewall rule as a stopgap. Ruby’s notice says the first two do not reliably protect against this class of bug, because the overflow happens while the pattern is being compiled, before any match runs, and a short pattern can still be a hostile one. A WAF sees a YAML file, not a compiled regexp program, and has nothing to match on. The upgrade is the fix.

Sources

  • CVE-2026-97229 at CVE.org — the GitLab CNA record: description, affected ranges, CVSS 10.0 vector, CWE-190 (published 13 October 2026)
  • NVD — status Analyzed, the CNA vector, CPE ranges for GitLab and for Ruby, KEV dates (last modified 2 November 2026)
  • CISA Known Exploited Vulnerabilities — added 29 October 2026, action due 1 November 2026
  • GitLab patch release 19.4.2, 19.3.5, 19.2.8 — the advisory text, severity, affected and fixed versions, credit and the self-managed detections (12 October 2026)
  • Ruby: regexp fixes for GitLab CVEs — the underlying Onigmo bug, pull request #19020, fixed Ruby releases and the note on timeouts (23 October 2026, updated 20 November 2026)
  • Distribution trackers: Debian, Ubuntu, Red Hat — Ruby package status as of 29 November 2026
  • EPSS — 0.743, 99.6th percentile, scored 27 November 2026

Related reading

This advisory page was assembled from the primary sources listed above on 29 November 2026 and is updated when they change. The facts are theirs; the checks and the ordering are ours. If a row in the distribution table is out of date, the tracker link in that row is the current word.