Skip to content

WebKit export of https://bugs.webkit.org/show_bug.cgi?id=180347 - #9039

Merged
annevk merged 1 commit into
web-platform-tests:masterfrom
youennf:wpt-export-for-webkit-180347
Apr 19, 2018
Merged

annevk merged 1 commit into
web-platform-tests:masterfrom
youennf:wpt-export-for-webkit-180347

Conversation

@youennf

@youennf youennf commented Jan 15, 2018 •

Copy link
Copy Markdown
Contributor

fetch()'s redirect feature is insecure combined with "no-cors" or "cors"

@ghost

ghost commented Jan 15, 2018 •

Copy link
Copy Markdown

Build PASSED

Started: 2018-01-15 17:18:01
Finished: 2018-01-15 17:39:46

View more information about this build on:

@annevk annevk left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jakearchibald could you maybe look at the service worker bits? This looks good to me.

@youennf

youennf commented Feb 1, 2018

Copy link
Copy Markdown
Contributor Author

Would be nice if we could move forward with this PR.
@wanderview, @jakearchibald could you take a look?

@wanderview wanderview left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, but I'd like to keep some of the coverage that is being removed here. Also, the fetch test doesn't seem to be testing no-cors follow.

Comment thread fetch/api/redirect/redirect-mode.js Outdated
redirectMode("Redirect " + statusCode + " in \"manual\" redirect, cors mode", redirUrl, locationUrl, statusCode, "manual", "cors");
}
redirectMode("Redirect in \"error\" redirect, no cors mode", redirUrl, locationUrl, 301, "error", "no-cors");
redirectMode("Redirect in \"manual\" redirect, no cors mode", redirUrl, locationUrl, 301, "manual", "no-cors");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be a "no-cors" case with redirect mode "follow" here? Don't we want to exercise that to verify it rejects? Also, why not just wrap the status code for-loop above in a loop that changes the mode? That seems the best way to make sure every combination is exercised.

}, 'Non-navigation, manual redirect, no-cors mode Request redirected to ' +
'cors with credentials should succeed interception ' +
'and response should not be redirected');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why delete these test cases? They are there to cover all possible inputs. It seems we should just set the result to the correct expectation; which is to now reject.

});
}, 'Non-navigation, error redirect, no-cors mode Request redirected to ' +
'cors with credentials should fail interception and response should not ' +
'be redirected');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same with these cases. I'd prefer to keep coverage of all the possible inputs even if they are all hitting the same internal condition. In the future the internal conditions may change, but the possible set of inputs is fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'm curious the reason to delete these too.

Comment thread fetch/api/redirect/redirect-mode.js Outdated
urlParameters += "&location=" + encodeURIComponent(redirectLocation);

var requestInit = {"redirect": redirectMode};
var requestInit = {"redirect": redirectMode, mode: corsMode};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: remove the quotes from "redirect" or add them to "mode" also for consistency

});
}, 'Non-navigation, error redirect, no-cors mode Request redirected to ' +
'cors with credentials should fail interception and response should not ' +
'be redirected');

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I'm curious the reason to delete these too.

@youennf

youennf commented Feb 1, 2018

Copy link
Copy Markdown
Contributor Author

Thanks for the feedback, I'll fix the PR accordingly.
I'll put back the deleted tests even though they seem a bit redundant.

@youennf
youennf force-pushed the wpt-export-for-webkit-180347 branch from 3e55af3 to 27bc2d6 Compare February 4, 2018 09:02
@annevk
annevk merged commit d516af2 into web-platform-tests:master Apr 19, 2018
@wanderview

Copy link
Copy Markdown
Member

@youennf Is it intentional that this test switched from http:// to https:// for the redirect URL? That makes all these fetches cross-origin and possibly mixed content?

@wanderview

Copy link
Copy Markdown
Member

I'm going to do some fixes on the gecko side and sync back.

@wanderview

Copy link
Copy Markdown
Member

Actually, I'll do an upstream PR since the sync'ing is a bit lagged.

@youennf

youennf commented Apr 19, 2018

Copy link
Copy Markdown
Contributor Author

@youennf Is it intentional that this test switched from http:// to https:// for the redirect URL? That makes all these fetches cross-origin and possibly mixed content?

Probably not intentional indeed.
I guess the test filename could be updated so that it is served through HTTP.

annevk pushed a commit that referenced this pull request Apr 20, 2018
…directs

#9039 wasn't quite aligned with the specification.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants