← Blog · · df00tech

Ruby Patches Onigmo Regex Bugs Behind Four Critical GitLab RCE Flaws

security-news advisory

Ruby maintainers have shipped versions 4.0.9, 3.4.12, and 3.3.13 to fix three bugs in Onigmo, the regular expression engine embedded in the Ruby language. According to The Hacker News, these engine-level bugs are the root cause behind four critical security flaws that GitLab patched over the past month.

What was reported

GitLab reportedly found that a specially crafted regular expression pattern could corrupt memory during Ruby's pattern-compilation step, potentially leading to code execution on GitLab's own servers. Because the underlying flaw lives in Onigmo rather than in GitLab's application code, it affected multiple GitLab advisories rather than a single isolated bug.

Why it matters for defenders

Onigmo is bundled into the Ruby interpreter itself, so this isn't limited to GitLab — any Ruby application that compiles user-influenced or externally sourced regex patterns at runtime could be exposed to the same class of memory-corruption issue. GitLab's critical RCE flaws are the clearest demonstrated impact so far, but the shared root cause in a core language component raises the likelihood of similar issues surfacing in other Ruby-based software that processes untrusted regex input.

What defenders should watch for

  • Confirm GitLab instances are updated to the patched versions referenced in GitLab's own advisories from the past month, and separately verify the underlying Ruby runtime is upgraded to 4.0.9, 3.4.12, or 3.3.13.
  • Inventory other self-hosted Ruby applications and check whether they compile regex patterns derived from user input, external configs, or untrusted uploads — these are the higher-risk code paths for this bug class.
  • Hunt for anomalous crashes, segfaults, or worker-process restarts in Ruby/GitLab application logs around the time a regex-heavy feature (search, validation, filtering) processes attacker-supplied input, as memory corruption can manifest as instability before (or instead of) clean exploitation.
  • Review GitLab access and job logs for unexpected process execution or privilege changes correlating with requests containing unusual regex-like payloads.

This is still developing, net-new intel, and details on in-the-wild exploitation (if any) have not been confirmed. For the original report, see The Hacker News.

Get new detections in your inbox

New ATT&CK coverage plus CISA KEV / CVE detection rules, roughly weekly. No spam, unsubscribe anytime.