Private Browsing: Difference between revisions

From MozillaWiki
Jump to navigation Jump to search
(Wordsmithing.)
(→‎FAQ: update PB add-on support)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
== Private Browsing ==
== Private Browsing ==
Private Browsing was initially designed as a way for the user to browse websites without having those websites show up in the information saved by Firefox to the persistent storage, and/or later be displayed in the Firefox UI.  A secondary incidental use case was discovered which allowed users to to log in to two instances of a website at the same time using different credentials.
We target Private Browsing to 3 privacy goals; in a Private Browsing session, Firefox:


The section below highlights the important aspects.
* Doesn’t save the browsing history or display it in the Firefox UI
* Prevents the session's data from writing to persistent storage
* Protects the session's data from online tracking


=== Local privacy ===
The first 2 goals focus on a local adversary - someone with direct access to Firefox. Private Browsing was initially designed with just these two goals in mind. The initial design concentrated on isolating Private Browsing mode from regular browsing mode.
Any data containing details such as the full or partial address of the pages visited by the user, or information saved on behalf of those sites either by the site or Firefox should not be written to the disk in a way that is exposed to the user either through the Firefox UI, or through the typical OS-provided mechanisms for viewing the information on the disk. This means writing this information to a custom file or a SQLite database in the user's profile is not permitted. However, the scope of Private Browsing does not include protecting against scenarios such as attacking the disk-based page file used by the OS, or forensic analysis.  This means that the OS is not prevented from caching the sensitive information in memory to the disk, and there is no protection against probes inspecting the process memory at runtime, as such topics are outside of the scope of this feature's intended threat model.


