GitLab

GitLab CVE-2026-97229: Check and Patch the CI/CD Regex RCE

When your GitLab server lets strangers register and open public projects, it has carried a remote shell risk that GitLab disclosed in October. The cause sits in a place few teams watch: the regular expressions people write in .gitlab-ci.yml. CVE-2026-97229 is an integer overflow in the Onigmo regex compiler inside GitLab’s bundled Ruby, rated CVSS 10.0, and GitLab’s advisory says it lets an unauthenticated attacker run code on the server through a crafted pattern in CI/CD configuration.

Original content from computingforgeeks.com - post 192586

The first fixed builds are GitLab CE/EE 19.4.2, 19.3.5 and 19.2.8, but they aren’t where you should stop, because critical fixes for another regex bug, a Git heap overflow and a Ruby string bug have shipped since. We ran every step in November 2026 on Ubuntu 26.04, Rocky Linux 10.2 with SELinux enforcing and the official Docker image, starting each server on a vulnerable build so the before and after versions in the screenshots are real.

Finding the fixed build for your branch

GitLab’s 19.4.2 critical patch release advisory lists 19.2 before 19.2.8, 19.3 before 19.3.5 and 19.4 before 19.4.2 as affected, on every install type: Omnibus packages, Docker images, the Helm chart and source installs. GitLab.com is patched, and GitLab Dedicated tenants were patched through an internal release before the advisory went out, so neither needs any action. The last column is the one to act on, since it also covers CVE-2026-110264, the Git flaw CVE-2026-105437 and the Ruby2Shell fix released on 20 November.

Your branchVulnerable to CVE-2026-97229First fixed build (12 Oct)Build to install now (20 Nov)
19.6No, outside the affected rangeNot needed19.6.1
19.5No, outside the affected rangeNot needed19.5.8
19.419.4.0 and 19.4.119.4.219.4.10
19.319.3.0 to 19.3.419.3.519.3.9 closes this CVE; 19.4.10 also closes Ruby2Shell
19.219.2.0 to 19.2.719.2.819.2.10 closes this CVE but not the Git RCE; 19.4.10 closes both
19.1 and olderNoNot needed19.4.10 through the upgrade stops; exposed to CVE-2026-105437 and CVE-2026-132825
Fixed GitLab CE/EE builds for CVE-2026-97229, checked against GitLab’s patch release feed on 20 November 2026

Our recommendation is plain: if you run 19.2 or 19.3, treat the 19.2.10 or 19.3.9 build as a waypoint, then move to 19.4.10. GitLab’s maintenance policy covers 19.6, 19.5 and 19.4, and the 20 November advisory lists every version before 19.4.10 as affected by CVE-2026-132825, so 19.2 and 19.3 have no build that closes it. The 10 November release fixed CVE-2026-105437, a critical heap overflow in the bundled Git that can run commands in Gitaly, on 19.3.8 and later but never on 19.2. Older branches got the Org-mode RCE fix for CVE-2026-110264 in 19.1.9, 19.0.10 and 18.11.13, yet they still need the climb to 19.4.10 for the other two. Distribution repositories don’t carry any of these fixes either: the patched code only comes from GitLab’s own package repository, its Docker image or its Helm chart.

How the regex compiler bug gets reached

GitLab compiles regular expressions that users supply, such as the regexp filters under rules:exists and rules:changes in CI configuration, with Ruby’s Onigmo engine. The bug is an integer overflow in how Onigmo sizes a compiled pattern. GitLab’s own write-up describes this CVE as a bypass of its 19.4.1 fix for CVE-2026-93577. A pattern can hide its repeat bound from GitLab’s pre-compile scanner, and recompiling it as UTF-8 against a non-ASCII path pushes the size past what a 32-bit integer holds. The overflow corrupts memory in whichever Puma or Sidekiq worker compiles the pattern.

The word “unauthenticated” needs a qualifier. Rapid7 reproduced code execution on 19.4.1 and saw it fail on 19.4.2, and its analysis of CVE-2026-97229 says the path it demonstrated needed a user who could commit a .gitlab-ci.yml and a UTF-8 repository path to a public project. On an instance with open sign-up, anyone on the internet can become that user in a minute, so the practical exposure is the same.

The exploitation data is past the point of debate. These are the figures we pulled on 20 November 2026:

  • CISA KEV: listed on 29 October 2026, federal due date 1 November
  • CISA SSVC: exploitation active, automatable, technical impact total
  • EPSS: 0.69289, the 99.4th percentile, scored 19 November
  • Public proof-of-concept code: yes, on GitHub

