Bug 1487587 (CVE-2017-0901)

Summary: CVE-2017-0901 rubygems: Arbitrary file overwrite due to incorrect validation of specification name
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: bcourt, bhu, bkearney, cbillett, ccoleman, dedgar, dmcphers, esammons, hhorak, iboverma, jgoulding, jmatthew, jorton, jross, kseifried, mastahnke, matt, mcressma, mmccune, mrike, mtasaka, ohadlevy, ruby-maint, s, tjay, tomckay, tsanders, vanmeeuwen+fedora, vondruch, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rubygems 2.6.13, ruby 2.4.2, ruby 2.2.8, ruby 2.3.5 Doc Type: If docs needed, set a value
Doc Text:
It was found that rubygems did not sanitize gem names during installation of a given gem. A specially crafted gem could use this flaw to install files outside of the regular directory.
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-12-20 09:25:00 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: 1487591, 1487592, 1487593, 1502045, 1509450, 1509451, 1534437, 1534438, 1534937, 1534938, 1534940, 1534941    
Bug Blocks: 1487526, 1487605    

Description Adam Mariš 2017-09-01 10:54:58 UTC
RubyGems version 2.6.12 and earlier fails to validate specification
names, allowing a maliciously crafted gem to potentially overwrite any
file on the filesystem.

Upstream patch:

https://github.com/rubygems/rubygems/commit/ad5c0a53a86ca5b218c7976765c0365b91d22cb2

Bug report:

https://hackerone.com/reports/243156

External References:

http://blog.rubygems.org/2017/08/27/2.6.13-released.html

Comment 1 Adam Mariš 2017-09-01 11:02:52 UTC
Created ruby193-rubygems tracking bugs for this issue:

Affects: openshift-1 [bug 1487592]


Created rubygems tracking bugs for this issue:

Affects: fedora-all [bug 1487591]
Affects: openshift-1 [bug 1487593]

Comment 5 errata-xmlrpc 2017-12-19 08:37:42 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS

Via RHSA-2017:3485 https://access.redhat.com/errata/RHSA-2017:3485

Comment 7 Cedric Buissart 2017-12-20 09:29:12 UTC
Statement:

This issue affects the versions of ruby as shipped with Red Hat Enterprise Linux 6, and 7 and the versions of rh-ruby22-ruby and rh-ruby23-ruby as shipped with Red Hat Software Collections. Red Hat Product Security has rated this issue as having Moderate security impact. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 9 errata-xmlrpc 2018-02-28 20:01:37 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2018:0378 https://access.redhat.com/errata/RHSA-2018:0378

Comment 12 errata-xmlrpc 2018-03-26 09:43:30 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS

Via RHSA-2018:0583 https://access.redhat.com/errata/RHSA-2018:0583

Comment 13 errata-xmlrpc 2018-03-26 10:21:41 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.3 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS

Via RHSA-2018:0585 https://access.redhat.com/errata/RHSA-2018:0585