Created
October 25, 2013 23:36
-
-
Save DanBradbury/7163436 to your computer and use it in GitHub Desktop.
verify
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'benchmark' | |
require 'rubygems' | |
valid = Benchmark.measure do | |
Gem::Version.new '1.22.333.4444.55555.666666.7777777' | |
end | |
puts 'Valid version time:' | |
puts valid | |
invalid = Benchmark.measure do | |
begin | |
Gem::Version.new '1.22.333.4444.55555.666666.7777777.' | |
rescue | |
end | |
end | |
puts 'Invalid version time:' | |
puts invalid | |
n = (valid.real - invalid.real).abs | |
if 0.1 < n then | |
puts 'You are vulnerable to CVE-2013-4287.' | |
else | |
puts 'You are NOT vulnerable to CVE-2013-4287.' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment