CVE-2015-4020
RubyGems Improper Input Validation vulnerability
RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.4.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 to an incomplete fix for CVE-2015-3900.
Exploit likelihood
What each source reports
NVD Score used
4.3
RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.4.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 to an incomplete fix for CVE-2015-3900.
- Record
CVE-2015-4020- CVSS 2.0
- 4.3 Medium
AV:N/AC:M/Au:N/C:N/I:P/A:N - Weakness
- CWE-20
- Updated
- 2026-11-02
CVE List No score
RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.4.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 to an incomplete fix for CVE-2015-3900.
- Record
CVE-2015-4020- Updated
- 2026-11-02
EUVDEUVD-2022-5031 No score
RubyGems 2.0.x before 2.0.17, 2.2.x before 2.2.5, and 2.4.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 to an incomplete fix for CVE-2015-3900.
- Record
EUVD-2022-5031- Updated
- 2026-11-03
GitHub AdvisoriesGHSA-qv62-xfj6-32xm No score
RubyGems Improper Input Validation vulnerability
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.
- Record
GHSA-qv62-xfj6-32xm- Weakness
- CWE-20
- Updated
- 2026-11-02
OSVGHSA-qv62-xfj6-32xm No score
RubyGems Improper Input Validation vulnerability
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.
- Record
GHSA-qv62-xfj6-32xm- Weakness
- CWE-20
- Updated
- 2026-11-02
Affected products
Affected packages
| Package | Affected | Fixed |
|---|---|---|
rubygems-updateRubyGems |
before 2.0.17 | 2.0.17 |
rubygems-updateRubyGems |
2.1.0.rc.1 up to 2.2.5 | 2.2.5 |
rubygems-updateRubyGems |
2.3.0 up to 2.4.8 | 2.4.8 |
rubygems-updateRubyGems |
before 2.0.17, plus listed versions 0.8.100.8.110.8.30.8.40.8.5 Show 45 moreShow less0.8.60.8.80.9.00.9.10.9.20.9.30.9.40.9.51.0.01.0.11.1.01.1.11.2.01.3.01.3.11.3.21.3.31.3.41.3.51.3.61.3.71.4.01.4.11.4.21.5.01.5.21.5.31.6.01.6.11.6.21.7.01.7.11.7.21.8.01.8.11.8.101.8.111.8.121.8.131.8.141.8.151.8.161.8.171.8.181.8.19 |
2.0.17 |
rubygems-updateRubyGems |
2.1.0.rc.1 up to 2.2.5, plus listed versions 2.1.02.1.0.rc.22.1.12.1.102.1.11 Show 14 moreShow less2.1.22.1.32.1.42.1.52.1.62.1.72.1.82.1.92.2.02.2.0.rc.12.2.12.2.22.2.32.2.4 |
2.2.5 |
rubygems-updateRubyGems |
2.3.0 up to 2.4.8, plus listed versions 2.4.02.4.12.4.22.4.32.4.42.4.52.4.62.4.7 |
2.4.8 |
History
| Recorded | Changed | Sources |
|---|---|---|
| aliases | EUVD | |
| first indexed | CVE List, GitHub Advisories, NVD, OSV |
Dates are when Every CVE recorded each change. Upstream dates may differ.
In short
CVE-2015-4020 is a medium vulnerability (CVSS 4.3) in Rubygems, published August 25, 2015. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 3.46%, the 89th percentile. Fixed in rubygems-update 2.0.17.
References
blog.rubygems.org/2015/06/08/2.2.5-released.html
trustwave.com/Resources/SpiderLabs-Blog/Attacking-Ruby-Gem-Security-with-CVE-2015-3900
securityfocus.com/bid/75431
trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009?fid=6478
blog.rubygems.org/2015/06/08/2.4.8-released.html
github.com/rubygems/rubygems/commit/5c7bfb5
Show 8 moreShow less
puppet.com/security/cve/CVE-2015-3900
oracle.com/technetwork/topics/security/bulletinoct2015-2511968.html
nvd.nist.gov/vuln/detail/CVE-2015-4020
github.com/rubysec/ruby-advisory-db/blob/master/gems/rubygems-update/CVE-2015-4020.yml
web.archive.org/web/20200228084212/http://www.securityfocus.com/bid/75431
web.archive.org/web/20200228085830/https://puppet.com/security/cve/CVE-2015-3900
github.com/advisories/GHSA-qv62-xfj6-32xm
github.com/rubygems/rubygems
Left out here: 41 versions. The JSON record has them.