Closed Bug 1839918 Opened 1 year ago Closed 1 year ago

Extend BounceTrackingProtection to detect stateful bounces using cookies

Categories

(Core :: Privacy: Anti-Tracking, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
119 Branch
Tracking Status
firefox119 --- fixed

People

(Reporter: pbz, Assigned: pbz)

References

(Blocks 2 open bugs, Regressed 1 open bug)

Details

Attachments

(10 files)

48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review
48 bytes, text/x-phabricator-request
Details | Review

In order to differentiate between stateful and non stateful bounces we need to hook into the cookies and storage implementations to populate BounceTrackingRecords Storage Access Set.

Storages include:

  • QuotaManager
  • Service workers
  • Cookies
  • ?
Assignee: nobody → pbz
Status: NEW → ASSIGNED
Blocks: btp-nightly

This is a workaround for getting a BrowsingContext relationship for SetCookies messages from the content process.
Ideally we would not trust the content process with picking a BrowsingContext. This would require moving SetCookies
to an interface like PWindowGlobal.

Depends on D185302

Attachment #9347173 - Attachment description: WIP: Bug 1839918 - Pass BrowsingContext ID and third-party flag through PCookieService SetCookies. r=bvandersloot! → WIP: Bug 1839918 - Pass BrowsingContext ID and third-party flag through CookieService. r=bvandersloot!

Using PWindowGlobal for SetCookies calls from content to parent process means we can get
the BrowsingContext the cookies are set for. The current implementation in PCookieService
drops this relationship.
I'm leaving in the old SetCookies call for cases where the inner window is null. This
happens for some of the cookie tests.

Depends on D185303

Attachment #9347171 - Attachment description: WIP: Bug 1839918 - Update devtools cookie-changed observer for nsICookieNotification. r=#devtools-reviewers! → Bug 1839918 - Update devtools cookie-changed observer for nsICookieNotification. r=#devtools-reviewers!
Attachment #9347172 - Attachment description: WIP: Bug 1839918 - Update tests for nsICookieNotification. r=bvandersloot! → Bug 1839918 - Update tests for nsICookieNotification. r=bvandersloot!
Attachment #9347170 - Attachment description: WIP: Bug 1839918 - Refactor "cookie-changed" notifications to use nsICookieNotification. → Bug 1839918 - Refactor "cookie-changed" notifications to use nsICookieNotification.
Attachment #9347173 - Attachment description: WIP: Bug 1839918 - Pass BrowsingContext ID and third-party flag through CookieService. r=bvandersloot! → Bug 1839918 - Pass BrowsingContext ID and third-party flag through CookieService. r=bvandersloot!
Attachment #9348638 - Attachment description: WIP: Bug 1839918 - Create SetCookies variant for document.cookie on PWindowGlobal. r=bvandersloot! → Bug 1839918 - Create SetCookies variant for document.cookie on PWindowGlobal. r=bvandersloot!
Attachment #9347174 - Attachment description: WIP: Bug 1839918 - Add BounceTrackingStorageObserver to observe cookie changes. r=bvandersloot! → Bug 1839918 - Add BounceTrackingStorageObserver to observe cookie changes. r=bvandersloot!
Summary: Extend BounceTrackingProtection to detect stateful bounces → Extend BounceTrackingProtection to detect stateful bounces using cookies
Blocks: 1848406
Blocks: 1848963
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/5aa3b2f1b5ec Refactor "cookie-changed" notifications to use nsICookieNotification. r=extension-reviewers,cookie-reviewers,sessionstore-reviewers,bvandersloot,edgul,robwu https://hg.mozilla.org/integration/autoland/rev/fa9a6af80526 Update devtools cookie-changed observer for nsICookieNotification. r=devtools-reviewers,ochameau https://hg.mozilla.org/integration/autoland/rev/707021ebfd23 Update tests for nsICookieNotification. r=cookie-reviewers,sessionstore-reviewers,bvandersloot,valentin https://hg.mozilla.org/integration/autoland/rev/3949d9b400d4 Pass BrowsingContext ID and third-party flag through CookieService. r=bvandersloot,cookie-reviewers,edgul https://hg.mozilla.org/integration/autoland/rev/750e0796c1ad Create SetCookies variant for document.cookie on PWindowGlobal. r=bvandersloot,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/302d12c12083 Use PHttpChannel for SetCookies calls from child channels. r=bvandersloot,necko-reviewers,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/087b27593538 Add BounceTrackingStorageObserver to observe cookie changes. r=bvandersloot,anti-tracking-reviewers https://hg.mozilla.org/integration/autoland/rev/6e3d7fdfda3f When resetting BounceTrackingProtection state, also reset BounceTrackingState. r=bvandersloot,anti-tracking-reviewers https://hg.mozilla.org/integration/autoland/rev/1c438df525c7 Add a test for stateful bounces for cookies and localStorage. r=bvandersloot,anti-tracking-reviewers
Regressions: 1852010
Status: RESOLVED → REOPENED
Flags: needinfo?(pbz)
Resolution: FIXED → ---
Target Milestone: 119 Branch → ---
Pushed by pzuhlcke@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36aa6faea947 Refactor "cookie-changed" notifications to use nsICookieNotification. r=extension-reviewers,cookie-reviewers,sessionstore-reviewers,bvandersloot,edgul,robwu https://hg.mozilla.org/integration/autoland/rev/e595ad2083ee Update devtools cookie-changed observer for nsICookieNotification. r=devtools-reviewers,ochameau https://hg.mozilla.org/integration/autoland/rev/2bd8c91c5d97 Update tests for nsICookieNotification. r=cookie-reviewers,sessionstore-reviewers,bvandersloot,valentin https://hg.mozilla.org/integration/autoland/rev/7a28b63b4fc3 Pass BrowsingContext ID and third-party flag through CookieService. r=bvandersloot,cookie-reviewers,edgul https://hg.mozilla.org/integration/autoland/rev/8d7f44b9b6e2 Create SetCookies variant for document.cookie on PWindowGlobal. r=bvandersloot,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/c7862a00e6e7 Use PHttpChannel for SetCookies calls from child channels. r=bvandersloot,necko-reviewers,cookie-reviewers,valentin https://hg.mozilla.org/integration/autoland/rev/45ea26477050 Add BounceTrackingStorageObserver to observe cookie changes. r=bvandersloot,anti-tracking-reviewers https://hg.mozilla.org/integration/autoland/rev/d96e3e729358 When resetting BounceTrackingProtection state, also reset BounceTrackingState. r=bvandersloot,anti-tracking-reviewers https://hg.mozilla.org/integration/autoland/rev/cc8f579c6e8e Add a test for stateful bounces for cookies and localStorage. r=bvandersloot,anti-tracking-reviewers https://hg.mozilla.org/integration/autoland/rev/4f690ef38847 Avoid returning IPC failures where possible in RecvSetCookies to avoid crashes. r=bvandersloot,necko-reviewers,jesup
Flags: needinfo?(pbz)
Blocks: 1888505
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: