<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Segment7: RubyGems 0.9.0 and earlier installation exploit</title>
    <link>http://blog.segment7.net/articles/2007/01/21/rubygems-0-9-0-and-earlier-installation-exploit</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>The Blog</description>
    <item>
      <title>RubyGems 0.9.0 and earlier installation exploit</title>
      <description>&lt;h3&gt;Problem Description:&lt;/h3&gt;

&lt;p&gt;RubyGems does not check installation paths for gems before writing files.

&lt;h3&gt;Impact:&lt;/h3&gt;

&lt;p&gt;Since RubyGems packages are typically installed using root permissions, arbitrary files may be overwritten on-disk.  This may lead to denial of service, privilege escalation or remote compromise.

&lt;h3&gt;Workaround:&lt;/h3&gt;

&lt;p&gt;No known workarounds

&lt;h3&gt;Solution:&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Upgrade to RubyGems 0.9.1

&lt;li&gt;&lt;p&gt;Apply one of the following patches:

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;For RubyGems 0.9.0:

&lt;p&gt;&lt;a href="http://rubyforge.org/frs/download.php/16543/installer.rb.extract_files.REL_0_9_0.patch"&gt;installer.rb.extract_files.REL_0_9_0.patch&lt;/a&gt;&lt;br&gt;
MD5 (installer.rb.extract_files.REL_0_9_0.patch) = bed4fcdd438a7d8b81cf72e1ffe48a7d
&amp;#65532;
&lt;li&gt;&lt;p&gt;For RubyGems 0.8.11:

&lt;p&gt;&lt;a href="http://rubyforge.org/frs/download.php/16544/installer.rb.extract_files.REL_0_8_11.patch"&gt;installer.rb.extract_files.REL_0_8_11.patch&lt;/a&gt;&lt;br&gt;
MD5 (installer.rb.extract_files.REL_0_8_11.patch) = 31e3bacd1821de0272864c153b7c0dca
&lt;/ul&gt;
&lt;/ol&gt;

&amp;#65532;&lt;h3&gt;Note:&lt;/h3&gt;

&lt;p&gt;Remote installations via Rubyforge will be disabled in the near future for versions of RubyGems earlier than 0.9.1, even for patched versions of RubyGems.  Local installations will continue to work, however.

&lt;p&gt;Thanks to Gavin Sinclair for finding and reporting this problem.

&lt;p&gt;Testing your updated RubyGems:

&lt;p&gt;Installing rspec-0.7.5 will give an InstallError on a patched version of RubyGems:

&lt;pre&gt;&lt;kbd&gt;$ gem install rspec --version 0.7.5
ERROR:  While executing gem ... (Gem::InstallError)
    attempt to install file into "../web_spec/web_test_html_formatter.rb"&lt;/kbd&gt;&lt;/pre&gt;

&lt;p&gt;An updated rspec (0.7.5.1) has already been released.

</description>
      <pubDate>Sun, 21 Jan 2007 01:08:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:49e56795-8ffb-4ae0-b68b-79751c271306</guid>
      <author>drbrain@segment7.net (Eric Hodel)</author>
      <link>http://blog.segment7.net/articles/2007/01/21/rubygems-0-9-0-and-earlier-installation-exploit</link>
      <category>Ruby</category>
      <category>Rubygems</category>
      <category>Software</category>
    </item>
  </channel>
</rss>
