CVE-2015-4020 — rubygems-update
Fix: rubygems/rubygems@5c7bfb5CVE-2015-4020 is a Improper Input Validation vulnerability in rubygems-update. A fix is available for rubygems-update — see the affected versions and patch details below.
RubyGems Improper Input Validation vulnerability
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
rubygems-update💎rubygems-update💎rubygems-updateReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects RubyGems packages — download data is not available via public APIs for these ecosystems.
Description
RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.3.x before 2.4.8 does not validate the hostname when fetching gems or making API requests, which allows remote attackers to redirect requests to arbitrary domains via a crafted DNS SRV record with a domain that is suffixed with the original domain name, aka a "DNS hijack attack."
NOTE: this vulnerability exists because of an incomplete fix for CVE-2015-3900.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 💎RubyGems | rubygems-update | all versions | 2.0.17bundle update rubygems-update --conservative |
| 💎RubyGems | rubygems-update | ≥ 2.1.0.rc.1&&< 2.2.5 | 2.2.5bundle update rubygems-update --conservative |
| 💎RubyGems | rubygems-update | ≥ 2.3.0&&< 2.4.8 | 2.4.8bundle update rubygems-update --conservative |
Affected Products
solarisoraclerubygemsrubygemsDetection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for rubygems-update, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update rubygems-update to 2.0.17 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms CVE-2015-4020 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is CVE-2015-4020 in your dependencies?
Find it across RubyGems, including transitive dependencies.