CVE-2015-4020
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.
What to do
Fixed builds are available from RubyGems: see the table below for the fixed version per release.
Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.
curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \ -H "Content-Type: text/plain" --data-binary @inventory.txt
Vendor status at a glance
Status by vendor and release
From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.
| Release | Package | Status | Fixed version | Advisory |
|---|---|---|---|---|
| Ubuntu 14.04 | ruby1.9.1 | Not affected vulnerable_code_not_present | ||
| Red Hat Enterprise Linux 7 | ruby | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-devel | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-doc | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-irb | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-libs | Not affected | ||
| Red Hat Enterprise Linux 7 | ruby-tcltk | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-bigdecimal | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-io-console | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-json | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-minitest | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-psych | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-rake | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygem-rdoc | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygems | Not affected | ||
| Red Hat Enterprise Linux 7 | rubygems-devel | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-devel | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-docs | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-irb | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-libs | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-rdoc | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-ri | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-static | Not affected | ||
| Red Hat Enterprise Linux 6 | ruby-tcltk | Not affected | ||
| Red Hat Enterprise Linux 6 | rubygems | Not affected | ||
| Red Hat Enterprise Linux 5 | ruby | Not affected | ||
| RubyGems library | rubygems-update | Fixed | 2.4.8 | GHSA-qv62-xfj6-32xm |
References
- http://blog.rubygems.org/2015/06/08/2.2.5-released.html
- https://www.trustwave.com/Resources/SpiderLabs-Blog/Attacking-Ruby-Gem-Security-with-CVE-2015-3900/
- http://www.securityfocus.com/bid/75431
- https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478
- http://blog.rubygems.org/2015/06/08/2.4.8-released.html
- https://github.com/rubygems/rubygems/commit/5c7bfb5
- https://puppet.com/security/cve/CVE-2015-3900
- http://www.oracle.com/technetwork/topics/security/bulletinoct2015-2511968.html
About this page
Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.