-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Bringing over from the comment here: #6 (comment), and to fit with the guidelines of this repository, offering a proposal to prevent it.
Pop-up tracking
Third parties are able to gain access to first-party storage using the following method:
- The content publisher's page embeds a third-party script from tracker.example.
- The third-party script tries to read third-party cookies for tracker.example.
- If it can't, it injects a tracker.example iframe on the publisher's page.
- User clicks on content in the iframe (intentionally or via click-jacking).
- Using window.open, a new tab/window is opened for tracker.example.
- tracker.example window is now first party and can read or write cookies.
- tracker.example window accesses a function on tracker.example iframe, via window.opener, to pass an identifier.
- tracker.example window closes itself.
- Identifier can be passed to initial third-party script via postMessage and stored in first-party storage for continued tracking on the site.
The pop-up needs only to be open for a very short amount of time. However, this method can still be used by third parties that the user wishes to interact with, in a less covert manner, but without their express wish to be tracked.
Proposal
On the condition that a third-party iframe uses window.open (or anchor with target not "_top") without the "noopener" feature to open a new browser tab or window, the resulting window, when navigated to the same third-party domain as the iframe, should be considered to be running in a third-party context for the sake of storage.
Because having full script access to the window.opener is the offending article, the new window will no longer be able to break the barrier between the first-party and third-party contexts.
This will not affect pop-ups that were opened by a first-party, or opened with the "noopener" feature.
Considerations
- Would this affect oAuth implementations?
- Should this only affect "known trackers"?
- Should this be implemented only with the existence of an alternative method of gaining access to first-party storage (i.e. Storage Access API), either within the iframe or the pop-up.