Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSP: Do not strip non webby URL in reports. #31578

Merged
merged 1 commit into from Nov 24, 2021

Conversation

chromium-wpt-export-bot
Copy link
Collaborator

@chromium-wpt-export-bot chromium-wpt-export-bot commented Nov 10, 2021

In https://crbug.com/1264789, developers complained non HTTP/HTTPS URLs
are not included in reports.

The restriction was mostly introduced by:
https://codereview.chromium.org/2002943002 for convenience, in order to
reuse KURL::StrippedForUseAsReferrer.

The drawback is that "webpack://node_modules/sample/script4.js" is
transformed into "webpack", since its protocol is not http/https.

This patch initially wanted to remove this restrictions by rewriting our
own version of StrippedForUseAsReferrer, without the inconvenience, and
most importantly, add 14 WPT test cases.

Last minute, I wrote a specification:
w3c/webappsec-csp#527 and decided to prefer
using an allow-list containing ['http', 'https'] instead of a
block-list. As a result, 'webpack:' URLs continue to be stripped down to
their scheme. Sorry...

Note: There are some scheme we don't want to expose, like
['chrome-extension', 'moz-extension'].

Bug: 1264789
Change-Id: Ia967c3122915a37b119321bb327e6c969d649020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3263879
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944975}

Copy link
Collaborator

@wpt-pr-bot wpt-pr-bot left a comment

Choose a reason for hiding this comment

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

The review process for this patch is being conducted in the Chromium project.

@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3263879 branch 3 times, most recently from 4a3ac21 to 03ac205 Compare November 15, 2021 13:48
@chromium-wpt-export-bot chromium-wpt-export-bot force-pushed the chromium-export-cl-3263879 branch 4 times, most recently from 374413d to 081988b Compare November 24, 2021 14:11
In https://crbug.com/1264789, developers complained non HTTP/HTTPS URLs
are not included in reports.

The restriction was mostly introduced by:
https://codereview.chromium.org/2002943002 for convenience, in order to
reuse KURL::StrippedForUseAsReferrer.

The drawback is that "webpack://node_modules/sample/script4.js" is
transformed into "webpack", since its protocol is not http/https.

This patch initially wanted to remove this restrictions by rewriting our
own version of StrippedForUseAsReferrer, without the inconvenience, and
most importantly, add 14 WPT test cases.

Last minute, I wrote a specification:
w3c/webappsec-csp#527 and decided to prefer
using an allow-list containing ['http', 'https'] instead of a
block-list. As a result, 'webpack:' URLs continue to be stripped down to
their scheme. Sorry...

Note: There are some scheme we don't want to expose, like
['chrome-extension', 'moz-extension'].

Bug: 1264789
Change-Id: Ia967c3122915a37b119321bb327e6c969d649020
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3263879
Commit-Queue: Arthur Sonzogni <arthursonzogni@chromium.org>
Reviewed-by: Mike West <mkwst@chromium.org>
Cr-Commit-Position: refs/heads/main@{#944975}
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.

None yet

4 participants