2019-03-28 10:22:29 -04:00
|
|
|
require_relative '../spec_helper'
|
|
|
|
|
2022-04-25 08:53:54 -04:00
|
|
|
require 'rubygems'
|
|
|
|
require 'rubygems/user_interaction'
|
2019-03-28 10:22:29 -04:00
|
|
|
|
2022-04-25 08:53:54 -04:00
|
|
|
describe "CVE-2019-8321 is resisted by" do
|
|
|
|
it "sanitising verbose messages" do
|
|
|
|
ui = Class.new {
|
|
|
|
include Gem::UserInteraction
|
|
|
|
}.new
|
|
|
|
ui.should_receive(:say).with(".]2;nyan.")
|
|
|
|
verbose_before = Gem.configuration.verbose
|
|
|
|
begin
|
|
|
|
Gem.configuration.verbose = :really_verbose
|
|
|
|
ui.verbose("\e]2;nyan\a")
|
|
|
|
ensure
|
|
|
|
Gem.configuration.verbose = verbose_before
|
2019-03-28 10:22:29 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|