Bug 1547418 (CVE-2018-1000073) - CVE-2018-1000073 rubygems: Path traversal when writing to a symlinked basedir outside of the root
Summary: CVE-2018-1000073 rubygems: Path traversal when writing to a symlinked basedir...
Keywords:
Status: CLOSED ERRATA
Alias: CVE-2018-1000073
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
URL:
Whiteboard:
Depends On: 1547431 1547432 1547433 1547436 1549913 1549914 1554493 1554494 1651600 1651607 1651614 1651629 1651801 1652039 1652040 1785400 1785401 1785402 1785403
Blocks: 1547429
TreeView+ depends on / blocked
 
Reported: 2018-02-21 10:28 UTC by Adam Mariš
Modified: 2021-02-17 00:47 UTC (History)
56 users (show)

Fixed In Version: rubygems 2.7.6
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-08 03:40:32 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2018:3729 0 None None None 2018-11-29 09:55:36 UTC
Red Hat Product Errata RHSA-2018:3730 0 None None None 2018-11-29 10:09:33 UTC
Red Hat Product Errata RHSA-2018:3731 0 None None None 2018-11-29 10:21:42 UTC
Red Hat Product Errata RHSA-2019:2028 0 None None None 2019-08-06 12:03:38 UTC
Red Hat Product Errata RHSA-2020:0542 0 None None None 2020-02-18 14:43:18 UTC
Red Hat Product Errata RHSA-2020:0591 0 None None None 2020-02-25 12:10:14 UTC
Red Hat Product Errata RHSA-2020:0663 0 None None None 2020-03-03 15:17:29 UTC

Description Adam Mariš 2018-02-21 10:28:28 UTC
Path traversal vulnerability in install_location function of package.rb was found that is triggered when
writing to a symlinked basedir outside of the root.

Upstream fix:

https://github.com/rubygems/rubygems/commit/1b931fc03b819b9a0214be3eaca844ef534175e2

External References:

https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/

Comment 1 Adam Mariš 2018-02-21 10:37:46 UTC
Created rubygems tracking bugs for this issue:

Affects: fedora-all [bug 1547431]

Comment 8 Andrej Nemec 2018-05-14 13:59:52 UTC
Statement:

This issue affects the versions of rubygems as shipped with Red Hat Subscription Asset Manager 1.x. Red Hat Product Security has rated this issue as having security impact of Moderate. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

This issue affects the versions of rubygems as shipped with Red Hat Satellite version 6 on Red Hat Enterprise Linux version 5. Red Hat Product Security has rated this issue as having security impact of Moderate. A future update may address this issue. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.

Comment 13 errata-xmlrpc 2018-11-29 09:55:25 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 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

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

Comment 14 errata-xmlrpc 2018-11-29 10:09:23 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 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

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

Comment 15 errata-xmlrpc 2018-11-29 10:21:32 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.4 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.5 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7.6 EUS

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

Comment 16 Jun Aruga 2018-12-11 17:26:48 UTC
> Upstream fix:
>
> https://github.com/rubygems/rubygems/commit/1b931fc03b819b9a0214be3eaca844ef534175e2

Above rubygems master branch's commit was modified at the additional below commit again.

Implement a safe mkdir for package that verifies were inside the destination dir for all
 new directories ccreated
https://github.com/rubygems/rubygems/commit/666ef793cad42eed96f7aee1cdf77865db921099

And this commit is 2nd commit mentioned at CVE-2018-1000079.
That means fixing CVE-2018-1000079 is also to fix CVE-2018-1000073.

> CVE-2018-1000079 rubygems: Path traversal issue during gem installation allows to write to arbitrary filesystem locations
> https://bugzilla.redhat.com/show_bug.cgi?id=1547426#c0
>
> Upstream fixes:
> 
> https://github.com/rubygems/rubygems/commit/f83f911e19e27cbac1ccce7471d96642241dd759
> https://github.com/rubygems/rubygems/commit/666ef793cad42eed96f7aee1cdf77865db921099

As a information I investigated, the rubygems repository's commit (666ef793cad42eed96f7aee1cdf77865db921099) is merged to ruby repository's ruby_2_3 branch, but not merged to ruby_2_2 branch.

We can see prepared patch file from below page for Ruby 2.2.9 and Ruby 2.3.6.
But also the patch for Ruby 2.2.9 does not include the commit(666ef793cad42eed96f7aee1cdf77865db921099). To check it easily, just search by a text "def mkdir_p_safe".

> External References:
> 
> https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/

for Ruby 2.2.9: https://bugs.ruby-lang.org/attachments/download/7030/rubygems-276-for-ruby22.patch
  = ruby_2_2 branch: https://github.com/ruby/ruby/commit/664b94fd2b4b19edd7d75c6bbcd3154905b2624e
for Ruby 2.3.6: https://bugs.ruby-lang.org/attachments/download/7029/rubygems-276-for-ruby23.patch
  = ruby_2_3 branch: https://github.com/ruby/ruby/commit/08fb5c2153deaee53e481ebe3602fe1d59e256c7

Comment 17 Joshua Padman 2019-05-15 23:01:39 UTC
This vulnerability is out of security support scope for the following products:
 * Red Hat Enterprise Application Platform 5
 * Red Hat JBoss Fuse Service Works 6

Please refer to https://access.redhat.com/support/policy/updates/jboss_notes for more details.

Comment 19 errata-xmlrpc 2019-08-06 12:03:36 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7

Via RHSA-2019:2028 https://access.redhat.com/errata/RHSA-2019:2028

Comment 21 errata-xmlrpc 2020-02-18 14:43:16 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.5 Extended Update Support

Via RHSA-2020:0542 https://access.redhat.com/errata/RHSA-2020:0542

Comment 22 errata-xmlrpc 2020-02-25 12:10:11 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.4 Advanced Update Support
  Red Hat Enterprise Linux 7.4 Update Services for SAP Solutions
  Red Hat Enterprise Linux 7.4 Telco Extended Update Support

Via RHSA-2020:0591 https://access.redhat.com/errata/RHSA-2020:0591

Comment 23 errata-xmlrpc 2020-03-03 15:17:26 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 7.6 Extended Update Support

Via RHSA-2020:0663 https://access.redhat.com/errata/RHSA-2020:0663


Note You need to log in before you can comment on or make changes to this bug.