Skip to content
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

Allow returning "prompt" rather than "denied" #388

Open
annevk opened this issue Oct 25, 2022 · 7 comments
Open

Allow returning "prompt" rather than "denied" #388

annevk opened this issue Oct 25, 2022 · 7 comments
Assignees

Comments

@annevk
Copy link
Member

annevk commented Oct 25, 2022

"denied" at times reveals information about prior visits that user agents might not be willing to expose. For certain permissions we might want to categorically outlaw it if all user agents are in agreement.

"denied" should be fine to return when it's the result of Permissions Policy or when lacking a secure context. I don't think that needs changing.

For other cases, user agents should be permitted to return "prompt", probably implementation-defined? But also, for certain permissions all implementations might be in agreement to not return "denied" (except as per above), such as for "storage-access". The specification should provide infrastructure for that as well as it'll leave less up to implementations.

@marcoscaceres
Copy link
Member

Yeah, totally makes sense. We should definitely add this.

@miketaylr miketaylr self-assigned this Oct 28, 2022
@johannhof
Copy link
Member

@miketaylr mind if I take a stab at this?

@johannhof
Copy link
Member

Actually, can't storage-access just provide its own permission query algorithm? Was there anything beyond that you were hoping to achieve here, @annevk? I suppose we could still add a note that UAs can always run implementation defined steps to hide/change the return value?

@annevk
Copy link
Member Author

annevk commented Nov 22, 2022

I didn't know that existed. privacycg/storage-access#60 (comment) is what I based this issue on. That might be sufficient if query() is the only way this state ends up being exposed.

I guess we should consider whether we want to do be doing that more generally, but that's probably best tracked separately as a follow-up.

(I'm a little wary of all these pluggable algorithms though as what actually ends up happening is not exactly clear.)

@annevk
Copy link
Member Author

annevk commented Nov 22, 2022

After discussing this a bit further I think there is a difference. The current setup is such that the internal algorithm is not pluggable, but the public API is. This means that specifications that build on top of this will still see "denied" (due to the end user having denied; seeing "denied" for other reasons is not a problem as that state can already be observed via other means). This has some minor fallout:

  1. Specifications building on top of Permissions might end up exposing "denied" (do to the end user having denied) through a side channel. Any such case should probably be considered a bug, but it would be impossible if they couldn't observe that state to begin with.
  2. Attackers could probably "Spectre read" the state. This is not a very problematic "Spectre read" attack, but it's also avoidable.

As such, I think Storage Access using "permission query algorithm" for now as well as ensuring that it doesn't expose "denied" (due to the end user having denied) through a side channel other than "Spectre read" is fine and we keep this issue as a follow-up to make "permission query algorithm" run at a lower-level (or possibly not expose "denied" (do to the end user having denied) at all anymore).

@miketaylr
Copy link
Member

I think Storage Access using "permission query algorithm" for now as well as ensuring that it doesn't expose "denied" (due to the end user having denied) through a side channel other than "Spectre read" is fine and we keep this issue as a follow-up to make "permission query algorithm" run at a lower-level (or possibly not expose "denied" (do to the end user having denied) at all anymore).

SGTM. @johannhof, if you'd like to tackle the follow-up once y'all get there, that's fine as well - but you probably have more pressing concerns up front.

@jan-ivar
Copy link
Member

jan-ivar commented Sep 15, 2023

I like Safari's cam/mic mitigation here: after I click "Never For This Website" I get "denied", but on reload I get "prompt". Only after calling getUserMedia() again and seeing it fail do I see "denied". We'll aim for doing the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants