forked from rubygems/rubygems
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CVE-2013-4363.txt
45 lines (30 loc) · 1.83 KB
/
CVE-2013-4363.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
= Algorithmic complexity vulnerability in RubyGems 2.1.4 and older
The patch for CVE-2013-4287 was insufficiently verified so the combined
regular expression for verifying gem version remains vulnerable following
CVE-2013-4287.
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.1.4 and older 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 newer. 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 "*" repetition to a "?"
repetition in Gem::Version::ANCHORED_VERSION_PATTERN in
lib/rubygems/version.rb. For RubyGems 2.1.x:
- ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
+ ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
For RubyGems 2.0.x:
- ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
+ ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
For RubyGems 1.8.x:
- ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})*\s*\z/ # :nodoc:
+ ANCHORED_VERSION_PATTERN = /\A\s*(#{VERSION_PATTERN})?\s*\z/ # :nodoc:
This vulnerability was discovered by Alexander Cherepanov <[email protected]>