Closed Bug 1661151 Opened 4 years ago Closed 3 years ago

The Storage Access API should automatically reject access for cookie policies that don't allow cross-site storage access

Categories

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

defect

Tracking

()

RESOLVED FIXED
Tracking Status
firefox95 --- fixed

People

(Reporter: englehardt, Assigned: bvandersloot)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

requestStorageAccess() should automatically reject when it's not possible for the embedded content to receive storage access (either due to the browser's cookie policy or the user's cookie permissions). This isn't currently the case, which means it's possible for an embedded frame to see that it can't access storage, call requestStorageAccess and have access "granted", check hasStorageAccess and see that it returns true, but not actually have storage access.

This happens under the following policies:

  • cookieBehavior 1: Block all third-party cookies when network.cookie.rejectForeignWithExceptions.enabled is set to false (currently the default outside of Nightly)
  • cookieBehavior 2: Block all cookies
  • cookieBehavior 3: Cookie from unvisited websites

You can use this test page: https://senglehardt.com/test/dfpi/storage_access_api.html.

Another condition in which the storage access API should automatically reject is when the origin requesting access is one that has been denied storage access via the about:preferences#privacy "Cookie Exceptions" UI.

Severity: -- → S3
Priority: -- → P1
Priority: P1 → P2

Add a test to validate behavior on non-tracking first-party requests
Add tests to ensure we don't say we are granting storage access to third parties with cookiePolicies that forbid it
Add check near the top of Document::HasStorageAccess to immediately return false when cookiePolicy is REJECT.
Add check near the top of Document::RequestStorageAccess to reject when cookiePolicy is REJECT.
Add check in Document::RequestStorageAccess to reject when the cookie policy forbids third party cookies
Note, BEHAVIOR_LIMIT_FOREIGN is treated like BEHAVIOR_REJECT_FOREIGN, just like in ContentBlocking::ShouldAllowAccessFor
Add comparable checks to the priveleged version of RequestStorageAccess

This also resolves Bug 1661152

Assignee: nobody → bvandersloot
Status: NEW → ASSIGNED

Add a test to validate behavior on non-tracking first-party requests
Add tests to ensure we don't say we are granting storage access to third parties with cookiePolicies that forbid it
Add check near the top of Document::HasStorageAccess to immediately return false when cookiePolicy is REJECT.
Add check near the top of Document::RequestStorageAccess to reject when cookiePolicy is REJECT.
Add check in Document::RequestStorageAccess to reject when the cookie policy forbids third party cookies
Note, BEHAVIOR_LIMIT_FOREIGN is treated like BEHAVIOR_REJECT_FOREIGN, just like in ContentBlocking::ShouldAllowAccessFor
Add comparable checks to the priveleged version of RequestStorageAccess

This also resolves Bug 1661152

Attachment #9246403 - Attachment is obsolete: true
Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/57d260450dce
The Storage Access API should automatically reject access for cookie policies that don't allow cross-site storage access r=anti-tracking-reviewers,timhuang

Backed out changeset 57d260450dce (Bug 1661151) for causing wpt failures in hasStorageAccess().
Backout link: https://hg.mozilla.org/integration/autoland/rev/9fa3431e1e5ded47cc269bf1427a96c940f1ddc0
Push with failures, failure log.
(Update): Also caused:

Flags: needinfo?(bvandersloot)
Pushed by bvandersloot@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/717eaf5939f3
The Storage Access API should automatically reject access for cookie policies that don't allow cross-site storage access r=anti-tracking-reviewers,timhuang
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Flags: needinfo?(bvandersloot)
Resolution: --- → FIXED
See Also: → 1661152
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: