RubyFlow The Ruby and Rails community linklog

rubygems-pwn: A Vulnerability in RubyGems (currently being fixed)

If you’ve seen people saying to run gem install rubygems-pwn on Twitter (which I don’t advise!), it’s because it’s a proof of concept for a vulnerabilty in RubyGems. The rubygems-pwn project on GitHub has more information about it, but essentially you can push arbitrary Ruby code into gemspec parameters which will then be executed later on. The vulnerability has been discussed in the rubygems repo where a fix has already been made but, hopefully, more general fixes should be made available soon. (If you want to see the direct example of a malicious gemspec, look here.)

Update: RubyGems 1.8.10 has been released to address this vulnerability.

Comments

Thanks. I’ve clarified things a bit.

Glade to see this finally getting some much needed attention.

Three things that worry me, 1) RubyGems does not seem to have Security Response Guidelines in place for responding to vulnerabilities, 2) this was a trivial mistake that none of the RubyGems maintainers caught 3) this vulnerability has existed since the first release of RubyGems, we have all been vulnerable this entire time.

Also the rubygems-pwn PoC is harmless (just calls puts and the say command). Although, I wouldn’t install it on a production server. ;)

Now, let’s get everyone upgraded!

The problem there is a lot of people deliberately use old versions of RubyGems due to the… “changes” since around 1.7 onwards. I wonder if backported releases or patches will be made available.

@peterc Has the Ruby Security team sent an Advisory out yet? I can’t find anything on ruby-lang.org or on Google.

SlimGems will be releasing a backport fix for this issue in the 1.3.x line, so if you use RubyGems pre 1.7, SlimGems is still an actively maintained branch.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in