
CVE-2026-110264 — GitLab Unauthenticated RCE (Onigmo regex repeat-ID overflow, CVSS 10.0). Docker-verified crash PoC on ruby 3.4.11 + measured heap analysis. Crash-level, non-weaponized.
Root cause → Impact → Exploit → Local lab → Files → Remediation → Disclosure
Ruby's Onigmo regex engine (vendored by GitLab) stores regex bytecode operands in a
short int:
// regint.h:693
typedef short int MemNumType; // 16-bit signed
The compiler counts repeat operators with an unbounded int but writes each OP_REPEAT
id through add_mem_num() (regcomp.c:704) — a truncating cast. Any regex with more than
32,767 range-repeats wraps subsequent ids negative.
At match time the interpreter dereferences both:
reg->repeat_range[repeat_mem].lower (regexec.c:403, match-cache counter)repeat_stk[mem] = GET_STACK_INDEX(stk) (regexec.c:3845)with the wrapped negative index = a read/write window of [-256 KB, base) below the allocation — in mapped attacker-adjacent memory (see Heap note).
AV:N/AC:L/PR:N/UI:N/S:C); GitLab fixed it 2026-10-21 after a sibling
(CVE-2026-97229, same engine, different path) on 2026-10-12.493d26dc); GitLab backports it inside its omnibus packages.attacker .org file (issue/wiki/snippet, unauth)
└─ org-ruby interpolates raw #+TODO: keyword into Regexp.new (delivery)
└─ pattern with >32767 {n,m} repeats → repeat-ID wrap (this PoC)
├─ OOB read at repeat_range[id<0] (regexec.c:403)
└─ OOB write at repeat_stk[id<0] = stack index (regexec.c:3845)
└─ heap grooming → control-flow hijack → system() as `git` user
(GitLab detection: "Onigmo native worker crash"; RCE arb noted by vendor)
This repository demonstrates steps up to the deterministic memory-corruption crash.
The full system() grooming is engineering work on top; the write primitive and its
delivery path are proven here.
python3 poc.py
Verified output (2026-10-22, docker, ruby 3.4.11 — the line GitLab bundles):
[*] CVE-2026-110264 Onigmo repeat-ID overflow -- PoC driver
[*] running probe in vulnerable runtime (ruby:3.4-slim == 3.4.11)...
COMPILE: accepted (no guard) -- vulnerable path
[+] VERDICT: VULNERABLE -- native SIGSEGV inside Onigmo (repeat-ID wrap, RSI=0xffff8000)
Actual crash signature (evidence/crash-ruby3411.txt):
-e:4: [BUG] Segmentation fault at 0x00007dac53ee1010
RDI: 0xfffffffffffc0000 # = -32768 * sizeof(idx) — wrap arithmetic visible
RSI: 0x00000000ffff8000 # = -32768 — the wrapped repeat ID
RAX: 0xffffffffffff8000
Patched-behavior control: Ruby master raises RegexpError: too many range repeat
at compile (upstream regression test asserts exactly this). Distro Ruby 3.3.8/4.0
remain vulnerable (verified: pattern compiles).
HEAP-ANALYSIS.md)The engine's compiled bytecode mmap sits directly above repeat_range (Linux top-down
mmap ordering). The OOB window therefore lands in attacker-authored pattern bytes —
i.e. the .org file's own content fills the overflow window. "Heap grooming" here reduces
to shaping the regex source text; no allocator Feng-Shui or ASLR defeat is required to
place controlled structures in the window.
poc.py — driver: probes engine, classifies patched/vulnerable (exit 0/1/2)
src/ — (in-lab probe embedded)
evidence/crash-ruby3411.txt — native crash transcript w/ register dump
evidence/patched-4.0-note.txt — control: 4.0 compiles (fix only on master)
lab/docker-compose.yml — alternative compose form of the lab
493d26dc "Reject overflowed repeat/null-check IDs in
huge regexps" (Hiroya Fujinami), backported into Omnibus Ruby 3.3/3.4 by GitLab.MIT.
Dengan glibc dynamic mmap-threshold bump (alloc+free 2MB) + brk prefill dengan data
terkontrol, out-of-bound write repeat_stk[-32768] = stack_index mendarat di metadata malloc:
COMPILED-OK
double free or corruption (!prev) ← glibc MELAPORKAN chunk metadata dirusak
Ini transisi bukti: unmapped-read crash → detected heap-metadata corruption (asertif
glibc sendiri). Primitive yang dimiliki: write small-integer (stack-depth controlled)
ke window [-256KB, base) di bawah blok alokasi engine.
fd
poisoning langsung tidak bisa; butuh pivot: korupsi SIZE FIELD → overlapping chunks →
baru string content (full control) jadi fake fd (safe-linking butuh heap leak dulu).system("id"): riset multi-hari (2-stage heap exploit),
bukan PoC satu file.Jadi status: bug terbukti korupsi memori (terukur, live glibc assertion), jalur RCE nyata
tapi belum ditunjukkan sampai id. Tidak ada overclaim.