-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Exclude frequent timeout/hang spec on macOS
- Loading branch information
Showing
7 changed files
with
31 additions
and
42 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
require_relative '../spec_helper' | ||
|
||
|
||
ruby_version_is ''...'3.0' do | ||
require 'rexml/document' | ||
|
||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,21 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe "Array#pack" do | ||
|
||
ruby_version_is ''...'2.7' do | ||
it "resists CVE-2018-16396 by tainting output based on input" do | ||
"aAZBbHhuMmPp".each_char do |f| | ||
["123456".taint].pack(f).tainted?.should be_true | ||
end | ||
end | ||
end | ||
|
||
end | ||
|
||
describe "String#unpack" do | ||
|
||
ruby_version_is ''...'2.7' do | ||
it "resists CVE-2018-16396 by tainting output based on input" do | ||
"aAZBbHhuMm".each_char do |f| | ||
"123456".taint.unpack(f).first.tainted?.should be_true | ||
end | ||
end | ||
end | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
require_relative '../spec_helper' | ||
|
||
describe "String#unpack" do | ||
|
||
it "resists CVE-2018-8778 by raising an exception when a position indicator is larger than a native integer" do | ||
pos = (1 << PlatformGuard::POINTER_SIZE) - 99 | ||
-> { | ||
"0123456789".unpack("@#{pos}C10") | ||
}.should raise_error(RangeError, /pack length too big/) | ||
end | ||
|
||
end |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,38 @@ | ||
require_relative '../spec_helper' | ||
|
||
require 'optparse' | ||
platform_is_not :darwin do # frequent timeout/hang on macOS | ||
require 'optparse' | ||
|
||
require 'rubygems' | ||
require 'rubygems/gemcutter_utilities' | ||
require 'rubygems' | ||
require 'rubygems/gemcutter_utilities' | ||
|
||
describe "CVE-2019-8323 is resisted by" do | ||
describe "sanitising the body" do | ||
it "for success codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
response = Net::HTTPSuccess.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
describe "CVE-2019-8323 is resisted by" do | ||
describe "sanitising the body" do | ||
it "for success codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
response = Net::HTTPSuccess.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
end | ||
|
||
it "for error codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
def cutter.terminate_interaction(n) | ||
end | ||
response = Net::HTTPNotFound.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
it "for error codes" do | ||
cutter = Class.new { | ||
include Gem::GemcutterUtilities | ||
}.new | ||
def cutter.terminate_interaction(n) | ||
end | ||
response = Net::HTTPNotFound.new(nil, nil, nil) | ||
def response.body | ||
"\e]2;nyan\a" | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
end | ||
cutter.should_receive(:say).with(".]2;nyan.") | ||
cutter.with_response response | ||
end | ||
end | ||
end |
This file contains 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