Use separate connections for isolated third-party trackers
Categories
(Core :: Networking: HTTP, enhancement, P2)
Tracking
()
Tracking | Status | |
---|---|---|
firefox68 | --- | fixed |
People
(Reporter: ehsan.akhgari, Assigned: ehsan.akhgari)
References
(Blocks 1 open bug)
Details
(Whiteboard: [anti-tracking][necko-triaged])
Attachments
(7 files)
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
Right now with Enhanced Tracking Protection enabled, two third-party tracking connections from two separate tabs for example (or a third-party tracking connection from a tab and a first-party tracking connection from another tab) may end up sharing the same connection together, which would allow the tracker to tie the user's browsing across multiple tabs together on the server side (similar to bug 1283319.)
We need to add the top-level page's origin to the nsHttpConnectionInfo's hash key for third-party tracking channels in order to prevent this from happening.
Assignee | ||
Updated•6 years ago
|
Assignee | ||
Comment 1•6 years ago
|
||
Gary said he would be interested to take this. Here is some info on how a possible for this could work.
The core of the fix would be in nsHttpConnectionInfo::BuildHashKey(), through ensuring that we mix in the origin of the top-level document if our channel is an third-party tracking resource. In order to do this, we need to know two things: whether the channel is an isolated third-party tracking resource, and the origin of the top-level document.
You can determine whether the channel is an isolated third-party tracking resource using:
mIsThirdPartyTrackingResource &&
!AntiTrackingCommon::IsFirstPartyStorageAccessGrantedFor(this, mURI,
nullptr)
We already compute this once when connecting to the network here: https://searchfox.org/mozilla-central/rev/f1c7ba91fad60bfea184006f3728dd6ac48c8e56/netwerk/protocol/http/nsHttpChannel.cpp#3911. You'd want to compute this a bit earlier in BeginConnect() around https://searchfox.org/mozilla-central/rev/f1c7ba91fad60bfea184006f3728dd6ac48c8e56/netwerk/protocol/http/nsHttpChannel.cpp#6430. You should probably call the same code in a helper function or something and assign the result to a boolean member and use it in both places to avoid calling IsFirstPartyStorageAccessGrantedFor()
twice.
The origin of the top-level document can be obtained from the load info object: https://searchfox.org/mozilla-central/rev/f1c7ba91fad60bfea184006f3728dd6ac48c8e56/netwerk/base/nsILoadInfo.idl#900
Testing this isn't as simple as testing bug 1283319. I think you'd want to add a mochitest which sets up test trackers, then loads a third-party tracking iframe, and then looks at the document's channel and reads the connectionInfoHashKey
attribute from it.
Updated•6 years ago
|
Assignee | ||
Comment 2•6 years ago
|
||
The patch in bug 1500533 makes us call SetPrivate(true) on the nsHttpConnectionInfo object belonging to an isolated third-party tracking channel, which is part of what we needed to do here. So the patch needed here can probably be built on top of what we have there.
Comment 3•6 years ago
|
||
Tanvi, do we have a timeline for this bug? (Gary and I need to sort out his priority.)
Comment 4•6 years ago
•
|
||
From Anti-tracking Engineering meeting:
- We are targeting 68 Nightly.
- Ehsan will ping Gary when bug 1500533 is done.
Assignee | ||
Comment 5•6 years ago
|
||
This change should be documented on https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy.
Assignee | ||
Comment 6•6 years ago
|
||
I'm picking this one since it's the continuation of bug 1500533.
Assignee | ||
Comment 7•6 years ago
|
||
Assignee | ||
Comment 8•6 years ago
|
||
Assignee | ||
Comment 9•6 years ago
|
||
Assignee | ||
Comment 10•6 years ago
|
||
Assignee | ||
Comment 11•6 years ago
|
||
Assignee | ||
Comment 12•6 years ago
|
||
Assignee | ||
Comment 13•6 years ago
|
||
Assignee | ||
Comment 14•6 years ago
|
||
Building the hashkey for these objects will soon depend on the isolated flag,
therefore we need to ensure that it is available when cloning the objects
inside the constructor. This patch refactors the clone method to avoid using
SetIsolated().
Assignee | ||
Comment 15•6 years ago
|
||
Comment 16•6 years ago
|
||
I'll wait until this lands to document (keeping ni). Thanks for flagging me -- I'm excited to see progress here :).
Assignee | ||
Comment 17•6 years ago
|
||
(In reply to Steven Englehardt [:englehardt] from comment #16)
I'll wait until this lands to document (keeping ni).
Sounds good!
Comment 18•6 years ago
|
||
Comment 19•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/9191d987a9e1
https://hg.mozilla.org/mozilla-central/rev/4a5475f6aa49
https://hg.mozilla.org/mozilla-central/rev/c316d49df8c4
https://hg.mozilla.org/mozilla-central/rev/5cbdeb635a3e
https://hg.mozilla.org/mozilla-central/rev/969945148b3d
https://hg.mozilla.org/mozilla-central/rev/ebad998aae7a
https://hg.mozilla.org/mozilla-central/rev/037390836504
Comment 20•6 years ago
|
||
Backed out 7 changesets (bug 1535697) for causing Bug 1547596. a=backout
Backout link: https://hg.mozilla.org/mozilla-central/rev/588535ba7633dee062173d41059b403fd3939e4e
Assignee | ||
Comment 21•6 years ago
|
||
Bug 1547596 was caused because of https://hg.mozilla.org/mozilla-central/rev/969945148b3d#l1.164. Here we would be trying to deserialize a string saved by an older build of Firefox which doesn't include mTopWindowOrigin
. The fix is to move the code to serialize/deserialize this new member to the very end obviously.
I also added some comments about this subtle semantics for the next person to add a new member to AltSvcMapping
.
Comment 22•6 years ago
|
||
Comment 23•6 years ago
|
||
Documented in https://developer.mozilla.org/en-US/docs/Mozilla/Firefox/Privacy/Storage_access_policy$compare?from=1544621&to=1546858
Comment 24•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/47c353bd446d
https://hg.mozilla.org/mozilla-central/rev/6b122a9ce1a4
https://hg.mozilla.org/mozilla-central/rev/c79109688f29
https://hg.mozilla.org/mozilla-central/rev/c22a48c48548
https://hg.mozilla.org/mozilla-central/rev/86be6123ca53
https://hg.mozilla.org/mozilla-central/rev/3e02969bf413
https://hg.mozilla.org/mozilla-central/rev/251ef3905140
Description
•