Some early coverage got the fixed version wrong: BleepingComputer’s report named 19.3.4 as the 19.3 fix, but 19.3.4 is the build GitLab’s advisory lists as vulnerable, and our Rocky server ran it before the upgrade. Go by the advisory’s numbers.

Checking which GitLab build you run

The version you need is GitLab’s, not Ruby’s. On your Omnibus server, the environment rake task prints it along with the database version, and the VERSION file and the package manager confirm it:

sudo gitlab-rake gitlab:env:info | sed -n '/GitLab information/,/GitLab Shell/p'
cat /opt/gitlab/embedded/service/gitlab-rails/VERSION
dpkg-query -W gitlab-ce

On Rocky, AlmaLinux or RHEL, swap the last line for rpm -q gitlab-ce, and on EE the package is gitlab-ee. Our Ubuntu 26.04 server reported 19.4.1, one of the two vulnerable 19.4 builds. The VERSION file has no trailing newline, which is why its value runs into the dpkg-query output on the last line.

gitlab-rake gitlab:env:info on Ubuntu 26.04 showing GitLab CE 19.4.1, vulnerable to CVE-2026-97229, with the bundled Ruby 3.3.12 and no system Ruby

Look at the first command in that screenshot too. The host has no system ruby at all, while GitLab’s embedded Ruby reports 3.3.12. That bundled interpreter is the only one GitLab uses, so the Ruby packages you install from Ubuntu or Rocky do not change your exposure to this CVE either way.

Separating bundled Ruby from distro Ruby

The Ruby core team confirmed on 23 October that the underlying Onigmo bug is a Ruby bug. Its regexp fixes announcement maps CVE-2026-97229 to ruby/ruby pull request #19020 and advisory GHSA-22mf-ggw7-pxfx, fixed in Ruby 4.0.8, 3.4.12 and 3.3.13. Debian shipped ruby3.3 3.3.13-0+deb13u1 for trixie in DSA-6614-1. That matters for three kinds of install:

  • Omnibus packages and the official Docker image: patched by the GitLab upgrade alone
  • Source installs and custom images: upgrade GitLab, then rebuild Ruby
  • Your own Ruby apps that build regexes from user input: update the distro Ruby

You can’t use ruby -v as proof of the fix on Omnibus. GitLab patched its bundled Ruby in place without changing the version string, and our servers still reported 3.3.12 after landing on 19.4.8 and 19.3.9, and 3.3.11 inside the 19.2.10 container. If you run Ruby services next to GitLab, our Ruby2Shell check and patch guide covers the distro Ruby side, including the 3.3.14 and 3.4.13 releases from 18 November.

Checking the logs for exploitation attempts

Run these before you upgrade, because the upgrade restarts Puma and Workhorse and later log rotation can remove the evidence you’d want. GitLab’s security team published six detections with this advisory. On Omnibus, these are the files they point at:

  • gitlab-workhorse/current: 502 or badgateway on CI lint and GraphQL
  • gitlab-rails/application_json.log: RegexpMatcher rejections and timeouts
  • gitlab-rails/graphql_json.log: hostile regex constructs in ciLint variables
  • gitlab-rails/api_json.log: oversized non-ASCII path segments, 5xx bursts on /ci/lint
  • puma/puma_stderr.log: [BUG] crash dumps with onig frames
  • Sidekiq logs: “A worker terminated” right after a pushed .gitlab-ci.yml

The Workhorse check is the strongest signal, since a crashed Puma worker shows up there as a 502 on the exact endpoints the attack uses. These three counts cover the highest-value detections:

sudo grep -E '"uri":"[^"]*(ci/lint|/api/graphql)' /var/log/gitlab/gitlab-workhorse/current | grep -cE '"status":502|badgateway'
sudo grep 'RegexpMatcher' /var/log/gitlab/gitlab-rails/application_json.log | grep -cE 'rejected at compile time|match timed out|time budget exceeded'
sudo grep -c '\[BUG\]' /var/log/gitlab/puma/puma_stderr.log

All three returned 0 on our 19.4.1 server, which nobody had targeted. If you run Docker, your copies of the same files sit under the host directory you mounted at /var/log/gitlab.

Three grep checks for CVE-2026-97229 attempts in the GitLab workhorse, application_json and puma_stderr logs, each returning 0

A zero here is not a clean bill of health for you. When the kernel OOM killer takes out a Puma worker fast, no crash dump gets written, and log rotation may already have removed October’s lines. If your instance had open sign-up and public projects during October, check /var/log/gitlab/gitlab-rails/ archives and new user accounts as well, and treat any non-zero count as an incident.

Reducing exposure while the upgrade waits

