Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-97229-GitLab-CI-CD — Advisory and technical analysis of CVE-2026-97229, a GitLab CI/CD regex integer overflow enabling unauthenticated RCE, with root-cause, patch diff, detection rules, and IoCs. | Kitploit
Tools/GitHubGitHub/certbn/cve-2026-97229-gitlab-ci-cd
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationDevSecOpsThreat IntelligencePapers & ResearchLearning & EducationIncident Response
GitHubcertbn/cve-2026-97229-gitlab-ci-cd

CVE-2026-97229-GitLab-CI-CD

Advisory and technical analysis of CVE-2026-97229, a GitLab CI/CD regex integer overflow enabling unauthenticated RCE, with root-cause, patch diff, detection rules, and IoCs.

View Repository
15 days agoNot yet reviewed
Share

CVE-2026-97229: Unauthenticated Remote Code Execution (RCE) via Integer Overflow in the GitLab CI/CD Regular Expression Compiler

CVSS Type KEV Auth

📌 TL;DR

  • An integer overflow (CWE-190) occurring in the CI/CD regular expression processing of GitLab CE/EE allows arbitrary code execution (RCE) on the GitLab server via a crafted regular expression. CVSS v3.1 10.0 (maximum).
  • The root cause lies not in GitLab itself but in Onigmo, Ruby's built-in regular expression engine, and is reached through the path where GitLab compiles user-supplied regular expressions with Regexp.new.
  • Self-managed instances are affected. GitLab.com and Dedicated are already patched. It was added to the CISA KEV on 2026-10-29, confirming real-world exploitation — immediate patching is required.

📋 Basic Information

ItemDetails
CVE IDCVE-2026-97229
Publication date2026-10-12 (GitLab advisory published) / CVE record published 2026-10-13
Affected productsGitLab Community Edition (CE) and Enterprise Edition (EE), self-managed
Affected versions19.2 (< 19.2.8), 19.3 (< 19.3.5), 19.4 (< 19.4.2)
Patched versions19.2.8, 19.3.5, 19.4.2 or later (see "Caution" below)
CVSS v3.110.0 (Critical) — CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H
CVSS v4.0No v4.0 vector provided in the official vendor (GitLab) advisory or CVE record (no confirmed value)
CWECWE-190 (Integer Overflow or Wraparound)
Reporterjoaxcar (Johan Carlsson), GitLab HackerOne bug bounty
Real-world exploitationAdded to CISA KEV (2026-10-29, federal agency remediation deadline 2026-11-01). Public PoC exists (Rapid7, 2026-10-13). Exploitation attempts targeting Alpine Linux instances observed (2026-10-20~21)

⚠️ Important caution regarding patched versions (fact-checked)

  • 19.3.4 is not a valid patch. The initial advisory listed the 19.3 branch fix as 19.3.4, but 19.3.4 had a bug affecting the merge request page when Ona integration is enabled, so it was superseded by 19.3.5. Some secondary sources still incorrectly list 19.3.4 as the patched version. Per the latest vendor advisory, the 19.3 branch fix is 19.3.5.
  • Source builds or container images using their own Ruby remain vulnerable even after upgrading GitLab alone. This is because the fix patches the bundled Ruby in GitLab's official Omnibus packages/CNG images. Such environments must upgrade Ruby to 3.3.13 / 3.4.12 / 4.0.9 or later (released 2026-10-22~23). This was indeed an issue in the Alpine Linux case.

🔍 Root Cause Analysis

1) Vulnerable code location and behavior

GitLab matches user-supplied regular expressions against the repository path in places such as rules:exists:regexp and rules:changes:regexp in CI/CD configuration. These regular expressions are ultimately compiled by Ruby's Regexp.new, and the internal engine Onigmo (Ruby's bundled regular expression engine, written in C) converts them into bytecode (pcode).

The fundamental flaw lies in the quantifier expansion size calculation of the Onigmo compiler. Because it uses a signed 32-bit integer to accumulate the compiled program size and stores jump offsets in the signed 32-bit RelAddrType, once the compilation result exceeds INT_MAX, both the length calculation and the jump offsets wrap around.

The key is the size check in compile_quantifier_node() of Ruby 3.3.12 regcomp.c (based on Rapid7 analysis and Ruby commits):

