Sha256: becf3640444f8dcf52c00a4da7cbf5be00a724ad1013f72ced5e7a299f203e0b

Contents?: true

Size: 1.53 KB

Versions: 59

Compression:

Stored size: 1.53 KB

Contents

= Algorithmic complexity vulnerability in RubyGems 2.0.7 and older

RubyGems validates versions with a regular expression that is vulnerable to
denial of service due to backtracking.  For specially crafted RubyGems
versions attackers can cause denial of service through CPU consumption.

RubyGems versions 2.0.7 and older, 2.1.0.rc.1 and 2.1.0.rc.2 are vulnerable.

Ruby versions 1.9.0 through 2.0.0p247 are vulnerable as they contain embedded
versions of RubyGems.

It does not appear to be possible to exploit this vulnerability by installing a
gem for RubyGems 1.8.x or 2.0.x.  Vulnerable uses of RubyGems API include
packaging a gem (through `gem build`, Gem::Package or Gem::PackageTask),
sending user input to Gem::Version.new, Gem::Version.correct? or use of the
Gem::Version::VERSION_PATTERN or Gem::Version::ANCHORED_VERSION_PATTERN
constants.

Notably, users of bundler that install gems from git are vulnerable if a
malicious author changes the gemspec to an invalid version.

The vulnerability can be fixed by changing the first grouping to an atomic
grouping in Gem::Version::VERSION_PATTERN in lib/rubygems/version.rb.  For
RubyGems 2.0.x:

  -  VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:
  +  VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*(-[0-9A-Za-z-]+(\.[0-9A-Za-z-]+)*)?' # :nodoc:

For RubyGems 1.8.x:

  -  VERSION_PATTERN = '[0-9]+(\.[0-9a-zA-Z]+)*' # :nodoc:
  +  VERSION_PATTERN = '[0-9]+(?>\.[0-9a-zA-Z]+)*' # :nodoc:

This vulnerability was discovered by Damir Sharipov <dammer2k@gmail.com>

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
rubygems-update-2.7.11 CVE-2013-4287.txt
rubygems-update-2.7.10 CVE-2013-4287.txt
rubygems-update-2.7.9 CVE-2013-4287.txt
rubygems-update-2.7.8 CVE-2013-4287.txt
rubygems-update-2.7.7 CVE-2013-4287.txt
rubygems-update-2.7.6 CVE-2013-4287.txt
rubygems-update-2.7.5 CVE-2013-4287.txt
rubygems-update-2.7.4 CVE-2013-4287.txt
rubygems-update-2.7.4.pre1 CVE-2013-4287.txt
rubygems-update-2.7.3 CVE-2013-4287.txt
rubygems-update-2.7.2 CVE-2013-4287.txt
rubygems-update-2.7.1 CVE-2013-4287.txt
rubygems-update-2.7.0 CVE-2013-4287.txt
rubygems-update-2.6.14 CVE-2013-4287.txt
rubygems-update-2.6.13 CVE-2013-4287.txt
rubygems-update-2.6.12 CVE-2013-4287.txt
rubygems-update-2.6.11 CVE-2013-4287.txt
rubygems-update-2.6.10 CVE-2013-4287.txt
rubygems-update-2.6.9 CVE-2013-4287.txt
rubygems-update-2.6.8 CVE-2013-4287.txt