GitLab’s advisory offers no workaround, so anything short of the upgrade only narrows the path. Rapid7’s suggestion is to restrict anonymous access to public projects and stop untrusted users from creating or writing to them, and it warns that this leaves the vulnerable compiler in place. On our test server, we did that by turning off sign-up and restricting the Public visibility level, which stops non-admin users from creating Public projects:

sudo gitlab-rails runner 'ApplicationSetting.current.update!(signup_enabled: false, restricted_visibility_levels: [Gitlab::VisibilityLevel::PUBLIC]); puts "done"'

The same two settings live in the Admin area under Settings, General: “Sign-up restrictions” and “Visibility and access controls”. Before the change, our instance had sign-up on and no restricted levels; afterwards the runner read back signup_enabled=false and level 20, which is Public.

gitlab-rails runner turning off sign-up and restricting Public visibility on GitLab 19.4.1 as a CVE-2026-97229 stopgap

Our lab had no public projects, so the last count was 0. If yours isn’t, those projects still accept pushes from their existing members, and you’d want to review who those members are. Accounts that registered during October deserve a look too. Keep this stopgap measured in hours, not weeks, because users who can already push CI configuration can still reach the compiler.

Patching Omnibus GitLab with apt

Take a backup before you touch the package. The package runs a database backup during the upgrade, but it does not copy gitlab.rb or gitlab-secrets.json, and without the secrets file a restore can’t decrypt CI variables or 2FA seeds:

sudo gitlab-backup create
sudo mkdir -p /root/gitlab-config-$(date +%F)
sudo cp /etc/gitlab/gitlab.rb /etc/gitlab/gitlab-secrets.json /root/gitlab-config-$(date +%F)/

Next, see which builds the GitLab repository offers you for your branch. Ubuntu’s own archive has no gitlab-ce package, so this list comes from packages.gitlab.com:

sudo apt-get update
apt-cache madison gitlab-ce | grep ' 19\.4\.'

Pin the exact build rather than running a bare apt upgrade, which would jump straight to 19.6.1 and could cross a required upgrade stop. We went to 19.4.2 first to confirm the first fixed build, then on to the newest 19.4 build the repository had during our run. Each hop took about six and a half minutes on a 4 vCPU, 16 GB server:

sudo apt-get install -y gitlab-ce=19.4.2-ce.0
sudo apt-get install -y gitlab-ce=19.4.10-ce.0

On EE, the package name is gitlab-ee with the -ee.0 suffix. GitLab published 19.4.10 a few hours after our run, so our server stopped at 19.4.8; the steps don’t change. Both hops ended with “Upgrade complete!” and a restart of every service, with no prompts. Afterwards, confirm the version and that no background migrations are still queued:

cat /opt/gitlab/embedded/service/gitlab-rails/VERSION; echo
sudo gitlab-ctl status
sudo gitlab-rake gitlab:check SANITIZE=true
sudo gitlab-rails runner 'puts Gitlab::Database::BackgroundMigration::BatchedMigration.queued.count'

Our server came back on 19.4.8 with all fifteen services running, the checks finished and zero batched migrations queued. The embedded Ruby still reported 3.3.12, as covered above.

GitLab CE 19.4.8 on Ubuntu 26.04 after the apt upgrade, all services running and no queued batched migrations

If you run a single node, your instance is down while the package runs its migrations, so schedule the window and tell your users. Multi-node deployments can follow GitLab’s zero-downtime procedure instead. The steps for setting up the apt repository in the first place are in our GitLab CE install guide for Ubuntu 26.04.

Patching Omnibus GitLab with dnf

On Rocky Linux, AlmaLinux and RHEL, the flow is the same with dnf. Run the backup and copy the two config files exactly as in the apt section, then list the builds for your branch:

sudo dnf --showduplicates list gitlab-ce | grep ' 19\.3\.'

Our Rocky Linux 10.2 server ran 19.3.4, the build some press coverage wrongly called fixed. We moved it to 19.3.5 and then to 19.3.9, the last 19.3 build, naming the full package version so dnf doesn’t pick 19.6:

sudo dnf install -y gitlab-ce-19.3.5-ce.0.el10
sudo dnf install -y gitlab-ce-19.3.9-ce.0.el10

The first hop took just over six minutes and ended with dnf’s “Upgraded” line for 19.3.5. GitLab’s advisory also notes that 19.3.4 broke merge request pages when the Ona integration was turned on, which 19.3.5 fixes.

dnf upgrading gitlab-ce from 19.3.4 to 19.3.5 on Rocky Linux 10.2 with SELinux enforcing

With SELinux enforcing, check for denials as well as the version once your second hop finishes, since a policy problem shows up as a service that will not start:

rpm -q gitlab-ce
sudo gitlab-ctl status
getenforce
sudo ausearch -m avc -ts recent

