GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||
GeezerVison is showing github.com — Gem hosted stale-install guard only checks `vendor/cache`, so a committed cache at a configured `cache_path` gets no warning, the in-run VEX attests it, and Bundler 2.4 installs the unpatched gem · Issue #483 · SocketDev/socket-patch Closed Labels agent:triagedbugSomething isn't workingSomething isn't workingbughuntFound by a scheduled package-manager bug-hunt agentFound by a scheduled package-manager bug-hunt agentpm:bundlerBundler (RubyGems)Bundler (RubyGems)priority:p1 Description[agent] Found by the scheduled Bundler (RubyGems) bug-hunt routine (ledger #316). SummaryThe hosted gem stale-install guard (CLI_CONTRACT.md, "Gem stale-install guard") looks for the committed
ImpactOn Bundler ≤ 2.5, the vulnerable upstream code is installed and runs, while the scan reported a successful redirect and its VEX says ReproThis uses the hermetic fixture from mkdir proj && cd proj bundle config set --local path vendor/bundle bundle config set --local cache_path vendor/gems # committed in .bundle/config printf 'source "%s/upstream"\n\ngem "vuln-gem"\n' "$MOCK" > Gemfile bundle install && bundle cache # vendor/gems/vuln-gem-1.0.0.gem (upstream bytes) # fresh checkout: Gemfile, Gemfile.lock, .bundle/config, vendor/gems/ only socket-patch scan --mode hosted --json --yes --cwd "$PWD" --api-url "$MOCK" \ --org test-org --api-token fake --vex out.vex.json --vex-product pkg:gem/[email protected] # exit 0; redirect.warnings has no redirect_gem_stale_install # out.vex.json: GHSA-… not_affected "Patched via Socket patch <uuid> (redirected)" bundle install # (another fresh copy of the committed files) # Bundler 2.4.22: "Bundle complete!" exit 0; vendor/bundle/.../vuln-gem-1.0.0/lib/vuln_gem.rb == UPSTREAM bytes # Bundler 2.6.9 / 4.0.17: exit 37 "Bundler found mismatched checksums" Control: the same steps with the default Expected vs actual
Matrix (Linux, Ruby 3.3.6, main
|
| Bundler | cache_path: vendor/gems: warning |
in-run VEX | fresh bundle install |
default vendor/cache (control) |
|---|---|---|---|---|
| 2.4.22 | none | not_affected |
exit 0, unpatched bytes | warns, VEX withheld |
| 2.6.9 | none | not_affected |
exit 37 | untested |
| 4.0.17 (CHECKSUMS) | none | not_affected |
exit 37 | warns |
I reproduced each failing cell at least twice. The path logic doesn't depend on the OS, so macOS and Windows weren't probed.
crates/socket-patch-cli/src/commands/scan/hosted.rs:422: the folded flavor, cwd.join("vendor").join("cache").crates/socket-patch-cli/src/commands/scan/hosted.rs:471: the standalone flavor (pass 3), with the same hard-coded path.No probe runs.
[agent] Triaged as priority:p1 (Bundler). Confirmed on main: both guard flavors in crates/socket-patch-cli/src/commands/scan/hosted.rs (around lines 423 and 472) hard-code <cwd>/vendor/cache, and neither resolves BUNDLE_CACHE_PATH from .bundle/config or the environment. No open or merged PR covers this.
Generated by Claude Code
[agent] Claiming this issue (with #507; shared root cause: socket-patch reads Bundler settings ad hoc instead of through one resolver with Bundler's priority, local app config over ENV. gemfile uses the wrong order, and cache_path isn't read at all). Branch: agent/fix-bundler-settings-resolution. Claim-ID: 2026-10-02T05:21:03Z-66881b
Generated by Claude Code
[agent] Bundler bug-hunt (ledger #316): I verified draft PR #532 (head 477aae9) against a real-Bundler repro of both arms.
The setup is the hosted fixture with a CHECKSUMS lock and Bundler 4.0.17. I ran bundle cache into pkgcache, removed vendor/bundle, then ran scan --mode hosted:
| Arm | main 61cfb9b |
PR #532 |
|---|---|---|
BUNDLE_CACHE_PATH=pkgcache from the environment |
no warning; next install exits 37 (checksum mismatch) on 4.0.17, and installs unpatched "VULNERABLE" silently on 2.4.22 |
redirect_gem_stale_install |
bundle config set --local cache_path pkgcache |
no warning | redirect_gem_stale_install |
PR #532 fixes both arms on this repro.
Generated by Claude Code