GHSA-fp4w-jxhp-m23p CVE-2020-36327
Dependency Confusion in Bundler
- Severity
- 8.8 / 10
- High · CVSS 3.1
- Exploit chance (EPSS)
- 6.31%
- Chance of exploitation in the next 30 days. Higher than 93.61% of scored vulnerabilities.
- Known exploited
- No
- Not in CISA's catalog
- Weakness
- —
- Not classified
- Fix
2.2.10- Upgrade bundler to this version or later
Description
Bundler 1.16.0 through 2.2.9 and 2.2.11 through 2.2.17 sometimes chooses a dependency source based on the highest gem version number, which means that a rogue gem found at a public source may be chosen, even if the intended choice was a private gem that is a dependency of another private gem that is explicitly depended on by the application.
Affected versions
RubyGems
How to fix
Move to the fixed version or later with your package manager, update the lockfile, and run your tests. If the package only arrives through another dependency, upgrade that dependency first. If none of its releases pulls a fixed version yet, force the version with your package manager's override.
bundler RubyGems → 2.2.10
- bundler
bundle update bundler # Gemfile: gem "bundler", ">= 2.2.10"
Severity breakdown
CVSS 3.1 8.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
- Attack vector
- Network
- Attack complexity
- Low
- Privileges required
- None
- User interaction
- Required
- Scope
- Unchanged
- Confidentiality
- High
- Integrity
- High
- Availability
- High
References
Advisories
Packages
Other links
- github.com/rubygems/rubygems/issues/3982
- github.com/rubygems/rubygems/pull/4609
- github.com/rubygems/rubygems/commit/078bf682ac40017b309b5fc69f283ff640e7c129
- bundler.io/blog/2021/02/15/a-more-secure-bundler-we-fixed-our-source-priorities…
- github.com/rubygems/rubygems/blob/master/bundler/CHANGELOG.md
- github.com/rubysec/ruby-advisory-db/blob/master/gems/bundler/CVE-2020-36327.yml
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/MWXHK…
- mensfeld.pl/2021/02/rubygems-dependency-confusion-attack-side-of-things
- msrc.microsoft.com/update-guide/en-US/vulnerability/CVE-2021-24105
- zofrex.com/blog/2021/04/29/bundler-still-vulnerable-dependency-confusion-cve-20…
Timeline
- Published
- Last updated by the source
- Latest EPSS score
Related advisories
| Advisory | Severity | Why it's related |
|---|---|---|
| GHSA-jvgm-pfqv-887x Bundler allows attacker to inject arbitrary code via secondary Gem source | Critical | Also affects bundler |
| GHSA-49jx-9cmc-xjxm Bundler may install gems from a different source than expected | Medium | Also affects bundler |
| GHSA-fj7f-vq84-fh43 Local Code Execution through Argument Injection via dash leading git url parameter in Gemfile. | Medium | Also affects bundler |
| GHSA-g98m-96g9-wfjq Insecure path handling in Bundler | High | Also affects bundler |
MergeHarbor checks every repository's dependencies against this database, ranks what matters by exploitability and reachability, routes it to the owning team and opens the fix pull request.
Check your repos with MergeHarbor