Skip to content

Commit

Permalink
replace Kernel.open which lets data spawn shells with URI.parse to pr…
Browse files Browse the repository at this point in the history
…otect against RCE (#509)
  • Loading branch information
cryptofilegsa authored and MothOnMars committed Jan 16, 2020
1 parent 8db9abe commit bb98792
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion features/step_definitions/web_ext_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
Then /^I should see an s3 image "(.*?)"$/ do |image_file_name|
image_url = page.find(:xpath, '//img')[:src]
image_url.should =~ /s3\.amazonaws\.com.+#{Regexp.escape(image_file_name)}/
lambda { Kernel.open(image_url) }.should_not raise_error
lambda { URI.parse(image_url).open }.should_not raise_error
end

Then /^I should find "(.+)" in (.+)$/ do |text, locator|
Expand Down

0 comments on commit bb98792

Please sign in to comment.