For UX reasons, in some specific cases we decided that we can interpret a user's action as a request to persist something specific about the website, and we therefore permit writing such information to the disk. For example, we take bookmarking as an explicit request from the user for the website to be remembered, so we save bookmarks from private windows. (Note, however, that we save it as an unvisited bookmark.)  As another example, we choose to allow saving permissions from private window in the page info dialog.
Research [[https://spreadprivacy.com/is-private-browsing-really-private/ 1]][[https://www.elie.net/blog/privacy/understanding-how-people-use-private-browsing 2]][[https://data.surveygizmo.com/r/28049_59b7e980008742.80492645 3]] shows that users expect Private Browsing to protect them from online adversaries - e.g., websites, trackers, data brokers etc.


=== Isolation ===
In 2015, we added [[Services/TrackingProtection|Tracking Protection]] to Firefox to help protect users from online adversaries. In 2018, we officially added the 3rd goal to Private Browsing design scope.
Two instances of the same website (one running in a normal window and the other in a private window) must be isolated from each other, and thus unable to exchange information via the browser.  This is the technical reason why we originally had to isolate the cookies for such instances, since a session cookie set by a private window could be picked up by a non-private instance of the same site and be persisted to the disk from there. The only way that we can ensure that information cannot leak from one such site to the other and find its way to the disk is to make them unable to communicate, and ensure that Gecko treats them as independent.


The additional use case of simultaneous logins is a byproduct of this design decision.
To achieve all these goals, we concentrate on: local privacy, session isolation, and site isolation. We highlight these aspects in the goal descriptions below.
(Note that a by-product of these protections allowed users to sign into a website with 2 accounts. A feature now better accomplished with the [https://addons.mozilla.org/firefox/addon/multi-account-containers/ Multi-Account Containers] add-on.)


=== Stealth ===
=== Firefox UI ===
The browser should make it difficult for a website to tell if it is in a private window.  Without this level of protection, the websites in the example in the above section could communicate with each other and leak information through their common server - the website in the private window can transmit the sensitive information, and the other instance could retrieve it at a later time.  Ideally, the server should have a difficult time determining if one of these instances is using private browsing mode.  There are also UX reasons why users may not want the websites that they are visiting in private mode to be aware of that fact.
We should not write any full or partial addresses or site data from Private Browsing page visits in a way that shows them in the local regular Firefox UI.


From a purely technical standpoint, there are a few weak spots in the platform that make it impossible to block this effectively. Also, over the years, it has become more difficult to fix everything in the platform according to this rule. At the present, this is probably a lost cause in practice.
In the Firefox UI, the user ends their private session with a website when they close ALL their private windows. So, when the user closes the last private browsing window, we clear our in-memory caches of data from the sites the user visited. There is some mismatch between the user's mental model of individual private windows and this implementation. (e.g., [https://bugzilla.mozilla.org/show_bug.cgi?id=1197159 Bug 1197159])


=== Session isolation ===
=== Persistent Storage ===
From a user's standpoint, their private session with a website is done when they close their private window. In order to support this, we clear our in-memory caches containing details about the sites that the user has visited when the last private window is closed. This mismatch between the user's mental model and the implementation is a technical limitation of the platform.
We should not write any full or partial addresses or site data from Private Browsing page visits in a way that shows them to '''local''' OS disk mechanisms. This means writing this information to a custom file or a SQLite database in the user's profile is not permitted.
 
'''We do not try to protect against all scenarios''' - e.g., attacking the disk-based page file used by the OS, or forensic analysis. We allow the OS to cache data from memory to disk, and we don't protect against runtime process memory probes.
 
We also treat some user actions as requests to persist website data, and write that data to the disk. For example, we save bookmarks from private windows. (Note: we save them as un-visited bookmarks.) We DO NOT save passwords entered into Private Browsing.
 
=== Online Tracking ===
We '''isolate''' a website running in a normal window from itself running in a private window. We make it unable to share data between the 2 modes via the browser. E.g., we isolate a website's private cookies from its regular cookies. (Note that a by-product of this protection allows users to sign into a website with 2 accounts - a feature now better accomplished with the [https://addons.mozilla.org/firefox/addon/multi-account-containers/ Multi-Account Containers] add-on.)
 
By default, we also block connections to 3rd-party trackers in private windows. [https://disconnect.me/ Disconnect.me] maintains the list of 3rd-party trackers. For more information, see the [[Services/TrackingProtection|Tracking Protection]] page.


== FAQ ==
== FAQ ==
* Is network level privacy a goal? Should private browsing use an anonymizing proxy?
* Is network level privacy a goal? Should private browsing use an anonymizing proxy?
** Experience suggests that users believe that private browsing implies some amount of network level privacy, but from a technical standpoint this is a challenging problem of its own so we have decided to not tackle it for now.  It may make sense to look into doing this in the future, but there are also reasons why it would be a bad idea.
** Research suggests users expect private browsing provides network level privacy. From a technical standpoint this is a challenging problem of its own, so we have not implemented it yet.
 
* Does this mean no network level privacy feature should ever be included?!
** No.  Again, we know that users expect it, so it would be valuable to try and meet expectations.


* What about add-ons?
* What about add-ons?
** At a technical level, because of the extensive access that add-ons have to our internal APIs, and because they are not sandboxed, there is nothing that we can do.  However, where appropriate, we have been trying to make it easier to use our APIs in a way that does the right thing by default in order to address some of the issue.  On the policy side, we have modified the [https://developer.mozilla.org/en-US/Add-ons/AMO/Policy/Reviews#Private_Browsing_Mode AMO add-on review guidelines] to require add-ons to adhere to our guidelines for supporting private browsing mode.
** By default, Firefox add-ons request "[https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/incognito spanning]" access to Private Browsing but users must explicitly grant access to private windows. There is [https://bugzilla.mozilla.org/show_bug.cgi?id=1380809 a bug] to support all "incognito" key values, including "not_allowed". For add-ons distributed on AMO, reviewers look for proper use and treatment of private browsing mode.


* Does my feature <i>have</i> to respect private browsing?
* Does my feature <i>have</i> to respect private browsing?
** Most likely yes, but if you think you can make a case against it that needs to be discussed.  Otherwise, it is appreciated if you consider private browsing when designing and implementing your features!
** Most likely yes - please consider private browsing when designing and implementing your features. If you think your feature does not, please discuss with [https://lists.mozilla.org/listinfo/dev-privacy dev-privacy].
 
* Can an online adversary detect private browsing mode?
** From a purely technical standpoint, there are a few weak spots in the platform that make it impossible to hide private browsing mode effectively. Also, over the years, it has become even more difficult to protect from new threats (e.g., fingerprinting) AND hiding the protections themselves.


== Other resources ==
== Other resources ==

Latest revision as of 00:49, 13 March 2020

Private Browsing

We target Private Browsing to 3 privacy goals; in a Private Browsing session, Firefox:

  • Doesn’t save the browsing history or display it in the Firefox UI
  • Prevents the session's data from writing to persistent storage
  • Protects the session's data from online tracking

The first 2 goals focus on a local adversary - someone with direct access to Firefox. Private Browsing was initially designed with just these two goals in mind. The initial design concentrated on isolating Private Browsing mode from regular browsing mode.

Research [1][2][3] shows that users expect Private Browsing to protect them from online adversaries - e.g., websites, trackers, data brokers etc.

In 2015, we added Tracking Protection to Firefox to help protect users from online adversaries. In 2018, we officially added the 3rd goal to Private Browsing design scope.

To achieve all these goals, we concentrate on: local privacy, session isolation, and site isolation. We highlight these aspects in the goal descriptions below. (Note that a by-product of these protections allowed users to sign into a website with 2 accounts. A feature now better accomplished with the Multi-Account Containers add-on.)

Firefox UI

We should not write any full or partial addresses or site data from Private Browsing page visits in a way that shows them in the local regular Firefox UI.

In the Firefox UI, the user ends their private session with a website when they close ALL their private windows. So, when the user closes the last private browsing window, we clear our in-memory caches of data from the sites the user visited. There is some mismatch between the user's mental model of individual private windows and this implementation. (e.g., Bug 1197159)

Persistent Storage

We should not write any full or partial addresses or site data from Private Browsing page visits in a way that shows them to local OS disk mechanisms. This means writing this information to a custom file or a SQLite database in the user's profile is not permitted.

We do not try to protect against all scenarios - e.g., attacking the disk-based page file used by the OS, or forensic analysis. We allow the OS to cache data from memory to disk, and we don't protect against runtime process memory probes.

We also treat some user actions as requests to persist website data, and write that data to the disk. For example, we save bookmarks from private windows. (Note: we save them as un-visited bookmarks.) We DO NOT save passwords entered into Private Browsing.

Online Tracking

We isolate a website running in a normal window from itself running in a private window. We make it unable to share data between the 2 modes via the browser. E.g., we isolate a website's private cookies from its regular cookies. (Note that a by-product of this protection allows users to sign into a website with 2 accounts - a feature now better accomplished with the Multi-Account Containers add-on.)

By default, we also block connections to 3rd-party trackers in private windows. Disconnect.me maintains the list of 3rd-party trackers. For more information, see the Tracking Protection page.

FAQ

  • Is network level privacy a goal? Should private browsing use an anonymizing proxy?
    • Research suggests users expect private browsing provides network level privacy. From a technical standpoint this is a challenging problem of its own, so we have not implemented it yet.
  • What about add-ons?
    • By default, Firefox add-ons request "spanning" access to Private Browsing but users must explicitly grant access to private windows. There is a bug to support all "incognito" key values, including "not_allowed". For add-ons distributed on AMO, reviewers look for proper use and treatment of private browsing mode.
  • Does my feature have to respect private browsing?
    • Most likely yes - please consider private browsing when designing and implementing your features. If you think your feature does not, please discuss with dev-privacy.
  • Can an online adversary detect private browsing mode?
    • From a purely technical standpoint, there are a few weak spots in the platform that make it impossible to hide private browsing mode effectively. Also, over the years, it has become even more difficult to protect from new threats (e.g., fingerprinting) AND hiding the protections themselves.

Other resources