Skip to content

Commit

Permalink
Add missing specs meta-redirect dections in OpenRedirect#vulnerable?.
Browse files Browse the repository at this point in the history
* Add specs for when when `content=` is double quoted, but `url=` is
  single quoted.
  • Loading branch information
postmodern committed May 25, 2024
1 parent 46f9cff commit 609d802
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions spec/open_redirect_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,29 @@
end
end

context "when the content attribute is double quoted" do
context "and the url value is single quoted" do
let(:response_body) do
<<~HTML
<html>
<head>
<meta http-equiv="refresh" content="0;url='#{subject.test_url}'"/>
</head>
<body>
<p>example content</p>
<p>included content</p>
<p>more content</p>
</body>
</html>
HTML
end

it "must return true" do
expect(subject.vulnerable?).to be_truthy
end
end
end

context "when the content attribute is not quoted" do
context "and the url value is double quoted" do
let(:response_body) do
Expand Down

0 comments on commit 609d802

Please sign in to comment.