GitLab CI Lint Regex Integer Overflow to RCE (CVE-2026-97229)
Published: 2026-11-25 • Researcher: Jonah Burgess (jburgess-r7, Rapid7) — PoC; Rapid7 threat analytics — technical analysis
Exploitation signals
Confirmed exploited in the wild. Added to CISA KEV 2026-10-29. Federal remediation deadline 2026-11-01.
EPSS 74.3% · 100th percentile
- Severity
- Critical
- CVE
- CVE-2026-97229
- Category
- web
- Affected product
- GitLab Community Edition and Enterprise Edition (CI/CD configuration processing, CI lint endpoint)
- Affected versions
- 19.2 before 19.2.8; 19.3 before 19.3.5; 19.4 before 19.4.2 (NVD ranges; fixed in 19.2.8, 19.3.5 and 19.4.2)
- Disclosed
- 2026-11-25
- Patch status
- Patched
Tags
References
- https://nvd.nist.gov/vuln/detail/CVE-2026-97229
- https://github.com/jburgess-r7/CVE-2026-97229-PoC
- https://www.rapid7.com/blog/post/ra-gitlab-ci-cd-regex-integer-overflow-technical-analysis-cve-2026-97229/
- https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-4-2-released/
- https://www.cisa.gov/known-exploited-vulnerabilities-catalog
Archive entry
intelseclab/poc-archiveOn this page
Metadata
| Field | Value |
|---|---|
| Date Added | 2026-11-25 |
| Last Updated | 2026-10-19 |
| Author / Researcher | Jonah Burgess (jburgess-r7, Rapid7) — PoC; Rapid7 threat analytics — technical analysis |
| CVE / Advisory | CVE-2026-97229 |
| Category | web |
| Severity | Critical |
| CVSS Score | 10.0 (as published; base vector not included in the ingested source data — see references) |
| Status | Weaponized |
| Tags | RCE, unauthenticated, GitLab, CI/CD, CI-lint, regex, integer-overflow, Onigmo, Ruby, ASLR-bypass, KEV |
| Related | N/A |
Affected Target
| Field | Value |
|---|---|
| Software / System | GitLab Community Edition and Enterprise Edition (CI/CD configuration processing, CI lint endpoint) |
| Versions Affected | 19.2 before 19.2.8; 19.3 before 19.3.5; 19.4 before 19.4.2 (NVD ranges; fixed in 19.2.8, 19.3.5 and 19.4.2) |
| Language / Platform | Ruby / C (Onigmo regular expression engine, Puma, GitLab Rails); Linux amd64 (Omnibus package referenced by the PoC) |
| Authentication Required | Partial — push access to a public project is required to stage the payload; the delivery request carries no token, cookie or authorization header |
| Network Access Required | Yes |
Summary
GitLab CE/EE before 19.2.8, 19.3.5 and 19.4.2 can execute arbitrary code on the GitLab server when a CI/CD configuration supplies a specially crafted regular expression, because the regular expression validation performed by GitLab is insufficient. The public PoC drives the bug through the CI lint API: an attacker with push access to a public project commits a crafted CI configuration plus a specially named repository path, and a later request to the project CI lint endpoint with no credentials executes a command as the GitLab git service account. The chain abuses an Onigmo repeat-count integer overflow that wraps a generated branch offset into character-class bitmap bytes, redirecting the regular expression VM stack into attacker-controlled path data while reusing interpreter pointers so ASLR is not a barrier. GitLab rates the issue CVSS 10.0, and the author reports successful command execution in 10 of 10 clean-worker trials against the official GitLab CE 19.4.1 amd64 image.
Vulnerability Details
Root Cause
CI configuration files may include rules whose exists.regexp value is a regular expression. GitLab scans such expressions for oversized repeat counts and rejects expressions whose compiled size exceeds one megabyte before it hands the expression to Ruby, where Onigmo compiles it. The repeat scanner and the compiler do not parse the expression identically: a repeat written as 5 with an embedded comment group before the remaining digits is seen as a small count by the scanner but as the full count by Onigmo. A second mismatch appears when the tested path is not US-ASCII, because Ruby recompiles the already-validated US-ASCII expression as UTF-8 after GitLab’s size check has passed. The resulting program is far larger than the check assumed: 37,151 bytecode units multiplied by 57,805 repeats crosses INT_MAX, and a generated branch offset wraps into the character-class bitmap bytes that follow the generated code. Those bitmap bytes become the control data for VM stack movement, so a repository path can supply a fake frame and reach a system call site.
Attack Vector
The attacker first needs push access to a public project — an ordinary project account is sufficient for the setup step. The PoC clones that project, commits a crafted .gitlab-ci.yml with the malicious include rule, a benign included file, and a file whose path encodes the first-stage command, then pushes the commit to a random branch. The second step is an unauthenticated HTTP GET to /api/v4/projects/:id/ci/lint with content_ref set to that branch: users without an account can read the public project and reach the CI lint endpoint, and that request compiles and tests the expression against the attacker-controlled repository paths. No token, cookie or authorization header is used for delivery.
Impact
Remote code execution as the GitLab git service account (uid 998 in the reference lab), which owns the repositories and can read GitLab configuration reachable by that account. The PoC returns arbitrary command output through an attacker callback listener, and the README reports command execution in 10 of 10 clean-worker trials with ASLR enabled (about 12 seconds per request). The Puma worker executing the payload normally crashes after the command returns and is replaced automatically, so the HTTP response is a 502 even on success. A compromised GitLab server exposes source code, CI variables, tokens and any credentials available to the GitLab application.
Environment / Lab Setup
OS: Linux amd64 (Docker / GitLab Omnibus)
Target: gitlab/gitlab-ce:19.4.1-ce.0
sha256:9b33b45b9f42d176bada85ee5ecb81ddab7e506c435f44cd582206e284b2809c
Attacker: Python 3.9+ (standard library only), git client, hostable callback listener
Resources: Generated pcode is slightly larger than 2 GiB; the single-node test
instance needed about 9 GiB available memory
Tools: python3, git, curlSetup Steps
| |
Proof of Concept
Step-by-Step Reproduction
- Prepare the attacker project — create or reuse a public project and an access token that can push branches to it; note the project ID (numeric or namespace/project).
- Start a callback listener — the PoC binds 0.0.0.0:8000 by default. Supply a callback address reachable from the GitLab host and short enough for the 28-byte first stage; use –listen-host / –listen-port if the bind address differs from the advertised one.
- Stage the payload — the script clones the project, generates .gitlab-ci.yml (with the malicious include rule), a benign.yml, and a file whose path encodes the command, commits and pushes to a random branch used as content_ref.
- Deliver unauthenticated — the script sends GET /api/v4/projects/
/ci/lint?content_ref= with no credentials. The CI lint call compiles the expression, tests it against the crafted path, and executes the first stage, which downloads and runs the second stage. - Collect output — the second-stage script runs –cmd and POSTs stdout and stderr to the listener path /output/
; a 502 response on delivery is expected because the Puma worker crashes after system returns.
Exploit Code
See
poc.pyin this folder for the full exploit; upstream documentation is preserved asupstream-README.md.
| |
Expected Output
| |
Detection & Indicators of Compromise
- Unauthenticated GET requests to /api/v4/projects/
/ci/lint with a content_ref naming a short, non-default branch, ending in a 502 from the GitLab front end. - Puma / gitlab-rails logs showing a worker termination or restart immediately after a CI lint request, often accompanied by rapid memory growth of several GiB.
- CI configuration (or pushed repository content) containing include rules with exists.regexp, large numeric repeat counts, or nested comment groups in the expression.
- Repository paths containing supplementary-plane Unicode characters or control bytes, or unusually long paths created solely to carry data.
- Outbound HTTP from the GitLab host to an unfamiliar short hostname that returns a shell script, immediately followed by an outbound POST containing command output.
- A single GitLab process allocating more than 2 GiB of regular expression bytecode during CI lint compile.
| |
SIEM / IDS rule (example, coarse):
| |
Remediation
| Action | Detail |
|---|---|
| Patch | Upgrade to GitLab 19.2.8, 19.3.5, 19.4.2 or a later supported release (see GitLab’s critical patch release notes for deployment guidance). |
| Workaround | Reduce exposure until patched: restrict anonymous access to public projects and to the CI lint API, limit who may push to public projects, and restrict outbound network access from the GitLab host to approved destinations only. |
| Config Hardening | Put a WAF or reverse proxy in front of GitLab that caps request URI length and rejects anomalous CI lint patterns, monitor GitLab process memory for multi-GiB regex compile spikes, and rotate CI variables, tokens and any credentials reachable by the git account after suspected exploitation. |
References
Notes
Auto-ingested from https://github.com/jburgess-r7/CVE-2026-97229-PoC on 2026-11-25. Review verdict: this is a genuine exploit PoC, not a detector or scanner. poc.py implements the full chain — staged CI configuration and crafted repository path, unauthenticated CI lint delivery, Onigmo integer overflow with bitmap-driven VM stack control, and a 28-byte first-stage stager that retrieves the second stage and posts command output back to the attacker listener. It was archived as Weaponized on that basis.
License: the upstream repository contains no LICENSE file; the README and the exploit file are archived with attribution for authorized research only. Only the repository README (as upstream-README.md) and poc.py were copied; .gitignore was not archived as it carries no exploit content.
Limitations and operational notes: the author states the native layout was tested only against the official Linux amd64 gitlab/gitlab-ce:19.4.1-ce.0 image at the digest recorded above, and other affected builds need adjusted pcode and libruby offsets. The setup step requires push access to a public project that anonymous users can read, so it is not a fully unauthenticated single request. The generated pcode is slightly larger than 2 GiB and a complete single-node test instance needed about 9 GiB of memory, so low-memory targets may swap, fail allocation or be OOM-killed instead of executing code, and several concurrent requests can affect the whole instance. Successful execution crashes the Puma worker (expected 502) and requires target egress to the callback listener. The README describes the release as an initial PoC with ongoing analysis, and reports 10 of 10 successes on a clean worker with ASLR enabled, about 12 seconds per request; the same expression and path returned false on the fixed 19.4.2 compiler. CISA KEV lists exploitation from 2026-10-29; the ingested EPSS value is 0.1184. This entry is distinct from the separate GitLab Onigmo entry for CVE-2026-110264 (pocs/web/2026-11-25_regex2shell-gitlab-onigmo-rce/), which covers a different vulnerability.
Run only against systems you own or have written authorization to test.
| |