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

Query: Can trusted subframe allocate permission to one of it's cross-domain subframe #542

Closed
aromalanil opened this issue Feb 22, 2024 · 2 comments

Comments

@aromalanil
Copy link

Description

In the 4th example of Permission Policy "Policy only directly affects child frame", the senerio mentioned is

  • "example.com" embeds an iframe "game.com" and allow geolocation permission to "game.com"
  • "game.com" integrated an iframe "resources.game.com" inside "game.com" and allow geolocation access.

In this scenario it is mentioned that "game.com" can allocate permission to the "resources.game.com", as a trusted subframe is able to delegate access to a feature to one of its subframes.

Question

Will this happen when the subframe is of a cross-domain?

In the given scenario, the "resources.game.com" is a sub-domain of the frame "game.com". Will this also work if the subframe was of a cross domain, let say "work.com"

example.com

<iframe src="https://game.com/" allow="geolocation"></iframe>

game.com

<iframe src="https://work.com/" allow="geolocation"></iframe>
@aromalanil aromalanil changed the title Query: Can trusted subframe allocate permission to one of it's subframe with a cross-domain Query: Can trusted subframe allocate permission to one of it's cross-domain subframe Feb 22, 2024
@clelland
Copy link
Collaborator

Yes, in this case, the https://game.com/ subframe is allowed to delegate the geolocation permission to https://work.com. Permissions-policy uses origins for comparison, and https://resources.game.com and https://work.com are both cross-origin to https://game.com.

@aromalanil
Copy link
Author

@clelland Thanks for the clarification. In this case wouldn't it be better to use URLs that are not subdomain for the example, to avoid the confusion if this is only applicable for subdomains.

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

2 participants