Security/Cookies
From MozillaWiki
< Security
Existing functionality
- network.cookie.cookieBehavior
- values
- 0 = always accept third-party cookies
- 1 = never accept third-party cookies
- 2 = don't accept any cookies at all
- 3 = only accept third-party cookies from visited sites
- exposed in about:preferences but hard to find: Privacy | History | "Use custom settings for history"
- option 3 was implemented in https://bugzilla.mozilla.org/show_bug.cgi?id=818340
- the default was reverted back to 0 in https://bugzilla.mozilla.org/show_bug.cgi?id=851606
- discussion to make the default 3 again happened in https://bugzilla.mozilla.org/show_bug.cgi?id=999170 but stalled
- values
- network.cookie.lifetimePolicy
- values
- 0 = accept for the duration set by the site
- 1 = no longer used (https://bugzilla.mozilla.org/show_bug.cgi?id=606655)
- 2 = accept for this session only
- 3 = accept for N days (see network.cookie.lifetime.days)
- partially exposed: option 3 is not available
- values
- network.cookie.lifetime.days
- network.cookie.thirdparty.sessionOnly
- for those third-party cookies we accept, only accept them for this session
- https://bugzilla.mozilla.org/show_bug.cgi?id=565475
- https://dxr.mozilla.org/mozilla-central/rev/85cf2e720a8405c43eabc9b34cce381b66d25ef9/netwerk/cookie/nsCookieService.cpp#3794-3816
- not exposed anywhere
- network.cookie.thirdparty.nonsecureSessionOnly
- for those third-party cookies set over HTTP, only accept them for this session
- https://bugzilla.mozilla.org/show_bug.cgi?id=1160368
- per-site third-party cookie blocking
- https://wiki.mozilla.org/Privacy/Features/Per-Site_Third-Party_Cookie_Setting
- supported internally (cookie DB): https://bugzilla.mozilla.org/show_bug.cgi?id=770691
- UI for toggling it on/off: https://bugzilla.mozilla.org/show_bug.cgi?id=770705 (now removed)
Further work
- Blocking insecure third-party cookies
- we should first add telemetry to see how common that is
- Double-keying
- Purging expired cookies
- Expiring third-party cookies earlier
- (v. network.cookie.thirdparty.sessionOnly)
- https://bugzilla.mozilla.org/show_bug.cgi?id=844623
Specifications
- RFC6265bis: https://datatracker.ietf.org/doc/draft-ietf-httpbis-rfc6265bis/
- Cookie prefixes: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-prefixes-00
-
Cookie control in CSP: https://w3c.github.io/webappsec-csp/cookies/(abandoned) - Same-site cookies: https://tools.ietf.org/html/draft-ietf-httpbis-cookie-same-site-00
-
First party cookies: https://tools.ietf.org/html/draft-west-first-party-cookies-02(superseded) -
Same-domain cookies: https://github.com/mozmark/SameDomain-cookies/blob/master/samedomain.txt(superseded)
-
- Restrict secure cookies to HTTPS: https://datatracker.ietf.org/doc/draft-ietf-httpbis-cookie-alone/
- [vaguely related] Clear site data: https://mikewest.github.io/webappsec/specs/clear-site-data/
- IE cookie "leashing": https://web.archive.org/web/20150101193222/https://msdn.microsoft.com/en-us/library/ms537343(v=vs.85).aspx
- There is apparently support for this in Firefox: https://github.com/mozilla/persona/issues/4152#issuecomment-46283659
Work in progress
- Changes coming to Chrome: https://groups.google.com/a/chromium.org/forum/#!topic/security-dev/2PK3q_VE1rg/discussion
-
cookie-prefixes:
- expression of interest: https://groups.google.com/d/msg/mozilla.dev.platform/yEqC74IgnqQ/wIVQh4W2EAkJ
-
same-site cookies: https://bugzilla.mozilla.org/show_bug.cgi?id=795346 - third-party cookie blocking:
Research
- https://www.usenix.org/system/files/conference/usenixsecurity15/sec15-paper-zheng.pdf
- http://www.pewresearch.org/fact-tank/2016/01/20/the-state-of-privacy-in-america/ft_16-01-20_privacy_youngadults/ (a surprisingly large % of users clear their cookies)
- https://monica-at-mozilla.blogspot.ca/2013/10/cookie-counting.html