
Research repo for CVE-2026-110264 (GitLab/Onigmo regex RCE): safe differential detector, deterministic crash PoC, and characterized match-time OOB write primitive with a Docker lab.
Security research on regex2shell — the GitLab/Onigmo regex-engine RCE
family disclosed 2026-10-21/23. Primary: CVE-2026-110264 (CVSS 10.0,
unauthenticated, every GitLab CE/EE since 7.0; found by joaxcar via GitLab's
HackerOne program). Root cause: Onigmo's regex bytecode operands are 16-bit
(MemNumType) — more than 32,767 bounded repeats wraps repeat/null-check IDs
negative, driving an OOB read in the match-cache count walk and an OOB
write at match time. Fixed in GitLab 19.5.1+ and Ruby 4.0.9 / 3.4.12 /
3.3.13. Family context: CVE-2026-89078 (double free), CVE-2026-93577 /
CVE-2026-97229 (compiled-size overflow — that sibling is in CISA KEV
since 2026-10-29 after an in-the-wild attack on Alpine Linux's GitLab,
via the same #19020 arm; CVE-2026-110264 itself is not in KEV as of
2026-10-31 — see the finding-sheet's "Threat status").
Results (this repo, all against the pinned lab): a safe differential
detector (zero crashes on both builds), a deterministic interpreter
kill (3/3 native [BUG] SIGSEGV; the fixed build survives the identical
attack), and a characterized match-time write primitive — value and
offset both pattern-controlled, proven with an in-band marker echo — which
goes beyond the public crash-PoCs. The full RCE chain (system() as the
server user) remains open research: no public technique exists to port
(the reporter's HackerOne writeup is private; public PoCs and labs are
crash/detector/blind-read-oracle artifacts — re-verified 2026-10-24 and
2026-10-31. Caveat 2026-10-31: a public "RCE toolkit" claim for this CVE
(murat-levi, 2026-10-29) is unverified — no evidence artifacts, and its
payload constants match the sibling #19020 compile-time arm, not this
CVE's match-time write; the weaponized family chain that does exist
publicly — Rapid7's 97229 PoC, attacked in the wild at Alpine Linux —
also rides #19020).
See research-writeup §7.
| Claim | Evidence |
|---|---|
| Root cause derived from vendor announcements + upstream fix diffs, not blogs | finding-sheet (ruby/ruby #16801 / #19020 / #13332; CVE↔bug↔fix table from ruby-lang.org) |
Differential pair boots: ruby:3.4.11 (vuln) vs Ruby 3.4.12 compiled from the official tarball (fixed; hub tag unpublished at build time), org-ruby 0.9.12 pinned, per-request-process render harness | lab/ + lab/README.md — a native [BUG] kills one disposable child; REQUEST_TIMEOUT models the render-timeout detection |
| The 16-bit boundary, pinned empirically | binary sweep: fixed accepts 32,767, rejects 32,768 (both ID families: too many range repeat / too many null check); vuln compiles any N |
| The GitLab org-mode sink reproduced in the lab | #+TODO: keyword → headline.rb Regexp.new("^#{keyword}\s*") — raw interpolation confirmed by the fixed build's error message showing the assembled pattern |
| Safe detector: VULNERABLE on 3.4.11 / NOT-DETECTED on 3.4.12, zero crashes | poc/diagnose.py — org-sink compile oracle + engine compile-only corroboration + benign control; 3/3+3/3 each way, exit 0/1 |
Deterministic kill: [BUG] SIGSEGV at re.match (N=100000, ID-aliasing zone ≥65536), harness alive | poc/crash.py — 3/3 kills; fixed build survives identical attack 3/3 (clean RegexpError) |
| The #19020 sibling arm: compile-time unroll hang | (?:.{90000,}){90000} → 15s TIMEOUT on vuln vs 89ms clean compile on fixed |
| Match-time write primitive, characterized — and echoed deterministically through the harness | exploit/echo.py + gdb autopsy: 8-byte write at repeat_stk[id] (regexec.c:3846), value = repeat index + δ, offset = wrapped id × 8; impossible-nested pair disables the count walk → pure write. Stage-3 construction (odd/tasks L14): MALLOC_MMAP_THRESHOLD_=4 MiB + post-compile marker band (8000×'M'4096, exhausts compile-freed brk holes) + exact-fit anchor ('A'×((units+4)×8+65520), freed by two full GCs) → repeat_stk reuses the anchor hole and the wrapped write lands in the band: band echo 4/4 standalone, 2/3 via HTTP (observed 0x800c/0x800e = stack depth); fixed build rejects the identical request at compile |
# differential pair: Ruby 3.4.11 (:29565) + 3.4.12-from-source (:29566)
cd lab && docker compose up -d --build && cd .. # fixed side compiles ~10 min once
python3 poc/diagnose.py --port 29565 # VULNERABLE (exit 0)
python3 poc/diagnose.py --port 29566 # NOT-DETECTED (exit 1)
python3 poc/crash.py --rounds 3 --check-fixed # 3/3 [BUG] kills; fixed survives
python3 exploit/echo.py --port 29565 # write-primitive echo (stage-3
# construction: deterministic;
# the match hits Regexp.timeout
# in this layout — expected, the
# band scan still reports)
Everything Ruby-side runs inside Docker; the host only needs Python 3 (stdlib) and Docker.
| Doc | What it is |
|---|---|
| docs/finding-sheet.md | One-page datasheet: versions, CVSS, the family map (4 GitLab CVEs = 3 Onigmo bugs = 3 upstream fixes), sink chain, detection signatures (TLDR Sigma), traps |
| docs/report-ptes.md | PTES-structured report (7 phases) with lab evidence |
| docs/research-writeup.md | The investigation narrative — patch-first method, sink traps, primitive characterization, what is proven vs open |
The vulnerabilities, their discovery and the exploitation designs are
prior work by joaxcar (Johan Carlsson, via GitLab's HackerOne program;
the full report remains restricted — public at 90 days post-patch),
GitLab (disclosure, patch, TLDR detections) and the Ruby core team (upstream
fixes). yaamlabs published the mechanics outline (16-bit wrap, #+TODO:
interpolation, request-body grooming → system()); public PoC repos
(TahuCryptsi et al.) are crash/detector scripts — equivalent to this repo's
poc/ layer; lilting.ch independently reproduced the fix boundary across
five Ruby versions built from source (incl. the match-time [BUG] on
3.4.11 and 4.0.8, and a glibc double-free abort on 3.4.11 for the #13332
pattern); the deepest public artifact, the lesterlam reproduction lab,
compiles the engine standalone and demonstrates a blind-read oracle at the
same primitive characterized below — but explicitly excludes weaponized RCE
(re-verified 2026-10-23, 2026-10-24 and 2026-10-31: no verified public
technique exists to port — the 2026-10-29 murat-levi toolkit claim ships
no evidence and appears to re-badge the sibling #19020 primitive).
GitLab itself calls the real attack "a grind": noisy, most attempts failing
— consistent with the heap-layout dependence measured in this repo's lab.