Bug 1250109 (CVE-2015-4020)
Summary: | CVE-2015-4020 rubygems: incomplete fix for CVE-2015-3900 | ||
---|---|---|---|
Product: | [Other] Security Response | Reporter: | Ján Rusnačko <jrusnack> |
Component: | vulnerability | Assignee: | Red Hat Product Security <security-response-team> |
Status: | CLOSED NOTABUG | QA Contact: | |
Severity: | high | Docs Contact: | |
Priority: | high | ||
Version: | unspecified | CC: | mastahnke, mtasaka, s, vanmeeuwen+fedora, vondruch |
Target Milestone: | --- | Keywords: | Security |
Target Release: | --- | ||
Hardware: | All | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | rubygems 2.0.17, rubygems 2.2.5, rubygems 2.4.8 | Doc Type: | Bug Fix |
Doc Text: |
A flaw was found in a way rubygems verified the API endpoint hostname retrieved through a DNS SRV record. A man-in-the-middle attacker could use this flaw to force a client to download content from an untrusted domain.
|
Story Points: | --- |
Clone Of: | Environment: | ||
Last Closed: | 2015-08-04 14:27:51 UTC | Type: | --- |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: | |||
Bug Depends On: | |||
Bug Blocks: | 1237100 |
Description
Ján Rusnačko
2015-08-04 14:22:03 UTC
Analysis (from http://blog.rubygems.org/2015/05/14/CVE-2015-3900.html): """ RubyGems provides the ability of a domain to direct clients to a separate host that is used to fetch gems and make API calls against. This mechanism is implemented via DNS, specificly a SRV record _rubygems._tcp under the original requested domain. > dig _rubygems._tcp.rubygems.org SRV ;; ANSWER SECTION: _rubygems._tcp.rubygems.org. 600 IN SRV 0 1 80 api.rubygems.org. RubyGems did not validate the hostname returned in the SRV record before sending requests to it. This left clients open to a DNS hijack attack, whereby an attacker could return a SRV of their choosing and get the client to use it. For example: > dig _rubygems._tcp.rubygems.org SRV ;; ANSWER SECTION: _rubygems._tcp.rubygems.org. 600 IN SRV 0 1 80 gems.nottobetrusted.wtf """ Fix for this issue verifies that the returned host is on the same domain as the requested domain. This fix included: if /#{host}\z/ =~ target which is incomplete, because suffix match is sufficient, e.g. if the domain requested was rubygems.org, attacker served record of attackersrubygems.org would pass this check (CVE-2015-4020). The complete fix for both now includes: if /\.#{Regexp.quote(host)}\z/ =~ target The additional fix for CVE-2015-4020 was only applied in rubygems versions 2.0.17, 2.2.5, and 2.4.8. The original CVE-2015-3900 issue is tracked via bug 1236116. Trustwave SpiderLabs (original reporter) security advisory for this issue: https://www.trustwave.com/Resources/Security-Advisories/Advisories/TWSL2015-009/?fid=6478 Trustwave SpiderLabs blog post for CVE-2015-3900 and CVE-2015-4020: https://www.trustwave.com/Resources/SpiderLabs-Blog/Attacking-Ruby-Gem-Security-with-CVE-2015-3900/ |