Skip to content

Fix 3 of the 4 Grype-blocking advisories (the 4th needs a Ruby upgrade) - #4242

Open
tas50 wants to merge 2 commits into
chef:mainfrom
tas50:fix/grype-activestorage-websocket-driver
Open

Fix 3 of the 4 Grype-blocking advisories (the 4th needs a Ruby upgrade)#4242
tas50 wants to merge 2 commits into
chef:mainfrom
tas50:fix/grype-activestorage-websocket-driver

Conversation

@tas50

@tas50 tas50 commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Problem

The Grype scan job gates CI on high/critical findings and is failing on main and on every open PR. Four advisories block it:

Severity Advisory Package Installed Fixed in Lockfiles
Critical GHSA-xr9x-r78c-5hrm activestorage 7.2.3.1 7.2.3.2 oc-id
High GHSA-2x63-gw47-w4mm websocket-driver 0.8.0 0.8.2 oc-id
High GHSA-98m9-hrrm-r99r faraday 2.14.1 2.14.3 oc-id and chef-server-ctl
High GHSA-c4rq-3m3g-8wgx nokogiri 1.18.9 1.19.3 oc-id

Because the gate trips on any high/critical in the tree, and each existing PR fixes only one advisory, #4239, #4177 and this PR were all failing the same check — none could go green alone. This PR fixes the first three.

Result: 1 critical + 3 high → 0 critical + 1 high.

Changes

activestorage isn't declared directly — it comes from the exact rails pin, so the pin moves to the patch release in the same series:

-gem 'rails', '7.2.3.1'
+gem 'rails', '7.2.3.2' # 7.2.3.2 fixes GHSA-xr9x-r78c-5hrm (ActiveStorage)

websocket-driver is transitive via actioncable (>= 0.6.1), so a direct floor moves it forward. Dependabot opened #4223 for it and closed it saying "Looks like websocket-driver is no longer a dependency" — that isn't right; it's still in the lock at line 747, still reachable through actioncable.

faraday needs the floor in both src/oc-id and src/chef-server-ctl — fixing only one still trips the gate. This duplicates #4239; the Gemfile.lock diffs here came out byte-identical to that PR's. Whichever lands first, the other can be dropped.

All floors follow the existing concurrent-ruby precedent — a bare floor rather than a SafeVersions constant, since there's no ruby_gems_cleanup.rb consumer for these gems and so nothing for SafeVersions to keep in sync.

The fourth advisory can't be fixed on the pinned Ruby

nokogiri is deliberately not addressed here:

nokogiri required_ruby_version
1.18.9 (current) >= 3.1, < 3.5
1.19.3 (the fix) >= 3.2

omnibus_overrides.rb pins override :ruby, version: "3.1.7". Adding a >= 1.19.3 floor fails the resolve outright:

Bundler found conflicting requirements for the Ruby version:
  In Gemfile:
    nokogiri (>= 1.19.3) was resolved to 1.19.4, which depends on
      Ruby (>= 3.2)
  Current Ruby version:
    Ruby (= 3.1.7)

So GHSA-c4rq-3m3g-8wgx needs a Ruby 3.2+ upgrade first, which is far outside a dependency bump. Until then the Grype gate cannot reach zero.

This also explains #4177: it edits gem 'nokogiri', '1.18.9', platforms: :ruby, a line that no longer exists on main (removed by #4189) — hence the conflict — and the version it moves to could not resolve on Ruby 3.1 anyway. Worth closing.

Separately, #4189 dropping that line also dropped its platforms: :ruby guard ("Force Ruby platform to avoid glibc compatibility issues" from #4043), so the lock now resolves the precompiled x86_64-linux variant while omnibus_overrides.rb still pins override :nokogiri, version: "1.18.9". That may be worth a look on its own.

About the three extra gems in the oc-id lock diff

The lock also moves globalid 1.3.0 → 1.4.0, jbuilder 2.14.1 → 2.15.1, responders 3.2.0 → 3.2.1.

Not incidental staleness — I checked: a plain re-resolve of main's Gemfile is byte-identical to the committed lock. They move because they depend on the Rails subtree, and re-resolving it lets them float to the newest version their existing requirements already allow. The same three move under bundle lock, --update --conservative and --conservative --strict alike. Happy to pin them back if you'd rather hold them.

Verification

  • Both locks regenerated with bundler 2.3.27 on ruby 3.1.7 under linux/amd64, matching the BUNDLED WITH and x86_64-linux platform already recorded. PLATFORMS, BUNDLED WITH and the rack/rexml/net-imap floors in DEPENDENCIES are unchanged in both.
  • Re-running the resolve reproduces each lock byte for byte.
  • Grype run over the whole tree exactly as CI does (dir:. --only-fixed): before 1 critical + 3 high, after 0 critical + 1 high (the nokogiri finding above).

