Subscribe free
Morning Merge Ruby · Wednesday, November 18, 20264 min read

Bundler 4.1 gets an override switch

Also: Ruby's regexp update, Rails 8.0's last patch, Loofah fixes, Hotwire Inspector.

The main thing

A red gem held in a clamp on a jeweler's bench

Bundler can override a dependency's version constraint

If one gem's Ruby version cap is all that blocks your Ruby upgrade, you no longer need a fork. RubyGems and Bundler 4.1.0 shipped Monday, Nov. 16 (release notes), with a Gemfile override directive.

Per the maintainers' overview, override rewrites version constraints your dependencies declare, transitive ones included. When a gem caps required_ruby_version below the Ruby you just installed, override "foo", required_ruby_version: :ignore_upper gets you going. It can also drop or replace a dependency with with: and in:. Overrides land in a new OVERRIDES section of Gemfile.lock, visible in review.

That trades a resolver error for a compatibility question: the cap might be caution, or it might be real. Run the tests that reach the gem on the new Ruby and treat the override as temporary.

gem update --system alone isn't enough. Also run bundle update --bundler, which records Bundler 4.1.0 in your lockfile. Without it, Bundler switches back to the version your lockfile was generated with, and override and prune aren't available.

Also in 4.1.0:

Ruby Weekly #826 (Nov. 12) reports that a malicious gem called strutil-core ran a credential-stealing worm at gem install time via its extconf.rb earlier this month. RubyGems pulled it within hours, and Socket knows of no victims. Cooldown is aimed at exactly that risk.

Breaking change for CI: bundle clean now exits with an error when it cannot delete a file, where it used to report success.

What to do today: run both update commands on a branch, push through CI, watch bundle clean jobs, and use override only with tests behind it.

Patch check

A loom weaving red thread into cloth

Ruby now calls the GitLab regexp bugs Ruby vulnerabilities. On Nov. 17 the core team updated its Oct. 23 page: memory corruption reachable by compiling an untrusted pattern is now a Ruby vulnerability, with an advisory per bug in ruby/ruby and CVE identifiers requested. Until they arrive, track GitLab's CVE-2026-89078, CVE-2026-93577, CVE-2026-97229 and CVE-2026-110264.

Check your running Ruby and CI images; if you can't upgrade, stop compiling regexps from untrusted input.

Rails 8.0 got its last security patch. The Nov. 4 releases, 8.0.5.2 and 8.1.4.1, fix 21 security issues across Active Storage, Action Controller, sessions and more. The critical one, GHSA-f3w6-w445-fwh9 (CVSS 9.8), is arbitrary file write and read in Active Storage image analysis; Greg Molnar's reproduction (per Ruby Weekly) uses crafted uploads to expose files like master.key with MiniMagick and local disk storage. Security support for 8.0 ended Nov. 7, so 8.0.5.2 is its final fix; 8.1 is covered until October 2027. Check your lockfile, and if you're on 8.0, schedule the 8.1 move. (maintenance policy)

Loofah 2.25.3 fixes a mutation XSS and five other advisories (published Nov. 12). In the linked one, Nokogiri < 1.19.5 didn't escape < and > in attribute values. It affects apps that sanitize untrusted HTML with Loofah's HTML5 API and show the result to others: the :strip scrubber in every browser, :prune and :escape in WebKit browsers such as Safari. :whitewash, the HTML4 API, rails-html-sanitizer's default configuration and JRuby are not affected. Upgrade Loofah to 2.25.3; Nokogiri 1.19.5 alone covers only this XSS.

rails-html-sanitizer 1.7.2 fixes an allowlist swap (Nov. 13). SafeListSanitizer shares one PermitScrubber across calls on the same instance, and Action View memoizes one per helper module for every call in the process. On a threaded server like Puma, two concurrent sanitize calls with different allowlists can trade them. That includes a call with custom tags: or attributes: racing a plain call that uses the defaults. Upgrade, or pass a per-call scrubber:.

addressable 2.9.1 fixes a URI-normalization DoS and five other advisories (Nov. 12). normalize_path is quadratic in nested dot segments, so normalizing, comparing or joining a user-supplied URI can stall; the advisory clocks a 34 KB path at about 3.5 seconds on 2.9.0 under MRI Ruby 4.0. URI.parse alone is fine. Every version before 2.9.1 is affected.

Try this

A red lens magnifying a cut-paper scene

See what Hotwire is doing on a busy page. On Nov. 17 Radan Skorić released Hotwire Inspector, a browser extension that pulls Turbo Frames, Stimulus controllers and their targets, and Turbo events out of the surrounding HTML. He uses it on features he didn't build and to check that his AI coding agents built the agreed Hotwire architecture. "Because I have trust issues with them."

Try it on a form that updates several parts of a page and watch the frames, events and Stimulus values change as you submit.

Rails now has a Hotwire guide. This Week in Rails (Nov. 13) reports a new Hotwire guide, already on the Edge Guides. Read it with the Inspector open.

Patch Rails and your sanitizers first; try override on a branch.

← All Morning Merge Ruby issues

Get this in your inbox every morning.

Free. Five minutes. Unsubscribe in one click.

Subscribe free →