/* regcomp.c: compile_quantifier_node() — 취약 로직 */
else if (!infinite && qn->greedy &&
         (qn->upper == 1 || (tlen + SIZE_OP_PUSH) * qn->upper
                                <= QUANTIFIER_EXPAND_LIMIT_SIZE)) { // 부호 있는 곱셈 → 오버플로
    ...
    r = compile_tree_n_times(qn->target, qn->lower, reg); // 모든 복사본을 인라인 확장
}

If the product of the repeat body size (tlen) and the repeat count (qn->upper) exceeds INT_MAX, the result wraps to a negative number and passes the check that says "it's small enough, so inline expansion is fine." As a result, Onigmo generates a huge pcode, and the jump offsets computed from the wrapped length then send execution flow to the wrong location.

2) Why this is a problem — GitLab's defenses and the bypass

GitLab has several defenses in place for regular expressions, but they are bypassed as follows (based on the end-to-end path disclosed by Rapid7):

  • Source length check: only looks at the source length before expansion.
  • Repeat upper-bound scanner (REPEAT_BOUND, upper bound 1,000): recognizes only consecutive digits. The PoC inserts an inline regex comment (?#) in the middle, like {5(?#)7805}, to fool the scanner. Onigmo ignores (?#) and reads the upper bound as 57,805, but the scanner never sees anything above 1,000.
  • Compiled size check (roughly 1MB upper bound): only checks at the time of the initial US-ASCII compilation. However, if the match target path contains a 4-byte UTF-8 character, Ruby recompiles with UTF-8 encoding in rb_reg_prepare_re(). At this point, POSIX character classes like [[:word:]] expand into large Unicode range tables, and GitLab does not check the size of this recompilation result. Also, this recompilation happens outside the match timeout (Regexp.timeout), so it is not blocked by the timeout either.

In other words, a small (around 986-byte) regular expression passes the checks, and only then, at match time during the UTF-8 recompilation, does it become a large program that triggers the overflow.

Note (inference): The path analyzed and disclosed by Rapid7 assumes "first pushing a crafted .gitlab-ci.yml and a special path to a public project (requires write permission)." This conflicts with GitLab's PR:N (no privileges required) assessment, but because the original HackerOne report is private, it has not been publicly confirmed how the reported attack avoids the write step (Rapid7 also states it does not know). Therefore, the exact path in the original report that underpins the "fully unauthenticated" assessment is currently in the realm of inference.

3) Patch diff comparison (Before / After)

Based on Ruby PR #19020 (commit cf35145fc4, backport 2d1859ffa6) plus follow-up commit 366f5fdc00. GitLab backported this Ruby patch into its bundled Ruby (omnibus-gitlab MR !9845).

(a) Replacing signed multiplication with a division-based check (making overflow impossible)

/* Before: (tlen + SIZE_OP_PUSH) * qn->upper <= QUANTIFIER_EXPAND_LIMIT_SIZE  → 곱셈이 오버플로 */

/* After: regcomp.c */
#define IS_EXPAND_LIMIT_OK(tlen, n) \
  ((n) <= 0 || (tlen) <= QUANTIFIER_EXPAND_LIMIT_SIZE / (n))

(b) Introducing a hard cap on compiled program size

/* After: regint.h */
#define MAX_COMPILED_PROGRAM_SIZE  ((unsigned int)(INT_MAX_LIMIT / 4))

/* After: regcomp.c — 모든 명령어가 통과하는 add_opcode()에서 차단 */
static int
add_opcode(regex_t* reg, int opcode)
{
  if (reg->used > MAX_COMPILED_PROGRAM_SIZE)
    return ONIGERR_TOO_BIG_COMPILED_PROGRAM;
  BBUF_ADD1(reg, opcode);
  return 0;
}

(c) Error-clobbering correction — commit 366f5fdc00

Fixed an issue where, immediately after add_opcode(reg, OP_END) returned a size-exceeded error, in patterns containing a subroutine call (\g<n>), r was overwritten by the return value (0) of unset_addr_list_fix(), causing the error to be swallowed.

/* regcomp.c: onig_compile() */
  r = add_opcode(reg, OP_END);
+ if (r != 0) goto err_unset;   // 추가: 크기 초과 오류를 삼키지 않도록 즉시 분기
Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    930
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    554
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    354
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    349
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    326
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    289

Explore all tools

Browse our collection of tools

View all tools →