psf-ruby-regexp-oct2026-check(8)

Script: /opt/psf-security-patches/ruby/ruby-regexp-oct2026-check.sh. Tool page: Ruby and GitLab regexp. Source. With the package installed: man psf-ruby-regexp-oct2026-check.

Ruby Regexp and String case conversion fixes, October+November 2026:
read-only checker  (v2)

October 2026: GitLab CVE-2026-89078, CVE-2026-93577, CVE-2026-97229,
CVE-2026-110264. Fixed in Ruby 4.0.9, 3.4.12 and 3.3.13 (23 Oct 2026) and in
GitLab 18.11.13, 19.0.10, 19.1.9, 19.2.9, 19.3.6, 19.4.3 and 19.5.1.

November 2026: seven more flaws in the same two areas, reported to Ruby
directly rather than through GitLab, so none has a CVE yet (one has been
requested for each; Ruby's advisory says to track them by GHSA ID until
then): GHSA-34m4-m9fh-gqp5 and GHSA-87fm-7w84-j2px (case conversion, one a
one-byte overflow, the other an integer overflow when the converted string
exceeds 4 GiB); GHSA-7x2q-68qv-6p8x (double free compiling a character
class intersection), GHSA-3p8q-wmhx-vm2w (compiled-program size overflow),
GHSA-7whj-cfh7-xgm4 (Regexp#to_s), GHSA-wpqw-5qxg-m68r and
GHSA-pvgc-g7gj-pv6h (case-insensitive matching and backreferences, both
out-of-bounds reads). Three are rated critical, three high, one moderate;
Ruby says it has seen working proof-of-concept code reaching remote code
execution for six of the seven (every one except the backreference read,
which only discloses memory or crashes the process). Fixed in Ruby 4.0.10,
3.4.13 and 3.3.14 (18 Nov 2026). A few trackers have started calling this
batch "Ruby2Shell"; that name is not Ruby's own and this script does not
rely on it. As of 19 November 2026, CVE-2026-132825 has been assigned to
GHSA-34m4-m9fh-gqp5 specifically (the one-byte case-conversion overflow);
the other six GHSAs in this batch have no CVE yet. The CVE number is
tracked alongside the GHSA below purely for anyone searching by it; it
does not change which builds are affected or what this script checks.

This batch is broader than October's: the case-conversion half is reached
by String#upcase/downcase/capitalize/swapcase (and their bang forms) on an
attacker-influenced string, something far more common in ordinary code
than compiling a user-supplied pattern, and the GHSA-34m4 overflow is
listed as reachable over the network with no authentication. Treat an
unfixed Ruby as exposed by default; the regex-compilation half is still the
one this script's 'scan' command can usefully narrow down.

Self-hosted software that bundles its own Ruby needs that product's own
update, on its own schedule, not just a system Ruby upgrade. As of 19 Nov
2026, public tracking (https://verialabs.com/ruby2shell/) showed the
current release of each of these still running an unfixed Ruby: GitLab
(19.6.0, Ruby 3.3.13), GitHub Enterprise Server (3.22.5, Ruby 4.0.9),
Mastodon (4.7.5, Ruby 4.0.9), OpenProject (17.9.7, Ruby 4.0.9), Discourse
(2026.10.1, Ruby 3.4.7) and Chatwoot (4.20.0, Ruby 3.4.4). This script
checks GitLab's and Discourse's bundled Ruby directly against the new
thresholds, since neither's own version number says anything about the
November fix yet; it has no install detection for GitHub Enterprise
Server, Mastodon, OpenProject or Chatwoot, so check those directly against
their own vendor's advisory.

If this software is helpful, consider a donation to our 501c3 nonprofit:
https://privacysafe.foundation

Usage:
  ./ruby-regexp-oct2026-check.sh [command]

  check (default)  every Ruby runtime on the host (system packages, rbenv,
                   rvm, chruby, asdf, mise, vendor-bundled Rubies under /opt),
                   every running Ruby process (Puma, Sidekiq, Unicorn...),
                   GitLab (Omnibus, source and container installs) and
                   Discourse (Docker launcher and bare-metal installs),
                   with whether each is fixed for the October batch, the
                   November batch, both, or neither. Root optional (root
                   sees every process). Exit 0 = nothing exposed, 1 =
                   something unfixed is running or a bundled app is
                   unfixed, 2 = something couldn't be read.
  scan             application code that compiles regexps from strings:
                   Regexp.new / Regexp.compile / Regexp.union and
                   interpolated regexp literals, graded by whether the
                   pattern is a literal, escaped, or worth reviewing.
                   Exit 0 = nothing to review, 1 = findings, 2 = none of the
                   scan paths exist, so nothing was scanned.
  hunt             the journal and Ruby and GitLab logs for Ruby crash
                   reports, Onigmo frames in backtraces, heap corruption
                   aborts and services killed by a crash signal.
                   Exit 0 = clean, 1 = findings, 2 = no journal or log could
                   be read, so nothing was searched.
  version          print the script version.

Everything here is read-only. Ruby has no in-process switch that blocks
these bugs: Regexp.timeout doesn't, length limits don't, and interpolated
literals compile without passing through any method a guard could wrap.
The fix is the upgrade.

This script never executes a Ruby binary. Versions are read from the
binary's contents or from the libruby it links.

Env overrides:
  RUBY_FIXED_33=3.3.14 RUBY_FIXED_34=3.4.13 RUBY_FIXED_40=4.0.10   (fixes both batches)
  RUBY_OCT_FIXED_33=3.3.13 RUBY_OCT_FIXED_34=3.4.12 RUBY_OCT_FIXED_40=4.0.9   (October only)
  FIXED_BUILDS="3.3.8-2ubuntu1.2"    distro builds known to carry the fixes
  GITLAB_FIXED="18.11.13 19.0.10 19.1.9 19.2.9 19.3.6 19.4.3 19.5.1"
  DISCOURSE_ROOT="/var/discourse"   where the Docker launcher lives
  DISCOURSE_APP="/var/www/discourse"  where a bare-metal checkout lives
  SCAN_PATHS="/srv /opt /var/www /home /usr/local/lib"
  SCAN_DEPTH=10                      how deep scan descends
  SCAN_GEMS=0                        1 = also scan installed gems and
                                     vendor/bundle (noisy, slow)
  SCAN_SHOW=5                        findings printed per app and grade
  HUNT_SINCE="2026-09-01"            how far back hunt reads the journal
  HUNT_LOGS="/srv/app/log/*.log"     extra log globs for hunt

The Security Patches software and this documentation are dedicated to the public domain under CC0 1.0 Universal. Other pages on privacysafe.app/docs are CC BY-SA 4.0 unless the page says otherwise.

The PrivacySafe Ecosystem

Shop at Ivy Cyber

Ivy Cyber offers PrivacySafe products and services in the USA and has partnerships with 3NSoft in Canada and Kuip Limited in the European Union. Enterprise services and consulting are available at ivycyber.com

PrivacySafe Foundation is a 501(c)(3) nonprofit public charity that supports the development of the PrivacySafe applications, along with the components they rely upon: 3NWeb protocols, filesystem, documentation, and reference implementations.

PrivacySafe Foundation

Donations to PrivacySafe Foundation support education, research, documentation, and public code. Purchases from Ivy Cyber support PrivacySafe products, services, hosting, and technical support. Together, we're building a better web.