Caveat

oc-id is a Rails app and I could not run its suite here, so the Rails patch bump and the three transitive bumps are unvalidated beyond dependency resolution. Worth a green test run before merge.

The Grype scan gates CI on high/critical findings and is currently
failing on main and on every open PR, with four blocking advisories in
src/oc-id/Gemfile.lock:

  Critical  GHSA-xr9x-r78c-5hrm  activestorage     7.2.3.1  -> 7.2.3.2
  High      GHSA-2x63-gw47-w4mm  websocket-driver  0.8.0    -> 0.8.2
  High      GHSA-98m9-hrrm-r99r  faraday           2.14.1   -> 2.14.3
  High      GHSA-c4rq-3m3g-8wgx  nokogiri          1.18.9   -> 1.19.3

faraday is already handled by chef#4239 and nokogiri by chef#4177, so this
change covers only the two with no PR open.

activestorage is not directly declared; it comes from the exact rails
pin, so the pin moves 7.2.3.1 -> 7.2.3.2. That is a patch release within
the same 7.2.3 series.

websocket-driver is pulled in transitively by actioncable (>= 0.6.1), so
a direct floor is what moves it forward. It follows the existing
concurrent-ruby precedent in this Gemfile: a bare floor rather than a
SafeVersions constant, because no ruby_gems_cleanup.rb consumer exists
for the gem and there is therefore nothing for SafeVersions to keep in
sync. Dependabot opened chef#4223 for this gem and closed it believing
websocket-driver was no longer a dependency; it is still in the lock at
line 747 and still reachable through actioncable.

The lock also moves globalid 1.3.0 -> 1.4.0, jbuilder 2.14.1 -> 2.15.1
and responders 3.2.0 -> 3.2.1. These are not incidental staleness: a
plain re-resolve of main's Gemfile is byte-identical to the committed
lock, so the lock was current. They move because they depend on the
Rails subtree, and re-resolving it lets them float to the newest version
their existing Gemfile requirements already allow. The same three move
under bundle lock, --update --conservative and --conservative --strict
alike, so this is the resolver's minimal answer rather than a flag
choice.

The lock was regenerated with bundler 2.3.27 on ruby 3.1 under
linux/amd64 to match BUNDLED WITH and the x86_64-linux platform already
recorded, so PLATFORMS and BUNDLED WITH are unchanged, as are the
rack/rexml/net-imap floors in DEPENDENCIES. Re-running the resolve on
the result reproduces it byte for byte.

Verified by running Grype against src/oc-id the same way CI does
(--only-fixed): the activestorage critical and the websocket-driver high
are gone, and the only high findings left are the faraday and nokogiri
ones that chef#4239 and chef#4177 address.

Signed-off-by: Tim Smith <tim@mondoo.com>
@tas50
tas50 requested review from a team as code owners September 7, 2026 17:01
Extends this PR to cover the third of the four Grype-blocking
advisories, GHSA-98m9-hrrm-r99r. faraday 2.14.1 is present in both
src/oc-id/Gemfile.lock and src/chef-server-ctl/Gemfile.lock, so both
need the floor; fixing only one still trips the gate.

This duplicates chef#4239, which addresses the same advisory the same way.
The resulting Gemfile.lock diffs here are byte-identical to that PR's.
Whichever lands first, the other can be dropped.

The fourth advisory, GHSA-c4rq-3m3g-8wgx (nokogiri), is deliberately
not addressed, because it cannot be fixed on the Ruby this product
pins:

  nokogiri 1.18.9  required_ruby_version >= 3.1, < 3.5   (current)
  nokogiri 1.19.3  required_ruby_version >= 3.2          (the fix)
  omnibus_overrides.rb: override :ruby, version: "3.1.7"

Adding a >= 1.19.3 floor makes the resolve fail outright:

  Bundler found conflicting requirements for the Ruby version:
    In Gemfile:
      nokogiri (>= 1.19.3) was resolved to 1.19.4, which depends on
        Ruby (>= 3.2)
    Current Ruby version:
      Ruby (= 3.1.7)

That advisory needs a Ruby 3.2+ upgrade first, which is well outside
the scope of a dependency bump. It also explains why chef#4177 has been
open since May without merging: it edits a nokogiri line that no longer
exists on main (removed in chef#4189), and the version it moves to could
not resolve on Ruby 3.1 regardless.

Verified by running Grype over the whole tree the way CI does
(dir:. --only-fixed). Before: 1 critical, 3 high. After: 0 critical,
1 high -- the nokogiri finding above.

Signed-off-by: Tim Smith <tim@mondoo.com>
@tas50 tas50 changed the title Fix the two Grype-blocking advisories in oc-id that have no PR open Fix 3 of the 4 Grype-blocking advisories (the 4th needs a Ruby upgrade) Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant