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 — Hosted gem redirect rewrites only the first of a gem's declarations, so a gem listed in two `group` blocks makes every `bundle install` fail with "You cannot specify the same gem twice" · Issue #548 · 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). SummaryBundler accepts a Gemfile that declares the same gem more than once with the same requirement. It only prints "Your Gemfile lists the gem … more than once". A common example is a gem listed in both The scan exits 0 with Vendored mode already detects this shape and fails closed with ImpactA project that commits the hosted rewrite can no longer install at all: CI breaks, the deploy breaks, and the VEX document from the same run claims the CVE is not exploitable. This is a different root cause from #482. #482 appends a second declaration when the first one isn't visible ( ReproThis uses a hold-open copy of cat > Gemfile <<'EOF' source "$UPSTREAM" group :development do gem "vuln-gem" end group :test do gem "vuln-gem" end EOF bundle config set --local path vendor/bundle bundle lock # warns "lists the gem vuln-gem (>= 0) more than once", writes the lock socket-patch scan --mode hosted --json --yes --api-url $API --org test-org --api-token fake \ --vex out.vex.json --vex-product pkg:gem/[email protected] # exit 0, redirect.redirected = 1, warnings = [], VEX: GHSA-redirect-gem-real not_affected # fresh checkout (Gemfile, Gemfile.lock, .socket, .bundle): bundle install # exit 4 The Gemfile after the scan: source "http://127.0.0.1:33109/upstream" group :development do source "http://127.0.0.1:33109/patch-registry/gem/<token>/<uuid>/" do gem "vuln-gem", "1.0.0" end end group :test do gem "vuln-gem" end The output of A top-level declaration plus one inside Expected vs actual
Matrix (Linux, Ruby 3.3.6)
The bug isn't OS-specific: it comes from the Gemfile text rewriter, and macOS / Windows weren't probed. It also reproduces with the released v4.0.0 (npm Suspect code
No probe branch was needed (the bug doesn't depend on the OS). Activity
MetadataMetadataAssigneesLabelsagent: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 TypeProjectsMilestoneRelationshipsDevelopmentIssue actions | ||||||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |