On October 12, 2026, GitLab patched CVE-2026-97229 a CVSS 10.0 vulnerability affecting Community (CE) and Enterprise (EE) editions via critical patch releases 19.4.2, 19.3.5, and 19.2.8. The flaw stems from an integer overflow triggered when GitLab compiles CI/CD configuration regular expressions using Ruby’s embedded Onigmo regex engine. Under specific conditions, this allows arbitrary command execution on the GitLab server with git user privileges.
Three key developments escalated this beyond a routine CVE. Security researchers published an end-to-end PoC targeted at both patched and unpatched GitLab images. An attacker targeted an open-source Linux distribution’s self-hosted GitLab instance on October 20–21, resulting in a near-miss exploitation attempt; and CISA added the flaw to its Known Exploited Vulnerabilities (KEV) catalog on October 29. Crucially, the incident revealed that the patch resides within GitLab’s bundled Ruby packages rather than the core application codebase. Consequently, simply upgrading the GitLab version fails to remediate the vulnerability across all deployment configurations.
Branch | Affected Versions | Fixed Version | Latest Version (as of Oct 21) |
19.2 | Prior to 19.2.8 | 19.2.8 | 19.2.9 |
19.3 | Prior to 19.3.5 (including 19.3.4) | 19.3.5 | 19.3.6 |
19.4 | Prior to 19.4.2 | 19.4.2 | 19.4.3 |
19.5, 19.1, 19.0, 18.11 | Not listed as affected for this CVE | — | 19.5.1, 19.1.9, 19.0.10, 18.11.13 |
Note: GitLab’s October 12 advisory initially listed 19.3.4 as the fix for the 19.3 branch. However, 19.3.4 contained a regression that broke merge request pages when Ona integration was active. The release notes were subsequently updated to designate 19.3.5 as the remediated version. Deployments remaining on 19.3.4 must upgrade to 19.3.6.
GitLab consolidates repository management, CI/CD pipelines, container registries, and deployment automation into a single platform. Consequently, compromising the GitLab application server carries a significantly broader blast radius than compromising an isolated runner: private repositories, CI/CD variables, runner registration tokens, personal access tokens, webhooks, and integration credentials all reside within the server’s execution context.
The defining characteristic of this vulnerability is that the attack surface appears to be nothing more than a simple regular expression. Features such as rules:exists:regexp and rules:changes:regexp evaluate user-defined patterns against repository file paths. GitLab passes these expressions directly to the native Onigmo engine via Ruby’s Regexp.new call, effectively compiling user-supplied data within memory-unsafe C code.
Date (2026) | Event |
Oct 12 | GitLab releases critical patch versions 19.4.2, 19.3.5, and 19.2.8, addressing 24 vulnerabilities in total. CVE-2026-97229 receives a CVSS 10.0 rating. Reported by researcher joaxcar via HackerOne. |
Oct 13 | Technical details and a functional PoC are publicly disclosed. An open-source Linux distribution project mistakenly upgrades its instance to version 19.3.4 instead of 19.3.5. |
Oct 16 | In-depth technical root-cause analysis is published. |
Oct 20 | A newly registered account initiates reconnaissance against the targeted open-source project’s GitLab server. |
Oct 21 | Primary attack window: worker process crashes, 502 errors, and failed CI jobs are logged. GitLab issues security patches for 19.5.1 and other branches (addressing CVE-2026-110264). |
Oct 22 | Target instance upgrades to 19.3.6, but the vulnerability remains open due to the use of a standard Ruby runtime base image. Ruby 4.0.8 is released. |
Oct 23 | Ruby releases 4.0.9, 3.4.12, and 3.3.13 containing Onigmo security fixes. The attacker’s account is suspended. |
Oct 24 | Project repositories, packages, and October 21 builds are audited against external registries. |
Oct 25–26 | Attacker returns; re-entry attempts fail, leading administrators to realize the host environment remains vulnerable. |
Oct 27 | GitLab server access is restricted exclusively to core maintainers and build hosts; teardown and rebuild begin. An updated container image bundling the patched Ruby engine is deployed. |
Oct 28 | Post-mortem incident report is published; clean rebuild finishes, all user credentials are reset, and GitLab secrets are rotated. |
Oct 29 | CVE-2026-97229 is added to the CISA KEV catalog. Server resumes public operations running version 19.3.7. |
This section is based on the exploitation chain verified by a security research team on a GitLab CE 19.4.1 (Linux amd64) image. Focusing strictly on defense, payload offsets and specific reproduction vectors have been omitted.
1. Entry Point: CI Rules and Onigmo
GitLab supports regular expression matching against repository file paths via the rules:exists:regexp and rules:changes:regexp fields. One pathway demonstrated by researchers involves using exists: regexp: within a conditional include block. GitLab’s RegexpMatcher component expands the input expression, compiles it using Ruby’s native regex engine, and runs it against every file path in the chosen commit’s working tree. Consequently, each path serves as attacker-controlled data fed directly into native Onigmo.
2. Bypassing Guardrails: Split Quantifiers
GitLab enforces several defensive constraints around CI regular expressions: source length validation, a ban on subroutine calls (\g), a scanner filtering out large quantifier bounds, and controls limiting compiled program size to 1 MB (alongside a 50 ms execution timeout).
The quantifier scanner only inspects contiguous numeric digits. An attacker bypasses this check by splitting the bound using an inline regex comment ({5(?#)7805}). Onigmo strips the (?#) comment and interprets the bound as 57,805, whereas GitLab’s scanner sees no contiguous number exceeding 1,000. The two components interpret the exact same string differently, a classic example of a parser differential vulnerability.
3. Post-Validation Re-compilation
The original regex source code is roughly 986 bytes long and remains well under the 1 MB ceiling when initially compiled as US-ASCII. However, when matching against a file path containing valid 4-byte UTF-8 characters, Ruby detects an encoding mismatch and re-compiles the pattern for UTF-8 on the fly. This re-compilation occurs natively inside Onigmo, bypassing GitLab’s size checks and Ruby’s timeout mechanisms. Six [[:word:]] POSIX character classes within the expression expand into massive Unicode range tables under UTF-8, bringing each repeated copy to approximately 37,151 bytes. GitLab never validates the size of this newly compiled program.
4. The Core Flaw: INT_MAX Overflow
Onigmo’s compile_quantifier_node() function evaluates whether unrolling a repeated quantifier body is safe via multiplication (checking body size × repeat count against a maximum threshold):
37,15157,805=2,147,513,555=0x800074D3
This calculated value exceeds the 32-bit signed integer boundary (INT_MAX / 0x7FFFFFFF) by 29,908 bytes. The resulting integer wraparound produces a negative integer, causing the “sufficiently small to expand” validation check to pass. Onigmo proceeds to allocate all 57,805 iterations, writing over 2 GiB of compiled instructions directly into memory.
A secondary integer overflow occurs during alternation (|) compilation, where the jump instruction offset target is calculated using the already-wrapped program length. This produces a negative displacement value in the jump instruction, diverting control flow outside the expected bytecode execution boundaries into an attacker-controlled memory region.
5. Control Flow Hijacking
The attacker places additional character classes at the end of the repeated target. A class like [abc] compiles into an Onigmo bitmap, which can be crafted to emit specific byte sequences. This embeds attacker-controlled Onigmo VM instructions into each unrolled iteration. The broken jump instruction then diverts execution into this controlled bitmap.
The execution chain subsequently proceeds through the following steps:
6. Triggering via Unauthenticated CI Lint
Once setup is complete, the execution vector is triggered using the GET variant of the CI lint API: /api/v4/projects/<project>/ci/lint?content_ref=<ref>. The endpoint verifies read permissions for the public repository (which requires no credentials for open projects), reads the .gitlab-ci.yml file from the attacker’s specified commit, and runs it through the static validator. No pipeline is spawned, and no runners are engaged. Because the endpoint does not reject requests lacking an API token, execution is entirely unauthenticated.
A successful exploitation attempt typically leaves a distinct footprint: the payload executes synchronously within the worker process, after which the corrupted worker process crashes. Workhorse detects the closed backend connection and returns an HTTP 502 Bad Gateway response to the client. Puma then restarts the worker. Consequently, an HTTP 502 status code represents an expected side effect of successful execution rather than a failed attempt.
Real-World Incident: Attack on a Linux Distribution Project
On October 13, the target project mistakenly upgraded its instance to version 19.3.4 a release that lacked the remediated runtime patch. On October 20, a newly registered account began submitting crafted CI configurations. Over October 20–21, GitLab worker processes crashed eight times. The attacker also pulled the project’s custom GitLab container image.
Although the incident response team found no direct forensic evidence confirming full compromise, they acknowledged that successful exploitation could leave no trace. Treating the instance as fully compromised, the team executed a complete rebuild from scratch.
Ruby Side: Onigmo Fixes
On October 23, Ruby issued security releases for Ruby 4.0.9, 3.4.12, and 3.3.13, resolving the underlying Onigmo defects that GitLab had assessed as Remote Code Execution (RCE) vectors.
GitLab CVE | Flaw in Ruby | Fix / Pull Request | 4.0 Branch | 3.4 Branch | 3.3 Branch |
CVE-2026-89078 | Double free error when pattern parsing fails following an alternation | 4.0.0 | 3.4.12 | 3.3.13 | |
CVE-2026-93577, CVE-2026-97229 | Integer overflow in compiled pattern size calculation | 4.0.8 | 3.4.12 | 3.3.13 | |
CVE-2026-110264 | Internal ID overflow in patterns containing extensive quantifier repetitions | 4.0.9 | 3.4.12 | 3.3.13 |
Detection
GitLab published six threat detection rules in Sigma format for self-hosted instances (available in the gitlab-security-oss/tldr repository):
Detection | Focus |
Onigmo native worker crash | Native crashes of Ruby/Onigmo worker processes |
GraphQL ciLint hostile regexp | Hostile regex patterns within GraphQL ciLint calls |
CI regexp oversized non-ASCII path | Abnormally long non-ASCII repository paths processed during regex evaluation |
CI regexp guard rejection | Expressions rejected by GitLab’s internal regex guardrails |
CI lint Workhorse worker crash | Backend worker crashes (HTTP 502) captured by Workhorse during CI lint requests |
CI lint scripted client error burst | Spikes in server errors originating from automated or scripted clients |
Indicators of Compromise (IoCs) and Behavioral Artifacts
No attacker-specific IP addresses, domain names, or file hashes were published in official sources. Consequently, the following table lists behavioral and environmental indicators.
1. Log and Network Indicators
Indicator | Type | Description |
GET /api/v4/projects/<project>/ci/lint?content_ref=<ref> | HTTP Request | Statistically evaluates the CI configuration at the attacker’s chosen commit; takes several seconds during exploitation. |
badgateway: failed to receive response: EOF / HTTP 502 | Workhorse Log | Log entry indicating that a worker process crashed. |
Puma worker crash with backtrace containing regexp_matcher.rb | Puma Log | Native crash during CI regex processing. |
Ruby [BUG] report referencing match_at or onig_compile | Puma Stderr | Native Onigmo engine crash report. |
2. Content and Process Artifacts
Artifact | Type | Description |
Quantifier bounds split using inline comments (e.g., {5(?#)7805}) | Regex Pattern | Technique bypassing GitLab’s quantifier scanner. |
Repeated [[:word:]] classes and crafted character class bitmaps | Regex Pattern | Constructs expanding size under UTF-8 and emitting controlled bytecode. |
Abnormally long file path containing 4-byte UTF-8 characters | Repository Content | Secondary component required to trigger pattern re-compilation. |
Shell subprocess spawned under Puma/Sidekiq; ~2 GiB worker memory surge | Process | Indirect signature of successful execution. |
Newly registered account pushing crafted CI configs and pulling container images | Account Behavior | Reconnaissance and preparation pattern observed in real-world incidents. |
Unpatched GitLab prior to 19.2.8 / 19.3.5 / 19.4.2; Ruby prior to 3.3.13 / 3.4.12 / 4.0.9 | Version | Vulnerable software and runtime components. |
Custom GitLab container images lacking the remediated Ruby runtime | Container Image | Base images running unpatched Ruby versions. |
1. Log and Network Indicators
Indicator | Type | Description |
GET /api/v4/projects/<project>/ci/lint?content_ref=<ref> | HTTP Request | Statistically evaluates the CI configuration at the attacker’s chosen commit; takes several seconds during exploitation. |
badgateway: failed to receive response: EOF / HTTP 502 | Workhorse Log | Log entry indicating that a worker process crashed. |
Puma worker crash with backtrace containing regexp_matcher.rb | Puma Log | Native crash during CI regex processing. |
Ruby [BUG] report referencing match_at or onig_compile | Puma Stderr | Native Onigmo engine crash report. |
2. Content and Process Artifacts
Artifact | Type | Description |
Quantifier bounds split using inline comments (e.g., {5(?#)7805}) | Regex Pattern | Technique bypassing GitLab’s quantifier scanner. |
Repeated [[:word:]] classes and crafted character class bitmaps | Regex Pattern | Constructs expanding size under UTF-8 and emitting controlled bytecode. |
Abnormally long file path containing 4-byte UTF-8 characters | Repository Content | Secondary component required to trigger pattern re-compilation. |
Shell subprocess spawned under Puma/Sidekiq; ~2 GiB worker memory surge | Process | Indirect signature of successful execution. |
Newly registered account pushing crafted CI configs and pulling container images | Account Behavior | Reconnaissance and preparation pattern observed in real-world incidents. |
Unpatched GitLab prior to 19.2.8 / 19.3.5 / 19.4.2; Ruby prior to 3.3.13 / 3.4.12 / 4.0.9 | Version | Vulnerable software and runtime components. |
Custom GitLab container images lacking the remediated Ruby runtime | Container Image | Base images running unpatched Ruby versions. |
The following mapping is based on observations from public sources. Techniques marked as “observed” stem from the real-world incident analysis or researcher verification, while “potential” techniques represent probable downstream effects following successful exploitation.
Reconnaissance
Initial Access
Execution
Impact (Side Effect)
Credential Access
Collection and Supply Chain
Related Vulnerabilities
Vulnerabilities originating from the same Onigmo/regex class patched in rapid succession demonstrate that the attack surface extends beyond a single isolated flaw:
The same release package also resolved 23 additional vulnerabilities, including notable high-severity issues such as CVE-2026-92883 (XSS, CVSS 8.7), CVE-2026-16301 (unauthorized pipeline execution on protected branches, CVSS 8.5), and CVE-2026-14814 (cache poisoning for raw repository files, CVSS 8.2).
CVE-2026-97229 demonstrates how a single regular expression can evolve into remote code execution on a CI/CD platform’s application server due to a parser differential between two components combined with a validation gap during re-compilation. The verified facts are clear: the vulnerability was successfully reproduced by researchers on an unpatched official GitLab image, a real-world exploitation attempt targeted an open-source Linux distribution project, and CISA added the flaw to its Known Exploited Vulnerabilities (KEV) catalog.
What remains unverified is whether the real-world attempt achieved full compromise and how the original report fulfilled the “unauthenticated” claim without pre-existing conditions. Therefore, risk assessment must be calibrated against each host’s exposure profile (e.g., internet-facing status, open user registration, and public project creation settings).
From a defensive standpoint, three key priorities emerge: rapid patch deployment, ensuring underlying runtime components like Ruby are updated alongside the application, and aggressively rotating secrets or executing a clean server rebuild whenever compromise is suspected.