privacycg / requestStorageAccessFor

A proposed extension to the Storage Access API and discussion of how it may be integrated with First-Party Sets.
https://privacycg.github.io/requestStorageAccessFor/
20 stars 8 forks source link

Prompt Spam where First Party Sets are not Used #2

Open bvandersloot-mozilla opened 2 years ago

bvandersloot-mozilla commented 2 years ago

There is concern that prompt spam will be a problem where first party sets are not adopted. See prior discussion on privacy-cg/storage-access#107. Forking here.

mreichhoff commented 2 years ago

Thanks for cutting the issue!

To summarize the prompt spam prevention possibilities besides FPS discussed elsewhere:

The latest comment then adds:

One other idea I thought of that I'd like to put forward is the base URL of the script making the request.

I assume this is some rule like (with "match" possibly also meaning same site or same origin): If the base URL of the script making the request does not match the top-level URL, reject the request.

i.e., <script src="a.com/rsafor.js"> calling requestStorageAccessForSite(a.com) on top-level site b.com would be rejected.

I’d be curious about whether there's any concern with CDN URLs (where a script authored by the top-level site but hosted on a CDN may be incorrectly blocked), and with bundled JS (where the true caller might be obscured, though the top-level site’s bundling of it may indicate approval), though I do think it is another good possibility.

bvandersloot-mozilla commented 2 years ago

I was actually thinking some rule like: If the base URL of the script making the request does not match the argument, reject the request.

i.e., <script src="a.com/rsafor.js"> calling requestStorageAccessForSite(a.com) on top-level site b.com would not be rejected, but <script src="b.com/rsafor.js"> calling requestStorageAccessForSite(a.com) on top-level site b.com would

The idea is to indicate an acceptance by a.com to allow storage access requests on its behalf on b.com. This indication comes in the form of a script that calls rsaFor being served to a page on b.com (w/ CORS acting as the control point).

mreichhoff commented 2 years ago

We discussed this issue a bit at TPAC, and I'm posting a summary below to ensure it matches @bvandersloot-mozilla's recollection (hopefully I didn't garble the message 😄):

Does this match your recollection? Thanks again for all the discussion and feedback!

bvandersloot-mozilla commented 2 years ago

For non-FPS browsers to avoid prompt spam, promptless grants are doable, but the number of those grants for a given embedded domain will need to be limited to avoid widespread sharing. In other words, a limited number of top-level sites with identical requestStorageAccessForOrigin('site.example') calls could have them resolve without a prompt (with user opt-in via prompt being possible after that number was reached). Based on this, I think there is a path forward for those browsers that don't support FPS.

I would replace "non-FPS browsers" with Firefox, but otherwise I agree. Some other browsers are opposed to promptless storage access grants and may also be opposed to FPS. This puts them in a tough situation that I think we left unresolved and wanting a broader conversation on.

Otherwise this matches my recollection. Thank you for the write up!