-
Notifications
You must be signed in to change notification settings - Fork 332
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
TAO check and child frame navigations #1221
Comments
Navigation entries are not (currently) reported to the parent document, so they don't need a TAO check. |
How should response tainting be calculated for this separate TAO check? |
Can someone, maybe @yoavweiss, explain the "reporting to parent" case in more detail? Presumably it covers A embedding B. But what if B navigates to C? Or B redirects to C? (Is it limited to |
Judging from Chromium code, navigation timing saves a redirect list and the TAO check is done based on the list upon reporting (document load event). |
Chrome implements the TAO check in two places: Then there's also https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/timing/performance.cc;l=451;drc=9bd90f9e5aa1524e928b4619e4574441b020d153. This sort of follows the fetch spec, but calculates response tainting its own way, and adapted to handle the reporting to parent case as well. This version operates on the saved redirect responses (for unfortunate reasons, there's actually another copy of this logic elsewhere, but it's supposed to be identical). As for reporting to parent, I think Chrome attempts to only report it for the first HTTP load in a frame: https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/loader/document_loader.cc;l=944;drc=221e331b49dfefadbc6fa40b0c68e6f97606d0b3 I believe the theory is it's OK to report the initial load, because the src was presumably specified by the parent. I'm not sure that the Chrome logic is 100% sound though:
But I'm not familiar with the background here, so my reasoning of why things are/aren't OK may very well be wrong. |
Embedded documents are reported to the parent for the A embedding B case, but C should not be visible on neither navigations nor redirects. It's not limited to iframes.
Those sound like bugs... |
So if A embeds B but B is a redirect to B2/C you do not get timings? Any kind of redirect should stop it? That doesn't seem right. The HTML Standard doesn't really have a concept of initial navigation currently so this would definitely require some work to get right. I guess we should only report for the document that ends up replacing the initial about:blank document and only if that document was fetched over HTTP. |
If B server-side redirects to C, we get the timing, but not get neither C's URL nor any intermediate timings. |
For the old processing model, we landed on aborting the reporting when the request wasn't triggered by "process the {i,}frame attributes". We can probably do something similar on the reporting side in HTML. |
I see, that might be better and would also cover setting the (It's still not quite clear to me how the redirect scenarios work and how TAO plays into it, but I guess we'll get to it as part of the HTML PRs.) |
Maybe there are similar points for them, or maybe we can drop them altogether... (hopefully it's not a major use case) |
Is there already an issue for speccing this out in the HTML spec? |
There is a master issue: |
Wouldn't getting redirect values depend on whether the TAO check passes or not? That is, if the redirect in B has A or * in as TAO header and C has * then it should report the detailed timing information. |
Yeah, that's what I meant (but didn't actually write...) |
See related discussion here. |
Required for whatwg#1221 Blocks whatwg/html#7531 Closes whatwg#1421
whatwg/html#7531 is merged, so now iframe RT is reported. |
The steps for performing a TAO check are defined here:
https://fetch.spec.whatwg.org/#tao-check
"basic"
, then return success.Timing-Allow-Origin
from response’s header list."*"
, then return success.If I interpret https://fetch.spec.whatwg.org/#ref-for-concept-request-response-tainting%E2%91%A4 correctly, response tainting is always
"basic"
for navigate requests.Does this imply the TAO check would always pass when reporting the resource for a child frame navigation to the parent frame, even if cross-origin?
A separate question would be if the TAO check needs to separately account for the fact that the parent frame's origin may not be the same as the request's origin. Reading https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object and https://w3c.github.io/navigation-timing/#dfn-create-the-navigation-timing-entry, I don't see where the behavior of reporting navigation timing to the parent Document is defined.
The text was updated successfully, but these errors were encountered: