-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
XFO tests for comma-separated header values #21730
XFO tests for comma-separated header values #21730
Conversation
I should add that I rewrote the file to use loops for the test cases instead of copy-pasta code, I tried splitting things up in individual commits but failed mid-way. I hope this ends up somewhat readable. |
Rewriting the tests as a At a deeper level, I don't think 308fdea#diff-0e5a26ef8bf3673359740ddfdf04f79c was correct. That is, it's clear that we have disagreement between browsers about the expected behavior. Chrome and Safari both fail closed when multiple headers are present with differing values. The linked bug https://bugzilla.mozilla.org/show_bug.cgi?id=1492059 doesn't explain why this behavior was chosen. Can you help me understand the rationale? |
@mikewest Looking at it, it seems that Safari and Chrome don't fail close all the time. I was unaware of the discussion you've had in May 2019. Apologies, if this adds confusion. |
8f4d77a
to
1e2d2fc
Compare
AFAIR, we fail closed iff the server asserts two policies that aren't the same. "I am confused, please block me." the server says. But I haven't looked at this in a while... |
One could also read the |
Unfortunately, Chrome and Safari both include |
But why should we split on commas even? A basic processing model for this header would be to combine, then get the value, and then do a case-insensitive match for "sameorigin" or "deny". If you specify something else, we'd fail open I guess as that's what we already do. That would also be consistent with a large number of existing headers. Doing a special thing for multiple values is rather odd. E.g., would |
Ah. Chrome and Safari not implementing
FWIW, I've tested Chrome for these cases. All go through as allow:
So, the pseudo-code is along those lines..
|
That sounds familiar to me. I don't think Chrome's current behavior is crazy, but I can understand if y'all would like it to be different. Is there an interop problem that this would resolve? As-is, XFO is nowhere on my priority list. Should that change? |
The lack of a clear processing model makes refactoring it harder than needed and we'd also like Firefox to align with other browsers in terms of what values to support. So what is the Chrome/Safari model, in detail?
|
I agree, and I'm totally willing to make changes to Chromium if that's helpful to you. I'm just trying to understand the priority from y'all's side. I'm not objecting to making changes. :) Chromium parses XFO in https://cs.chromium.org/chromium/src/content/browser/frame_host/ancestor_throttle.cc?rcl=9941923164bfa5fc210ea810eb2547e55e4888b4&l=354 and enforces in https://cs.chromium.org/chromium/src/content/browser/frame_host/ancestor_throttle.cc?rcl=9941923164bfa5fc210ea810eb2547e55e4888b4&l=200 (tests in https://cs.chromium.org/chromium/src/content/browser/frame_host/ancestor_throttle_browsertest.cc?g=0). The model is something more like: """
""" Looking at the last 7 days of framed navigations on Windows stable, the histogram looks as follows (details on each bucket at https://cs.chromium.org/chromium/src/content/browser/frame_host/ancestor_throttle.cc?g=0&l=35):
It would be nice if we had more detail on that |
I'm working on the spec for this in whatwg/html#5737, and have some similar tests in #24618. I'm happy to figure out the overlap and either get this merged or incorporate it into my tests. However, we do need to make a decision on what happens in the conflict case. Let's discuss that in whatwg/html#1230. |
I've fully merged these into #24618 for now, so let's close this. |
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
These adds test for headers like
X-Frame-Options: DENY,SAMEORIGIN
(with various combinations of DENY, SAMEORIGIN and INVALID).The existing cases send two headers, this does adds explicit tests for comma-separated header values.
There are existing tests that timeout in browsers other than Firefox.
Due to the fact that I am adding test cases, I am also adding more timeouts 😕
Tested to pass in Firefox (and 8 pass, 4 timeout) in Chrome as expected.
CC @annevk