Our server reported 19.3.9, the services shown running (the dnf log listed all fifteen as ok: run) and <no matches> for AVC denials. We piped gitlab-ctl status through head on that run, and omnibus-ctl printed a Ruby traceback when the pipe closed early; that’s an artifact of the pipe, not of the upgrade, so we trimmed it from the screenshot.

gitlab-ce 19.3.9 on Rocky Linux 10 with SELinux enforcing and no AVC denials after the upgrade

From 19.3.9, plan the move to 19.4.10 in the same week. That step crosses into a new minor release, so read GitLab’s upgrade path documentation first; 19.5 is the next required stop after 19.2. Our walkthrough of a multi-stop GitLab upgrade shows how to pace those hops and wait out background migrations between them.

Patching the GitLab Docker image

A Docker install keeps its state in the three volumes, so patching means replacing the container with one built from a newer tag. Back up from inside the running container first, then copy the config directory on the host:

sudo docker exec -t gitlab gitlab-backup create
sudo cp -a /srv/gitlab/config /root/gitlab-config-$(date +%F)

Pull the fixed tag, stop and remove the old container, and start a new one with the same volumes and options. The example shows our first hop to 19.2.8; swap in the tag from the table’s last column for your branch, and never latest, which would skip the upgrade stops:

sudo docker pull gitlab/gitlab-ce:19.2.8-ce.0
sudo docker stop gitlab
sudo docker rm gitlab
sudo docker run -d --name gitlab --hostname git01.example.com -p 80:80 --shm-size 256m -v /srv/gitlab/config:/etc/gitlab -v /srv/gitlab/logs:/var/log/gitlab -v /srv/gitlab/data:/var/opt/gitlab gitlab/gitlab-ce:19.2.8-ce.0

Match the docker run line to your original one, ports and environment variables included. If you use Compose, change the image tag in compose.yaml and run docker compose up -d. Then poll until the health check passes and confirm the version inside the container:

until sudo docker ps --filter name=gitlab --format '{{.Status}}' | grep -q '(healthy)'; do sleep 10; done
sudo docker exec gitlab cat /opt/gitlab/embedded/service/gitlab-rails/VERSION

We scripted those steps and ran them twice on an Ubuntu 24.04 host with docker.io 29.1.3: from 19.2.7 to 19.2.8, then to 19.2.10. Each pull took under a minute and the container reported healthy about 60 seconds after it started. The sign-in page answered 200 after the second hop. That 19.2.10 container is clear of this CVE but still carries the Git RCE, so treat it as a stop on the way to 19.4.10, not the destination.

GitLab Docker container moved from gitlab-ce 19.2.7 to 19.2.8 and then 19.2.10, healthy after each hop

The healthy status arrives before the data migrations finish, so give your container a few more minutes before you send traffic to it. Helm users bump the chart to the version that maps to the GitLab release in the table; we didn’t run the chart in this lab, so follow GitLab’s chart version mapping for that step. The 20 November notes also list restored Ruby regexp patches for the cloud-native images alongside the Ruby 3.3.14 bump.

Staying ahead of the next regex fix

This CVE is one of four regex compiler RCEs GitLab patched between late September and late October, and each fix landed on a different set of builds. A team that patched once on 12 October and stopped is still exposed to three critical bugs (CVE-2026-110264, CVE-2026-105437 and CVE-2026-132825), which is why the table above has a column for today’s build. A few habits keep you and a small team out of that position:

  • Subscribe to GitLab’s patch release feed, or the alert above
  • Keep sign-up off unless an admin approves each account
  • Copy gitlab-secrets.json off the host after every upgrade
  • Watch puma_stderr.log for [BUG] lines between patches

The Puma log is the one to watch. A worker that crashes inside Onigmo writes its dump there, and it’s the earliest sign that someone is probing the next variant before the advisory exists. If you also need the XSS fixes from mid-November, our guide to CVE-2026-105739 and CVE-2026-108153 covers them, and 19.4.10 already includes them.

Keep reading

Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs Security Java4Shell (CVE-2026-114938): Find and Patch Vulnerable JVMs UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 Security UFW Firewall Commands with Examples on Ubuntu 26.04 / 24.04 nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch Security nginx HTTP/2 RCE CVE-2026-123007: Check, Disable HTTP/2, Patch GL.iNet Security Notice: Check Your Router for Malware and Update Networking GL.iNet Security Notice: Check Your Router for Malware and Update Flatpak 1.18.6 Sandbox Escape CVEs: Check Version and Patch Security Flatpak 1.18.6 Sandbox Escape CVEs: Check Version and Patch How To Integrate SonarQube with Jenkins Automation How To Integrate SonarQube with Jenkins

Leave a Comment

Press ESC to close