-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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-same-origin iframe potential issue with signed exchange #20848
Comments
@zhouyx yes, it is a problem. We are tracking a new feature request for Chrome where we "Ensure AMP frames can never mess with their parent (whether or not actually hosted on the same origin)." Some early discussions here: whatwg/html#2757 Essentially unless we can detect a redirect origin change before the page has a chance to interact with parent ( I haven't tried to find a solution but looks unlikely ), this becomes a blocker for web packaging. To build on @zhouyx's point, allowing same-origin |
cc @ampproject/wg-caching |
Quick note that "iframe origin can never be the same as the cache origin" is not true; redirect can evade that too. But cache prevents that resource from being too much of a problem for the unsigned case. |
I was thinking about this bug today, and I think a workaround might be possible without adding a new feature to the web platform. What if the AMP SXG validator required the SXG to have a That way, a Would that work? |
I think a problem with such an approach is that it can be extremely difficult to enumerate iframe origins. In general, AMP would really like to allow same-origin iframes. It also wants to avoid them scripting the parent. Not for security or compliance reasons, but because it would break on the cache in unexpected ways, and AMP aims to avoid documents breaking on the cache in unexpected ways. That is also why we've so far ignored the "redirect hack" that was always possible for on-origin AMP docs since it wasn't about security, but rather the hosting invariant. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
Based on the paragraph that @cramforce wrote, redirection within
allow-same-origin
iframe can easily create make the iframe a friendly iframe.This won't happen for cached AMP pages because the iframe origin can never be the same as the cache origin. However what about the case with signed exchange?
cc @cramforce @Gregable @aghassemi @lannka @torch2424
The text was updated successfully, but these errors were encountered: