# Insecure Bundler configuration fetching internal Gems (okra) from Rubygems.org

Researcher registered a public gem named 'okra' matching an internal Basecamp gem; a developer's manual `gem install okra` fetched it, proving dependency-confusion RCE potential.

- Payout: $5,000
- Severity: high
- Program: Basecamp
- Found by: zofrex
- Disclosed: 2021-08-10
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/1104874
- Library page: https://bugbountylibrary.com/r/h1%3A1104874
- Tags: area:oss domain:oss impact:internal-access impact:rce kind:bounty platform:hackerone sev:high tech:ruby technique:recon vuln:dependency-confusion

**Target:** Ruby gem dependency resolution (Bundler / gem install) on developer machines
**Root cause:** Internal gem 'okra' was not namespaced/scoped to a private source, so a same-named public gem on Rubygems.org could be resolved and installed; a developer manually ran `gem install okra` without a source pin.
**Steps:**
1. Identify internal gem name 'okra' referenced by Basecamp (e.g. via leaked Gemfile or error output).
2. Publish a gem named `okra` (version 90002.0) to rubygems.org with a post-install callback.
3. Wait for resolution: observed install on host 'oscillatinghost' as user 'fernando'.
4. Confirm via callback that the public gem was fetched and installed.
**How found:** Researcher noticed an internal gem name in use and hypothesized it was not registered on Rubygems; tested by registering the name and monitoring for installs, which revealed a developer manually installing it.
**Exploitation:** Attacker publishes a higher-versioned gem under the internal name to the public registry; any `gem install` or misconfigured Bundler resolving from global sources installs it. RubyGems executes gem extension code at install time, yielding code execution without requiring the gem.
**Insight:** Internal package names that aren't reserved on public registries are claimable; even when CI is hardened, developers running manual `gem install`/`npm install`/`pip install` bypass source pinning — target the human install path, not just the build pipeline.

