Closed Bug 1876575 Opened 5 months ago Closed 3 months ago

Make ShouldAllowAccessFor calls aware of ancestor chains same-siteness

Categories

(Core :: Privacy: Anti-Tracking, task)

task

Tracking

()

RESOLVED FIXED
126 Branch
Tracking Status
firefox126 --- fixed

People

(Reporter: bvandersloot, Assigned: bvandersloot)

References

(Blocks 1 open bug)

Details

Attachments

(5 files)

This makes triple-keying of Storages possible, because they rely on ShouldAllowAccessFor to determine when to use a partitioned principal.

THIS DOESN'T WORK

the loadInfo flags aren't quite equivalent. In particular the doc channel has an unexpected disagreement.

I tried also switching over to using AntiTrackingUtils::IsThirdParty* calls instead of the new loadInfo flag here, but that broke something.

Putting this up as a minimal version that gets the spirit of what I am trying to do.

Depends on D203155

Assignee: nobody → bvandersloot
Attachment #9388504 - Attachment description: WIP: Bug 1876575, part 1 - Make AntiTracking::IsThirdParty* aware of ABA case - WIP → Bug 1876575, part 1 - Make AntiTracking::IsThirdParty* aware of ABA case - r=#anti-tracking!
Attachment #9388717 - Attachment description: WIP: Bug 1876575, part 2 - Make Workers use ancestor chain for third-partiness check - WIP → Bug 1876575, part 2 - Make Workers use ancestor chain for third-partiness check - r=#anti-tracking!

I believe that about:blank is not the only url that should be ignored for third-partiness checks.

While working to make the Storage Partitioning implementation respect the entire ancestor chain (partitioning A(B(A)) contexts),
I realized that looking at the ancestor chain was not the only difference between AntiTrackingUtils::IsThirdParty* calls and
ThirdPartyUtil::IsThirdParty* calls. A big one was whether or not the other inheriting URIs were respected (e.g. about:srcdoc, blob://, ...).
I could have just left similar checks in the ATU:: versions, but I think this is the correct fix. I recall a thread a while back where you
told me most places we check for about:blank, we should also check for these other things too and I think this is one!

Additional context that may not be useful: this patch set eliminates the relaxed "privacy" definition of third-party and leaves the AntiTrackingUtils::IsThirdParty* functions as convenience functions that don't do any third-party checking themselves.

Depends on D203929

Storage Access API should auto-grant in ABA frames, but should not initially "haveStorageAccess".

This does that!

Depends on D205231

Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/dcd6bbea816a
part 1 - Make AntiTracking::IsThirdParty* aware of ABA case - r=anti-tracking-reviewers,cookie-reviewers,timhuang
https://hg.mozilla.org/integration/autoland/rev/15e06d10788e
part 2 - Make Workers use ancestor chain for third-partiness check - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/ac4c41cb3b67
part 3 - Fix tests relying on ABA being unpartitioned - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/4fa3fbf3a3ae
part 4 - Generalize inheriting principals in ThirdPartyUtil - r=nika
https://hg.mozilla.org/integration/autoland/rev/455ce831c73c
part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers

Looks like there was an upstream change on March 27 that caused a conflict. Rebasing, building, and trying again.

Flags: needinfo?(bvandersloot)
Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/bfa9862e3480
part 1 - Make AntiTracking::IsThirdParty* aware of ABA case - r=anti-tracking-reviewers,cookie-reviewers,timhuang
https://hg.mozilla.org/integration/autoland/rev/1ca7a0f27bc0
part 2 - Make Workers use ancestor chain for third-partiness check - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/1c49f0c3b677
part 3 - Fix tests relying on ABA being unpartitioned - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/49739f9ec590
part 4 - Generalize inheriting principals in ThirdPartyUtil - r=nika
https://hg.mozilla.org/integration/autoland/rev/8c7a9f405031
part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers

Backed out for causing multiple failure.




Flags: needinfo?(bvandersloot)

Looks like a few different issues I didn't catch on my try runs.

First is definitely my bad- I didn't re-do a try run of XPC tests after changing some code for review because I didn't think I changed it enough.

Second is a 1proc issue that was pretty subtle, but actually just means we needed to have a more lax assertion.

Third was a fun consequence of a change we made in part 4 on a deprecating API.

Fixing all of these, and resubmitting!

Thank you!

Flags: needinfo?(bvandersloot)
Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9ae9252761ac
part 1 - Make AntiTracking::IsThirdParty* aware of ABA case - r=anti-tracking-reviewers,cookie-reviewers,timhuang
https://hg.mozilla.org/integration/autoland/rev/5dcfe3aa8497
part 2 - Make Workers use ancestor chain for third-partiness check - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/d65ac05bd9f8
part 3 - Fix tests relying on ABA being unpartitioned - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/ca1c6f8819f7
part 4 - Generalize inheriting principals in ThirdPartyUtil - r=nika,extension-reviewers,zombie
https://hg.mozilla.org/integration/autoland/rev/f00e9fde550f
part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers

Backed out for causing multiple failures.

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | TestStoragePrincipalHelper.TestGetPrincipalCookieBehavior5 | Value of: testPrincipal->OriginAttributesRef().mPartitionKey.EqualsLiteral( "(https,example.org)")

Wpt failures on Android: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=testfailed%2Cbusted%2Cexception%2Cretry%2Cusercancel&revision=f00e9fde550f6ecbd0b8655d8ad34ee5f9a38770&searchStr=android%2Cwpt&selectedTaskRun=NRklJ9gCSs2amn5Lc0fN5g.0

+Linux wpt: https://treeherder.mozilla.org/logviewer?job_id=453205814&repo=autoland

Flags: needinfo?(bvandersloot)

Fixing both the gtest and the WPT. The WPTs are both unexpected passes, so that is good. The linked failure was a simple miss in my try run coverage.

This is a tough one to scope out what might be affected because it is a deep change to how we do storage partitioning (and a light change to srcdoc iframes) and those tests are scattered and not listed anywhere.

Flags: needinfo?(bvandersloot)
Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/fe34837410c4
part 1 - Make AntiTracking::IsThirdParty* aware of ABA case - r=anti-tracking-reviewers,cookie-reviewers,timhuang
https://hg.mozilla.org/integration/autoland/rev/4f8d611d76cf
part 2 - Make Workers use ancestor chain for third-partiness check - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/0b5a5480697d
part 3 - Fix tests relying on ABA being unpartitioned - r=anti-tracking-reviewers,timhuang,asuth
https://hg.mozilla.org/integration/autoland/rev/a3ef4c30dc52
part 4 - Generalize inheriting principals in ThirdPartyUtil - r=nika,extension-reviewers,zombie
https://hg.mozilla.org/integration/autoland/rev/e786976ead27
part 5 - Handle ABA in Storage Access API - r=timhuang,anti-tracking-reviewers
Regressions: 1892647
Regressions: 1897653
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: