-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Define X-Frame-Options processing #5737
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for tackling this. I've asked @mozfreddyb to take a look as well.
Why do we need to parse quoted values? They weren't in the original IE implementation nor RFC 7034. In Scott Helme's "top 1 million Alexa site" security header scans there are very few instances of XFO headers that contain quotes at all, and most of those are otherwise invalid with or without the quotes, like this gem: |
Because that's consistent with all other comma-delimited headers that use https://fetch.spec.whatwg.org/#concept-header-list-get-decode-split . |
Hmm, adding more tests for quoted values explicitly:
Given the lack of interop here, I think the proposed spec (treating the quoted values the same as unquoted ones) is better, as it is stricter and matches other headers' processing models. |
Daniel's comment did make me wonder if |
Hmm, OK. So let's write this spec assuming whatwg/fetch#1068 is fixed, and thus quoted values are treated as invalid values. With the current PR draft that would give Chrome's behavior, treating |
Something must have been wrong with my tests previously. (There is a lot of copying and pasting in the current infrastructure; probably we should straighten that out in the future.) With the latest version Firefox passes everything. |
Let's continue the discussion in the issue: #1230 (comment) |
5e96498
to
5353b0e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @domenic. I think this looks good now that we resolved the confusion around quotes. Should we address the quotes in an example to be sure or is that no longer needed now that Fetch covers it?
@mozfreddyb you might want to have a final look at this.
It's used quite a lot
bc6f9f9
to
e033d58
Compare
Fixed up; going to merge! Indeed, I think the quotes are not necessary to address in the examples table, as it's handled at a lower layer and doesn't exemplify any of the specific processing model in this algorithm. In general the examples table treads a fine line between duplicating web platform tests and being a helpful aid to the reader, so my instinct is to keep it more minimal... |
Follows whatwg/html#5737. Closes #21730 by incorporating all of those tests.
…tions, a=testonly Automatic update from web-platform-tests Expand X-Frame-Options tests Follows whatwg/html#5737. Closes web-platform-tests/wpt#21730 by incorporating all of those tests. -- wpt-commits: 29c58c00b7729431a79e333b2143d1289775fa76 wpt-pr: 24618
…tions, a=testonly Automatic update from web-platform-tests Expand X-Frame-Options tests Follows whatwg/html#5737. Closes web-platform-tests/wpt#21730 by incorporating all of those tests. -- wpt-commits: 29c58c00b7729431a79e333b2143d1289775fa76 wpt-pr: 24618
Closes #1230.
@annevk can you help me define the ABNF for this, and relatedly, the header handling? I used "get, decode, and split" but maybe I should be using one of https://fetch.spec.whatwg.org/#extract-header-values ?
Interop issues/deviations from this spec:
XFO: INVALID; XFO: SAMEORIGIN
(or the reverse) asXFO: DENY
. Firefox and this spec treats them asXFO: SAMEORIGIN
.(See WHATWG Working Mode: Changes for more details.)
/browsing-the-web.html ( diff )
/iana.html ( diff )
/index.html ( diff )
/infrastructure.html ( diff )
/references.html ( diff )