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

Permissions-Policy limitations #519

Closed
maudnals opened this issue Jul 15, 2022 · 1 comment
Closed

Permissions-Policy limitations #519

maudnals opened this issue Jul 15, 2022 · 1 comment

Comments

@maudnals
Copy link
Contributor

maudnals commented Jul 15, 2022

While the permissions policy comes with important security/anti-fraud benefits (prevent arbitrary third-parties from registering sources without the publisher’s knowledge), it comes with the following limitations for API users:

Limitations

  1. A permissions policy is lost in a chain of nested iframes (See developer issue)
  2. A permissions policy is lost in redirects (See developer issue)
    For example, let's take an HTTPS deployed site, that embeds an ad iframe that looks like this:
<iframe src="https://page-that-redirects.glitch.me/" allow="attribution-reporting" frameborder="1"></iframe>

page-that-redirects redirects to final-destination. So while the API is allowed in page-that-redirects, it's not allowed in final-destination. Repro here in IFRAME 7: https://shimmer-well-juravenator.glitch.me/.

This can also happen in more subtle ways. e.g. redirecting from https://a.com to https://www.a.com.

Mitigations

  • One way to mitigate 2. is to explicitly list the final destination of the redirect in the policy's src, but I don't know how realistic this is in practice.
  • The explainer mentions Without a Permissions Policy, a top-level document and cooperating iframe could recreate this functionality. This is possible by using postMessage to send the source_event_id, attributionsrc origin, destination values to the top level document who can then wrap the iframe in an anchor tag (with some additional complexities behind handling clicks on the iframe) but IMU this doesn't solves 1. nor 2, does it?
  • For 1., even if there was way for an iframe to delegate the permission to all its children, this would seem like a security issue.
@csharrison
Copy link
Collaborator

Closing this out for now given we changed the default to *, which I think successfully mitigates all the issues.

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