Skip to content

Security/ruby 3.2 regexp fixes - #321

Merged
Sharpie merged 3 commits into
OpenVoxProject:mainfrom
ehelms:security/ruby-3.2-regexp-fixes
Oct 28, 2026
Merged

Sharpie merged 3 commits into
OpenVoxProject:mainfrom
ehelms:security/ruby-3.2-regexp-fixes

Conversation

@ehelms

@ehelms ehelms commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Backport Ruby 3.3.13's regexp compilation fixes to the Ruby 3.2.11 shipped by agent-runtime-8.x. Ruby 3.2 lacks the fixes for the underlying bugs associated with GitLab CVE-2026-89078, CVE-2026-93577, CVE-2026-97229, and CVE-2026-110264.

  • Fix alternation parse-tree ownership and the related error-path memory leak.
  • Reject overflowed repeat/null-check IDs, avoid quantifier-size overflow, and reject compiled programs too large for their offset type.
  • Apply all six patches in dependency order on every Ruby 3.2 build, with Ruby's regression tests included in the backports.

This changes the native Ruby runtime used by OpenVox agents; OpenVox Server's separate JRuby runtime is not changed.

I applied these patches to the ruby_3_2 branch in the ruby repository, and run all tests there. I have not attempted any openvox-agent builds with this change (I don't know how to do that).

Test plan

  • On a clean Ruby 3.2.11 source tree, all six patches apply in order with patch -p1 --fuzz=0, without rejects (verified locally).
  • Build the patched Ruby and run make test-all TESTS=../ruby/test/ruby/test_regexp.rb from a sibling build directory. The requester reports that all tests passed.
  • Build agent-runtime-8.x with Vanagon on supported platforms to verify packaging and platform-specific patch combinations (not run locally).

@ehelms
ehelms force-pushed the security/ruby-3.2-regexp-fixes branch from d35ae2f to 630a9a6 Compare October 27, 2026 18:46

@Sharpie Sharpie left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was looking into this myself over the weekend and got as far as extracting the patch series, but stopped before addressing some the failing hunks.

This looks like the correct set of 6 patches, thanks for doing this extraction and submitting a PR!

@Sharpie Sharpie added the security Related to a security issue label Oct 28, 2026
@Sharpie

Sharpie commented Oct 28, 2026

Copy link
Copy Markdown
Member

@ehelms In order to merge this, we'll need each commit to be signed by a SSH or GPG key registered to your GitHub account.

@ehelms
ehelms force-pushed the security/ruby-3.2-regexp-fixes branch from 630a9a6 to c58f74f Compare October 28, 2026 10:55
@ehelms

ehelms commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Updated with signatures

@ehelms
ehelms force-pushed the security/ruby-3.2-regexp-fixes branch from c58f74f to 75e72c0 Compare October 28, 2026 12:15
@Sharpie

Sharpie commented Oct 28, 2026

Copy link
Copy Markdown
Member

@ehelms looks like merging is still blocked due to no signatures. Looking at the PR commits locally, I get a N result for "no signature":

$ git fetch upstream pull/321/head
From https://github.com/OpenVoxProject/puppet-runtime
 * branch                  refs/pull/321/head -> FETCH_HEAD

$ git log upstream/main..FETCH_HEAD --format="Commit: %h | Signature: %G?"
Commit: 75e72c0ebf | Signature: N
Commit: 956974f697 | Signature: N
Commit: 296f8af314 | Signature: N

Ruby 3.2.11 can double-free the parse tree when parsing fails after
an alternation. Backport the Ruby 3.3 ownership fix and its
follow-up for an otherwise leaked partial branch.

Include regression coverage for GitLab CVE-2026-89078 and Ruby
bug #22384.

Signed-off-by: Eric D. Helms <[email protected]>
Large regexps can overflow the IDs used for repeats and null checks
during compilation. Backport Ruby 3.3 bounds checks and regression
tests to address GitLab CVE-2026-110264 in Ruby 3.2.

Signed-off-by: Eric D. Helms <[email protected]>
Ruby 3.2.11 can overflow arithmetic while expanding nested repeats
or emitting a program larger than its offset type. Backport Ruby 3.3
limits and preserve the size error for subexpression calls.

This addresses GitLab CVE-2026-93577 and CVE-2026-97229. Keep all
six backports in dependency order for agent-runtime-8.x.

Signed-off-by: Eric D. Helms <[email protected]>
@ehelms
ehelms force-pushed the security/ruby-3.2-regexp-fixes branch from 75e72c0 to 3ed1bad Compare October 28, 2026 14:12
@ehelms

ehelms commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@Sharpie it had been showing them in my local git log as signed, I tried again and now I see them as Verified in the UI

@Sharpie

Sharpie commented Oct 28, 2026

Copy link
Copy Markdown
Member

Looks good! Thanks again for putting this patchset together!

We'll run it through acceptance tests this week and look towards making a release of openvox-agent 8.x next week.

@Sharpie
Sharpie merged commit ebfdff2 into OpenVoxProject:main Oct 28, 2026
106 checks passed
@ehelms

ehelms commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

Thank you!

Sharpie added a commit to Sharpie/openvox-sbom-tools that referenced this pull request Oct 29, 2026
The 2026.10.28.1 release of `agent-runtime-8x` contains backported
patches for flaws in the Ruby 3.2 regex library and OpenSSL 3.0.22:

  - OpenVoxProject/puppet-runtime#321
  - OpenVoxProject/puppet-runtime#322

This commit adds the associated CVE IDs to the list of special cases
used for reporting fixes.

Signed-off-by: Charlie Sharpsteen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security Related to a security issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants