CVE-2015-4020
Description
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.
Severity
not scored
CVSS v3
not scored
Exploit chance (EPSS)
3.461%
chance of exploitation in the next 30 days
higher than 89.3% of scored CVEs · 2026-11-17
CISA KEV
Not listed
Public exploit code
None public
Exploit references (NVD and CNA): 0
Metasploit modules: 0
Nuclei templates: 0
Weakness
- CWE-20: Improper Input Validation
Timeline
- 2015-08-25Published by the CNA17:00 UTC
- 2022-05-17GitHub advisory published (GHSA-qv62-xfj6-32xm)2457 days after publication
Exploit and advisory records
GitHub advisory GHSA-qv62-xfj6-32xm, affected packages:
| Ecosystem | Package | Vulnerable range | Patched |
|---|---|---|---|
| RubyGems | rubygems-update | < 2.0.17 | 2.0.17 |
| RubyGems | rubygems-update | >= 2.1.0.rc.1, < 2.2.5 | 2.2.5 |
| RubyGems | rubygems-update | >= 2.3.0, < 2.4.8 | 2.4.8 |
Affected products
| Vendor | Product |
|---|---|
| oracle | solaris |
| rubygems | rubygems |
References
- http://blog.rubygems.org/2015/06/08/2.2.5-released.html
- http://blog.rubygems.org/2015/06/08/2.4.8-released.html
- http://www.oracle.com/technetwork/topics/security/bulletinoct2015-2511968.html
- http://www.securityfocus.com/bid/75431
- https://github.com/rubygems/rubygems/commit/5c7bfb5
- https://puppet.com/security/cve/CVE-2015-3900
- https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478
- https://www.trustwave.com/Resources/SpiderLabs-Blog/Attacking-Ruby-Gem-Security-with-CVE-2015-3900/
Get more CVE data from the API.
curl 'https://api.contrastcyber.com/cve_lookup/CVE-2015-4020'curl 'https://api.contrastcyber.com/cve_risk_score/CVE-2015-4020'curl 'https://api.contrastcyber.com/cve_exploit/CVE-2015-4020'curl 'https://api.contrastcyber.com/cve_products/CVE-2015-4020'
Sources
- Vulnerability data from the National Vulnerability Database (NIST) and the CVE Program. CVE records: Copyright © 1999-2026, The MITRE Corporation, used under the CVE Program Terms of Use. CVE® is a registered trademark of The MITRE Corporation.
- CWE definitions: Copyright © 2006-2026, The MITRE Corporation, used under the CWE Terms of Use. CWE is a trademark of The MITRE Corporation.
- EPSS scores by FIRST.org EPSS, used with attribution.
- KEV catalog and SSVC decisions by CISA.
- Advisory data from the GitHub Advisory Database through OSV.dev (CC BY 4.0).
- Exploit metadata from the Exploit Database (GPL-2.0-only, metadata only).
- Nuclei template names from nuclei-templates (MIT).