Clear-Site-Data header with "cookies" doesn't handle domains correctly
Categories
(Toolkit :: Data Sanitization, defect, P3)
Tracking
()
People
(Reporter: mozilla, Unassigned)
References
(Blocks 1 open bug)
Details
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:106.0) Gecko/20100101 Firefox/106.0
Steps to reproduce:
- Go to https://www.fastmail.com . Log in to an account if you have one.
- Either way, using an extension like Cookie Quick Manager (https://addons.mozilla.org/en-US/firefox/addon/cookie-quick-manager/) observe that several cookies were set in .fastmail.com, and if you logged in, api.fastmail.com
- Go to https://app.fastmail.com/clear-data/
- Open web developer tools Network tab
- Click the "Clear all site data" button
- Observe that the request returned the header:
clear-site-data: "cache", "cookies", "storage", "executionContexts", "*"
- Refresh the list of cookies in the Cookie Quick Manager tab
- Observe that none of the fastmail.com cookies were removed
Actual results:
It appears a "Clear-Site-Data" header with a "cookies" option only clears cookies for the exact matching origin, not even sub-domains, rather than all cookies for the registered domain and all sub-domains of the registered domain as specified by the spec.
Expected results:
As per the spec, all cookies for the "registered domain" and all sub-domains should be cleared.
https://w3c.github.io/webappsec-clear-site-data/#abstract-opdef-clear-cookies-for-origin
- Let registered be the registered domain of origin’s host.
- Let cookie list be the set of cookies from the cookie store whose domain attribute is a domain-match with registered.
- For each cookie in cookie list:
- Remove cookie from the cookie store.
Comment 1•3 years ago
|
||
The Bugbug bot thinks this bug should belong to the 'Core::Networking' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.
Comment 3•3 years ago
|
||
We do indeed clear cookies and storage by exact origin, by principal here: https://searchfox.org/mozilla-central/rev/aa329cf7506ddd966542e642ec00223fd7461599/toolkit/components/clearsitedata/ClearSiteData.cpp#215
We even take into account the partitionKey that means sites can't clear data across dFPI partitions.
The CookieCleaner is called here, note how it clears for exact host + OriginAttributes: https://searchfox.org/mozilla-central/rev/aa329cf7506ddd966542e642ec00223fd7461599/toolkit/components/cleardata/ClearDataService.jsm#123,135
That means for "cookies" we seem to deviate from the spec and we should clear by base domain (+OA?) instead. Looking at the spec, the rest of the storage (including cache) should be cleared by origin.
Updated•3 years ago
|
Description
•