-
Notifications
You must be signed in to change notification settings - Fork 27
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
environment/has storage access
is not cleared during cross-site redirects
#210
Comments
What do implementations do today? |
The following scenario gives a reason why clearing it is preferable. We have
Storage access permission for In Chrome 133.0.6844.0
we observe the following behavior:
* redirect via form submission
Calling Instead, we prefer a same-site cross-origin redirection like 1 above to be made with Addendum: We want the same behavior also if the redirects are HTTP-redirects (rather than triggered by form submission). The current behavior is:
* HTTP redirect |
@HeikoTheissen that seems completely off-topic. I'm going to mark it as such. |
@annevk sorry, why is it off-topic? It describes the current behavior in Chrome and makes a case for a certain behavior based on their business logic. I'm going to unhide it for now but don't want to get into an edit war so happy to chat about it directly if you disagree :) |
I assume you're referring to the cross-origin (but same-site) redirect case, since maintaining the storage-access opt-in after a cross-site redirect is pretty clearly a CSRF vector. For the cross-origin, same-site redirect case:
IMO, we ought to make the browser follow the same origin policy here, i.e. stop implicitly maintaining storage access after the cross-origin redirect. SAH gives an easy way to re-opt-in to using a storage access permission grant, so this change would be a strict security win with no utility cost. Also as Heiko points out, web applications are already built around the assumption that different origins are isolated from each other, so IMO we should strive for consistency with that model by default (even if there's also an escape hatch via SAH). |
I agree, but the same should be true for cross-origin navigation ("redirect triggered by form submission"), not just for HTTP redirect. Both can occur during a SAML logon flow:
The type of SAML binding should not affect the storage access behavior (the same argument was made for the ancestor chain bit). |
It really should be cleared, per the spec and the WPT. I believe this is already the case. spec: https://privacycg.github.io/storage-access/#navigation An interesting question here is making sure that the document's request's access to cookies matches the resulting document's bit |
We should test these cases:
And then there's subresource cases:
In all of these cases different letters are different sites (we should also answer the site vs origin question, requiring some more tests), and the different numbers represent different resources within the same site. |
(We looked at this in our editor's call) Yeah, to add to the above - what happens to subsequent navigational requests in an iframe if a document called document.rSA() in that iframe? I think we should strive to always keep "credentials for document load" consistent with "storage access for subresources on that document", so that developers don't end up wrongly inferring availability of credentials in one place based on the other. |
I've got a patch for the WPT to make sure we keep the document load credentials consistent with the subresource credentials. I'll look to get that landed. But Firefox does still pass that. |
…tials Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1936355 gecko-commit: 8db61a9fffaff233a8ff6648033afd8f67a52f63 gecko-reviewers: anti-tracking-reviewers, timhuang
…t fetch credentials - r=anti-tracking-reviewers,timhuang Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720
…tials Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1936355 gecko-commit: 8db61a9fffaff233a8ff6648033afd8f67a52f63 gecko-reviewers: anti-tracking-reviewers, timhuang
…t fetch credentials - r=anti-tracking-reviewers,timhuang Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720
That section of the spec is a modification of how HTML handles navigations. We should also define how Fetch handles redirects for subresource requests, since that's hand-waved at the moment. |
…t fetch credentials - r=anti-tracking-reviewers,timhuang Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720 UltraBlame original commit: 8db61a9fffaff233a8ff6648033afd8f67a52f63
…t fetch credentials - r=anti-tracking-reviewers,timhuang Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720 UltraBlame original commit: 8db61a9fffaff233a8ff6648033afd8f67a52f63
…t fetch credentials - r=anti-tracking-reviewers,timhuang Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720 UltraBlame original commit: 8db61a9fffaff233a8ff6648033afd8f67a52f63
…t fetch credentials - r=anti-tracking-reviewers,timhuang Some of the tests discussed in privacycg/storage-access#210 Differential Revision: https://phabricator.services.mozilla.com/D231720
The spec defines a
has storage access
boolean onenvironment
, which gets set to true after a successful call todocument.requestStorageAccess()
. That bool's purpose is to be read by the cookie store, when attaching cookies to an outgoingrequest
.However, the environment's
has storage access
boolean is a latch: once it's set to true, it's never reset to false (for a givenenvironment
).This means that, at least as specified currently, an iframe (on site
a.com
, embedded intop
) could calldocument.requestStorageAccess()
, then make a fetch to a cross-site endpointevil.com/foo
. Thatevil.com
endpoint could respond with a redirect back toa.com/deletemyaccount
, and then the user agent's fetch ofa.com/deletemyaccount
would include cookies due to theenvironment
'shas storage access
.Clearly that's not intended; the cookie store ought to read a boolean that gets cleared after a cross-site redirect. I think this implies that
request
ought to have its ownhas storage access
boolean (naming TBD), which can be cleared after such a redirect without affecting theenvironment
'shas storage access
.But there's another interesting question to consider: should that new
request/has storage access
boolean also be cleared after a same-site but cross-origin redirect?On one hand, clearing it would be consistent with the Same Origin Policy. And if Storage Access Headers is implemented in all major browsers, then sites would have an easy way to opt back in to including cookies, post-redirect: just supply the
Activate-Storage-Access: retry; ...
response header to retry the request with cookies. But clearing the bool isn't totally backward compatible, it would require sites to adopt SAH if needed.On the other hand, cookies don't adhere to the Same Origin Policy in the first place, so it is more consistent if all their semantics are based around registerable domains, without some pieces being origin-based. Preserving the bool (and therefore including cookies after the redirect) would also be consistent with the behavior the iframe would have seen if there had been no redirect: if the iframe directly fetched the cross-origin, same-site URL, then the request would implicitly include cookies due to the
environment
'shas storage access
. This was intended behavior, since the cookies' model was based around registered domains, rather than origins (and therefore, so is thestorage-access
permission scope).This question is relevant to me because I'm working on the SAH spec (draft), and realized that it's stricter than the SAA spec in this respect; it clears its new boolean on cross-origin redirects. But it'd be good to align on some shared model and intentional behavior, so that the origin/site behavior doesn't vary based on which particular API surface was used.
The text was updated successfully, but these errors were encountered: