#823 — October 23, 2026 |
Ruby Weekly |
|
Ruby regexp security fixes |
|
It's very rare I'll do an out-of-band issue of Ruby Weekly but after digging into today's security releases of CRuby, I felt it was prudent to spread the word. Ruby 4.0.9, 3.4.12, and 3.3.13 have all been released today with fixes for regexp bugs behind four GitLab-assigned CVEs. If you can update, do so. But I'll explain what the issues are below and you can determine if they affect you. Takashi Kokubun's official advisory has the full story, if you want to go direct to the most official source. Note: These bugs are specific to CRuby's Onigmo engine. JRuby and TruffleRuby use different regex engines and aren't affected by these fixes. |
What are the bugs? |
|
There were three bugs in Onigmo, Ruby's regular expression engine, that could corrupt memory while a regex pattern is being compiled:
So if you moved to 4.0.8, which I featured yesterday, you need one more bump. GitLab found these bugs could enable remote code execution on GitLab servers, including attacks that require no login. It assigned four CVEs rated Critical (CVSS 9.9 or 10.0) and patched the Ruby it ships. Ruby hasn't requested separate CVEs for these fixes so far; its advisory asks users to track them under GitLab's identifiers. |
Is your code affected? |
|
You're exposed if your application (or a dependency, alas) compiles regex patterns whose structure a third party can control. For example:
Think regex-powered search boxes, user-defined validation rules, or filters in CI and webhook tools. If every regex in your stack is written by you/your team, you're in a better position. Two things that won't help: |
What should you do? |
I'll be back next Thursday with, I hope, a regular issue… 😅 ___ |