add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1) <?xml version="1.0" encoding="UTF-8"?>
2) <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
3) <html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Torbutton Design Documentation</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /></head><body><div class="article" title="Torbutton Design Documentation"><div class="titlepage"><div><div><h2 class="title"><a id="design"></a>Torbutton Design Documentation</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Mike</span> <span class="surname">Perry</span></h3><div class="affiliation"><div class="address"><p><code class="email"><<a class="email" href="mailto:mikeperry.fscked/org">mikeperry.fscked/org</a>></code></p></div></div></div></div><div><p class="pubdate">Apr 3 2011</p></div></div><hr /></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="#id2632653">1. Introduction</a></span></dt><dd><dl><dt><span class="sect2"><a href="#adversary">1.1. Adversary Model</a></span></dt><dt><span class="sect2"><a href="#requirements">1.2. Torbutton Requirements</a></span></dt><dt><span class="sect2"><a href="#layout">1.3. Extension Layout</a></span></dt></dl></dd><dt><span class="sect1"><a href="#components">2. Components</a></span></dt><dd><dl><dt><span class="sect2"><a href="#hookedxpcom">2.1. Hooked Components</a></span></dt><dt><span class="sect2"><a href="#id2657921">2.2. New Components</a></span></dt></dl></dd><dt><span class="sect1"><a href="#id2636893">3. Chrome</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2658833">3.1. XUL Windows and Overlays</a></span></dt><dt><span class="sect2"><a href="#id2655137">3.2. Major Chrome Observers</a></span></dt></dl></dd><dt><span class="sect1"><a href="#id2657565">4. Toggle Code Path</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2653926">4.1. Button Click</a></span></dt><dt><span class="sect2"><a href="#id2652911">4.2. Proxy Update</a></span></dt><dt><span class="sect2"><a href="#id2647095">4.3. Settings Update</a></span></dt><dt><span class="sect2"><a href="#preferences">4.4. Firefox preferences touched during Toggle</a></span></dt></dl></dd><dt><span class="sect1"><a href="#id2659431">5. Description of Options</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2661813">5.1. Proxy Settings</a></span></dt><dt><span class="sect2"><a href="#id2660939">5.2. Dynamic Content Settings</a></span></dt><dt><span class="sect2"><a href="#id2670963">5.3. History and Forms Settings</a></span></dt><dt><span class="sect2"><a href="#id2671276">5.4. Cache Settings</a></span></dt><dt><span class="sect2"><a href="#id2671385">5.5. Cookie and Auth Settings</a></span></dt><dt><span class="sect2"><a href="#id2671698">5.6. Startup Settings</a></span></dt><dt><span class="sect2"><a href="#id2671812">5.7. Shutdown Settings</a></span></dt><dt><span class="sect2"><a href="#id2671872">5.8. Header Settings</a></span></dt></dl></dd><dt><span class="sect1"><a href="#FirefoxBugs">6. Relevant Firefox Bugs</a></span></dt><dd><dl><dt><span class="sect2"><a href="#FirefoxSecurity">6.1. Bugs impacting security</a></span></dt><dt><span class="sect2"><a href="#FirefoxWishlist">6.2. Bugs blocking functionality</a></span></dt><dt><span class="sect2"><a href="#FirefoxMiscBugs">6.3. Low Priority Bugs</a></span></dt></dl></dd><dt><span class="sect1"><a href="#TestPlan">7. Testing</a></span></dt><dd><dl><dt><span class="sect2"><a href="#SingleStateTesting">7.1. Single state testing</a></span></dt><dt><span class="sect2"><a href="#id2673409">7.2. Multi-state testing</a></span></dt><dt><span class="sect2"><a href="#HackTorbutton">7.3. Active testing (aka How to Hack Torbutton)</a></span></dt></dl></dd></dl></div><div class="sect1" title="1. Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2632653"></a>1. Introduction</h2></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
4)
5) This document describes the goals, operation, and testing procedures of the
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
6) Torbutton Firefox extension. It is current as of Torbutton 1.3.2.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
7)
8) </p><div class="sect2" title="1.1. Adversary Model"><div class="titlepage"><div><div><h3 class="title"><a id="adversary"></a>1.1. Adversary Model</h3></div></div></div><p>
9)
10) A Tor web browser adversary has a number of goals, capabilities, and attack
11) types that can be used to guide us towards a set of requirements for the
12) Torbutton extension. Let's start with the goals.
13)
14) </p><div class="sect3" title="Adversary Goals"><div class="titlepage"><div><div><h4 class="title"><a id="adversarygoals"></a>Adversary Goals</h4></div></div></div><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><span class="command"><strong>Bypassing proxy settings</strong></span><p>The adversary's primary goal is direct compromise and bypass of
15) Tor, causing the user to directly connect to an IP of the adversary's
16) choosing.</p></li><li class="listitem"><span class="command"><strong>Correlation of Tor vs Non-Tor Activity</strong></span><p>If direct proxy bypass is not possible, the adversary will likely
17) happily settle for the ability to correlate something a user did via Tor with
18) their non-Tor activity. This can be done with cookies, cache identifiers,
19) javascript events, and even CSS. Sometimes the fact that a user uses Tor may
20) be enough for some authorities.</p></li><li class="listitem"><span class="command"><strong>History disclosure</strong></span><p>
21) The adversary may also be interested in history disclosure: the ability to
22) query a user's history to see if they have issued certain censored search
23) queries, or visited censored sites.
24) </p></li><li class="listitem"><span class="command"><strong>Location information</strong></span><p>
25)
26) Location information such as timezone and locality can be useful for the
27) adversary to determine if a user is in fact originating from one of the
28) regions they are attempting to control, or to zero-in on the geographical
29) location of a particular dissident or whistleblower.
30)
31) </p></li><li class="listitem"><span class="command"><strong>Miscellaneous anonymity set reduction</strong></span><p>
32)
33) Anonymity set reduction is also useful in attempting to zero in on a
34) particular individual. If the dissident or whistleblower is using a rare build
35) of Firefox for an obscure operating system, this can be very useful
36) information for tracking them down, or at least <a class="link" href="#fingerprinting">tracking their activities</a>.
37)
38) </p></li><li class="listitem"><span class="command"><strong>History records and other on-disk
39) information</strong></span><p>
40) In some cases, the adversary may opt for a heavy-handed approach, such as
41) seizing the computers of all Tor users in an area (especially after narrowing
42) the field by the above two pieces of information). History records and cache
43) data are the primary goals here.
44) </p></li></ol></div></div><div class="sect3" title="Adversary Capabilities - Positioning"><div class="titlepage"><div><div><h4 class="title"><a id="adversarypositioning"></a>Adversary Capabilities - Positioning</h4></div></div></div><p>
45) The adversary can position themselves at a number of different locations in
46) order to execute their attacks.
47) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><span class="command"><strong>Exit Node or Upstream Router</strong></span><p>
48) The adversary can run exit nodes, or alternatively, they may control routers
49) upstream of exit nodes. Both of these scenarios have been observed in the
50) wild.
51) </p></li><li class="listitem"><span class="command"><strong>Adservers and/or Malicious Websites</strong></span><p>
52) The adversary can also run websites, or more likely, they can contract out
53) ad space from a number of different adservers and inject content that way. For
54) some users, the adversary may be the adservers themselves. It is not
55) inconceivable that adservers may try to subvert or reduce a user's anonymity
56) through Tor for marketing purposes.
57) </p></li><li class="listitem"><span class="command"><strong>Local Network/ISP/Upstream Router</strong></span><p>
58) The adversary can also inject malicious content at the user's upstream router
59) when they have Tor disabled, in an attempt to correlate their Tor and Non-Tor
60) activity.
61) </p></li><li class="listitem"><span class="command"><strong>Physical Access</strong></span><p>
62) Some users face adversaries with intermittent or constant physical access.
63) Users in Internet cafes, for example, face such a threat. In addition, in
64) countries where simply using tools like Tor is illegal, users may face
65) confiscation of their computer equipment for excessive Tor usage or just
66) general suspicion.
67) </p></li></ol></div></div><div class="sect3" title="Adversary Capabilities - Attacks"><div class="titlepage"><div><div><h4 class="title"><a id="attacks"></a>Adversary Capabilities - Attacks</h4></div></div></div><p>
68)
69) The adversary can perform the following attacks from a number of different
70) positions to accomplish various aspects of their goals. It should be noted
71) that many of these attacks (especially those involving IP address leakage) are
72) often performed by accident by websites that simply have Javascript, dynamic
73) CSS elements, and plugins. Others are performed by adservers seeking to
74) correlate users' activity across different IP addresses, and still others are
75) performed by malicious agents on the Tor network and at national firewalls.
76)
77) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><span class="command"><strong>Inserting Javascript</strong></span><p>
78) If not properly disabled, Javascript event handlers and timers
79) can cause the browser to perform network activity after Tor has been disabled,
80) thus allowing the adversary to correlate Tor and Non-Tor activity and reveal
81) a user's non-Tor IP address. Javascript
82) also allows the adversary to execute <a class="ulink" href="http://whattheinternetknowsaboutyou.com/" target="_top">history disclosure attacks</a>:
83) to query the history via the different attributes of 'visited' links to search
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
84) for particular Google queries, sites, or even to <a class="ulink" href="http://www.mikeonads.com/2008/07/13/using-your-browser-url-history-estimate-gender/" target="_top">profile
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
85) users based on gender and other classifications</a>. Finally,
86) Javascript can be used to query the user's timezone via the
87) <code class="function">Date()</code> object, and to reduce the anonymity set by querying
88) the <code class="function">navigator</code> object for operating system, CPU, locale,
89) and user agent information.
90) </p></li><li class="listitem"><span class="command"><strong>Inserting Plugins</strong></span><p>
91)
92) Plugins are abysmal at obeying the proxy settings of the browser. Every plugin
93) capable of performing network activity that the author has
94) investigated is also capable of performing network activity independent of
95) browser proxy settings - and often independent of its own proxy settings.
96) Sites that have plugin content don't even have to be malicious to obtain a
97) user's
98) Non-Tor IP (it usually leaks by itself), though <a class="ulink" href="http://decloak.net" target="_top">plenty of active
99) exploits</a> are possible as well. In addition, plugins can be used to store unique identifiers that are more
100) difficult to clear than standard cookies.
101) <a class="ulink" href="http://epic.org/privacy/cookies/flash.html" target="_top">Flash-based
102) cookies</a> fall into this category, but there are likely numerous other
103) examples.
104)
105) </p></li><li class="listitem"><span class="command"><strong>Inserting CSS</strong></span><p>
106)
107) CSS can also be used to correlate Tor and Non-Tor activity and reveal a user's
108) Non-Tor IP address, via the usage of
109) <a class="ulink" href="http://www.tjkdesign.com/articles/css%20pop%20ups/" target="_top">CSS
110) popups</a> - essentially CSS-based event handlers that fetch content via
111) CSS's onmouseover attribute. If these popups are allowed to perform network
112) activity in a different Tor state than they were loaded in, they can easily
113) correlate Tor and Non-Tor activity and reveal a user's IP address. In
114) addition, CSS can also be used without Javascript to perform <a class="ulink" href="http://ha.ckers.org/weird/CSS-history.cgi" target="_top">CSS-only history disclosure
115) attacks</a>.
116) </p></li><li class="listitem"><span class="command"><strong>Read and insert cookies</strong></span><p>
117)
118) An adversary in a position to perform MITM content alteration can inject
119) document content elements to both read and inject cookies for
120) arbitrary domains. In fact, many "SSL secured" websites are vulnerable to this
121) sort of <a class="ulink" href="http://seclists.org/bugtraq/2007/Aug/0070.html" target="_top">active
122) sidejacking</a>.
123)
124) </p></li><li class="listitem"><span class="command"><strong>Create arbitrary cached content</strong></span><p>
125)
126) Likewise, the browser cache can also be used to <a class="ulink" href="http://crypto.stanford.edu/sameorigin/safecachetest.html" target="_top">store unique
127) identifiers</a>. Since by default the cache has no same-origin policy,
128) these identifiers can be read by any domain, making them an ideal target for
129) adserver-class adversaries.
130)
131) </p></li><li class="listitem"><a id="fingerprinting"></a><span class="command"><strong>Fingerprint users based on browser
132) attributes</strong></span><p>
133)
134) There is an absurd amount of information available to websites via attributes
135) of the browser. This information can be used to reduce anonymity set, or even
136) <a class="ulink" href="http://mandark.fr/0x000000/articles/Total_Recall_On_Firefox..html" target="_top">uniquely
137) fingerprint individual users</a>. </p><p>
138) For illustration, let's perform a
139) back-of-the-envelope calculation on the number of anonymity sets for just the
140) resolution information available in the <a class="ulink" href="http://developer.mozilla.org/en/docs/DOM:window" target="_top">window</a> and
141) <a class="ulink" href="http://developer.mozilla.org/en/docs/DOM:window.screen" target="_top">window.screen</a>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
142) objects.
143)
144)
145)
146) Browser window resolution information provides something like
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
147) (1280-640)*(1024-480)=348160 different anonymity sets. Desktop resolution
148) information contributes about another factor of 5 (for about 5 resolutions in
149) typical use). In addition, the dimensions and position of the desktop taskbar
150) are available, which can reveal hints on OS information. This boosts the count
151) by a factor of 5 (for each of the major desktop taskbars - Windows, OSX, KDE
152) and Gnome, and None). Subtracting the browser content window
153) size from the browser outer window size provide yet more information.
154) Firefox toolbar presence gives about a factor of 8 (3 toolbars on/off give
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
155) 2<sup>3</sup>=8). Interface effects such as title bar font size
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
156) and window manager settings gives a factor of about 9 (say 3 common font sizes
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
157) for the title bar and 3 common sizes for browser GUI element fonts).
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
158) Multiply this all out, and you have (1280-640)*(1024-480)*5*5*8*9 ~=
159) 2<sup>29</sup>, or a 29 bit identifier based on resolution
160) information alone. </p><p>
161)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
162) Of course, this space is non-uniform in user density and prone to incremental
163) changes. The <a class="ulink" href="https://wiki.mozilla.org/Fingerprinting#Data" target="_top">Panopticlick study
164) done</a> by the EFF attempts to measure the actual entropy - the number of
165) identifying bits of information encoded in browser properties. Their result
166) data is definitely useful, and the metric is probably the appropriate one for
167) determining how identifying a particular browser property is. However, some
168) quirks of their study means that they do not extract as much information as
169) they could from display information: they only use desktop resolution (which
170) Torbutton reports as the window resolution) and do not attempt to infer the
171) size of toolbars.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
172)
173) </p></li><li class="listitem"><span class="command"><strong>Remotely or locally exploit browser and/or
174) OS</strong></span><p>
175) Last, but definitely not least, the adversary can exploit either general
176) browser vulnerabilities, plugin vulnerabilities, or OS vulnerabilities to
177) install malware and surveillance software. An adversary with physical access
178) can perform similar actions. Regrettably, this last attack capability is
179) outside of Torbutton's ability to defend against, but it is worth mentioning
180) for completeness.
181) </p></li></ol></div></div></div><div class="sect2" title="1.2. Torbutton Requirements"><div class="titlepage"><div><div><h3 class="title"><a id="requirements"></a>1.2. Torbutton Requirements</h3></div></div></div><div class="note" title="Note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3>
182)
183) Since many settings satisfy multiple requirements, this design document is
184) organized primarily by Torbutton components and settings. However, if you are
185) the type that would rather read the document from the requirements
186) perspective, it is in fact possible to search for each of the following
187) requirement phrases in the text to find the relevant features that help meet
188) that requirement.
189)
190) </div><p>
191)
192) From the above Adversary Model, a number of requirements become clear.
193)
194) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a id="proxy"></a><span class="command"><strong>Proxy Obedience</strong></span><p>The browser
195) MUST NOT bypass Tor proxy settings for any content.</p></li><li class="listitem"><a id="isolation"></a><span class="command"><strong>Network Isolation</strong></span><p>Pages MUST NOT perform any network activity in a Tor state different
196) from the state they were originally loaded in.</p></li><li class="listitem"><a id="state"></a><span class="command"><strong>State Separation</strong></span><p>Browser state (cookies, cache, history, 'DOM storage'), accumulated in
197) one Tor state MUST NOT be accessible via the network in
198) another Tor state.</p></li><li class="listitem"><a id="undiscoverability"></a><span class="command"><strong>Tor Undiscoverability</strong></span><p>With
199) the advent of bridge support in Tor 0.2.0.x, there are now a class of Tor
200) users whose network fingerprint does not obviously betray the fact that they
201) are using Tor. This should extend to the browser as well - Torbutton MUST NOT
202) reveal its presence while Tor is disabled.</p></li><li class="listitem"><a id="disk"></a><span class="command"><strong>Disk Avoidance</strong></span><p>The browser SHOULD NOT write any Tor-related state to disk, or store it
203) in memory beyond the duration of one Tor toggle.</p></li><li class="listitem"><a id="location"></a><span class="command"><strong>Location Neutrality</strong></span><p>The browser SHOULD NOT leak location-specific information, such as
204) timezone or locale via Tor.</p></li><li class="listitem"><a id="setpreservation"></a><span class="command"><strong>Anonymity Set
205) Preservation</strong></span><p>The browser SHOULD NOT leak any other anonymity set reducing information
206) (such as user agent, extension presence, and resolution information)
207) automatically via Tor. The assessment of the attacks above should make it clear
208) that anonymity set reduction is a very powerful method of tracking and
209) eventually identifying anonymous users.
210) </p></li><li class="listitem"><a id="updates"></a><span class="command"><strong>Update Safety</strong></span><p>The browser
211) SHOULD NOT perform unauthenticated updates or upgrades via Tor.</p></li><li class="listitem"><a id="interoperate"></a><span class="command"><strong>Interoperability</strong></span><p>Torbutton SHOULD interoperate with third-party proxy switchers that
212) enable the user to switch between a number of different proxies. It MUST
213) provide full Tor protection in the event a third-party proxy switcher has
214) enabled the Tor proxy settings.</p></li></ol></div></div><div class="sect2" title="1.3. Extension Layout"><div class="titlepage"><div><div><h3 class="title"><a id="layout"></a>1.3. Extension Layout</h3></div></div></div><p>Firefox extensions consist of two main categories of code: 'Components' and
215) 'Chrome'. Components are a fancy name for classes that implement a given
216) interface or interfaces. In Firefox, components <a class="ulink" href="https://developer.mozilla.org/en/XPCOM" target="_top">can be
217) written</a> in C++,
218) Javascript, or a mixture of both. Components have two identifiers: their
219) '<a class="ulink" href="http://www.mozilla.org/projects/xpcom/book/cxc/html/quicktour2.html#1005005" target="_top">Contract
220) ID</a>' (a human readable path-like string), and their '<a class="ulink" href="http://www.mozilla.org/projects/xpcom/book/cxc/html/quicktour2.html#1005329" target="_top">Class
221) ID</a>' (a GUID hex-string). In addition, the interfaces they implement each have a hex
222) 'Interface ID'. It is possible to 'hook' system components - to reimplement
223) their interface members with your own wrappers - but only if the rest of the
224) browser refers to the component by its Contract ID. If the browser refers to
225) the component by Class ID, it bypasses your hooks in that use case.
226) Technically, it may be possible to hook Class IDs by unregistering the
227) original component, and then re-registering your own, but this relies on
228) obsolete and deprecated interfaces and has proved to be less than
229) stable.</p><p>'Chrome' is a combination of XML and Javascript used to describe a window.
230) Extensions are allowed to create 'overlays' that are 'bound' to existing XML
231) window definitions, or they can create their own windows. The DTD for this XML
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
232) is called <a class="ulink" href="http://developer.mozilla.org/en/docs/XUL_Reference" target="_top">XUL</a>.</p></div></div><div class="sect1" title="2. Components"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="components"></a>2. Components</h2></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
233)
234) Torbutton installs components for two purposes: hooking existing components to
235) reimplement their interfaces; and creating new components that provide
236) services to other pieces of the extension.
237)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
238) </p><div class="sect2" title="2.1. Hooked Components"><div class="titlepage"><div><div><h3 class="title"><a id="hookedxpcom"></a>2.1. Hooked Components</h3></div></div></div><p>Torbutton makes extensive use of Contract ID hooking, and implements some
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
239) of its own standalone components as well. Let's discuss the hooked components
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
240) first.</p><div class="sect3" title="@mozilla.org/uriloader/external-protocol-service;1 , @mozilla.org/uriloader/external-helper-app-service;1, and @mozilla.org/mime;1 - components/external-app-blocker.js"><div class="titlepage"><div><div><h4 class="title"><a id="appblocker"></a><a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/uriloader/external-protocol-service%3B1" target="_top">@mozilla.org/uriloader/external-protocol-service;1
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
241) </a>, <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/uriloader/external-helper-app-service%3B1" target="_top">@mozilla.org/uriloader/external-helper-app-service;1</a>,
242) and <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/mime%3B1" target="_top">@mozilla.org/mime;1</a>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
243) - <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/external-app-blocker.js" target="_top">components/external-app-blocker.js</a></h4></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
244) Due to <a class="link" href="#FirefoxBugs" title="6. Relevant Firefox Bugs">Firefox Bug</a> <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=440892" target="_top">440892</a> allowing Firefox 3.x to automatically launch some
245) applications without user intervention, Torbutton had to wrap the three
246) components involved in launching external applications to provide user
247) confirmation before doing so while Tor is enabled. Since external applications
248) do not obey proxy settings, they can be manipulated to automatically connect
249) back to arbitrary servers outside of Tor with no user intervention. Fixing
250) this issue helps to satisfy Torbutton's <a class="link" href="#proxy">Proxy
251) Obedience</a> Requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
252) </p></div><div class="sect3" title="@mozilla.org/browser/global-history;2 - components/ignore-history.js"><div class="titlepage"><div><div><h4 class="title"><a id="id2644921"></a><a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/global-history;2" target="_top">@mozilla.org/browser/global-history;2</a>
253) - <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/ignore-history.js" target="_top">components/ignore-history.js</a></h4></div></div></div><p>This component was contributed by <a class="ulink" href="http://www.collinjackson.com/" target="_top">Collin Jackson</a> as a method for defeating
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
254) CSS and Javascript-based methods of history disclosure. The global-history
255) component is what is used by Firefox to determine if a link was visited or not
256) (to apply the appropriate style to the link). By hooking the <a class="ulink" href="https://developer.mozilla.org/en/nsIGlobalHistory2#isVisited.28.29" target="_top">isVisited</a>
257) and <a class="ulink" href="https://developer.mozilla.org/en/nsIGlobalHistory2#addURI.28.29" target="_top">addURI</a>
258) methods, Torbutton is able to selectively prevent history items from being
259) added or being displayed as visited, depending on the Tor state and the user's
260) preferences.
261) </p><p>
262) This component helps satisfy the <a class="link" href="#state">State Separation</a>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
263) and <a class="link" href="#disk">Disk Avoidance</a> requirements of Torbutton. It
264) is only needed for Firefox 3.x. On Firefox 4, we omit this component in favor
265) of the <a class="ulink" href="https://developer.mozilla.org/en/CSS/Privacy_and_the_%3avisited_selector" target="_top">built-in
266) history protections</a>.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
267) </p></div><div class="sect3" title="@mozilla.org/browser/livemark-service;2 - components/block-livemarks.js"><div class="titlepage"><div><div><h4 class="title"><a id="livemarks"></a><a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/livemark-service;2" target="_top">@mozilla.org/browser/livemark-service;2</a>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
268) - <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/block-livemarks.js" target="_top">components/block-livemarks.js</a></h4></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
269)
270) The <a class="ulink" href="http://www.mozilla.com/en-US/firefox/livebookmarks.html" target="_top">livemark</a> service
271) is started by a timer that runs 5 seconds after Firefox
272) startup. As a result, we cannot simply call the stopUpdateLivemarks() method to
273) disable it. We must wrap the component to prevent this start() call from
274) firing in the event the browser starts in Tor mode.
275)
276) </p><p>
277) This component helps satisfy the <a class="link" href="#isolation">Network
278) Isolation</a> and <a class="link" href="#setpreservation">Anonymity Set
279) Preservation</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
280) </p></div></div><div class="sect2" title="2.2. New Components"><div class="titlepage"><div><div><h3 class="title"><a id="id2657921"></a>2.2. New Components</h3></div></div></div><p>Torbutton creates four new components that are used throughout the
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
281) extension. These components do not hook any interfaces, nor are they used
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
282) anywhere besides Torbutton itself.</p><div class="sect3" title="@torproject.org/cookie-jar-selector;2 - components/cookie-jar-selector.js"><div class="titlepage"><div><div><h4 class="title"><a id="cookiejar"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js" target="_top">@torproject.org/cookie-jar-selector;2
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
283) - components/cookie-jar-selector.js</a></h4></div></div></div><p>The cookie jar selector (also based on code from <a class="ulink" href="http://www.collinjackson.com/" target="_top">Collin
284) Jackson</a>) is used by the Torbutton chrome to switch between
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
285) Tor and Non-Tor cookies. It stores an XML representation of the current
286) cookie state in memory and/or on disk. When Tor is toggled, it syncs the
287) current cookies to this XML store, and then loads the cookies for the other
288) state from the XML store.
289) </p><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
290) This component helps to address the <a class="link" href="#state">State
291) Isolation</a> requirement of Torbutton.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
292) </p></div><div class="sect3" title="@torproject.org/torbutton-logger;1 - components/torbutton-logger.js"><div class="titlepage"><div><div><h4 class="title"><a id="id2670270"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/torbutton-logger.js" target="_top">@torproject.org/torbutton-logger;1
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
293) - components/torbutton-logger.js</a></h4></div></div></div><p>The torbutton logger component allows on-the-fly redirection of torbutton
294) logging messages to either Firefox stderr
295) (<span class="command"><strong>extensions.torbutton.logmethod=0</strong></span>), the Javascript error console
296) (<span class="command"><strong>extensions.torbutton.logmethod=1</strong></span>), or the DebugLogger extension (if
297) available - <span class="command"><strong>extensions.torbutton.logmethod=2</strong></span>). It also allows you to
298) change the loglevel on the fly by changing
299) <span class="command"><strong>extensions.torbutton.loglevel</strong></span> (1-5, 1 is most verbose).
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
300) </p></div><div class="sect3" title="@torproject.org/content-window-mapper;1 - components/window-mapper.js"><div class="titlepage"><div><div><h4 class="title"><a id="windowmapper"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/window-mapper.js" target="_top">@torproject.org/content-window-mapper;1
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
301) - components/window-mapper.js</a></h4></div></div></div><p>Torbutton tags Firefox <a class="ulink" href="https://developer.mozilla.org/en/XUL_Tutorial/Tabboxes" target="_top">tabs</a> with a special variable that indicates the Tor
302) state the tab was most recently used under to fetch a page. The problem is
303) that for many Firefox events, it is not possible to determine the tab that is
304) actually receiving the event. The Torbutton window mapper allows the Torbutton
305) chrome and other components to look up a <a class="ulink" href="https://developer.mozilla.org/en/XUL/tabbrowser" target="_top">browser
306) tab</a> for a given <a class="ulink" href="https://developer.mozilla.org/en/nsIDOMWindow" target="_top">HTML content
307) window</a>. It does this by traversing all windows and all browsers, until it
308) finds the browser with the requested <a class="ulink" href="https://developer.mozilla.org/en/XUL/tabbrowser#p-contentWindow" target="_top">contentWindow</a> element. Since the content policy
309) and page loading in general can generate hundreds of these lookups, this
310) result is cached inside the component.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
311) </p></div><div class="sect3" title="@torproject.org/crash-observer;1"><div class="titlepage"><div><div><h4 class="title"><a id="crashobserver"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/crash-observer.js" target="_top">@torproject.org/crash-observer;1</a></h4></div></div></div><p>
312)
313) This component detects when Firefox crashes by altering Firefox prefs during
314) runtime and checking for the same values at startup. It <a class="ulink" href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIPrefService#savePrefFile()" target="_top">synchronizes
315) the preference service</a> to ensure the altered prefs are written to disk
316) immediately.
317)
318) </p></div><div class="sect3" title="@torproject.org/torbutton-ss-blocker;1"><div class="titlepage"><div><div><h4 class="title"><a id="tbsessionstore"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/tbSessionStore.js" target="_top">@torproject.org/torbutton-ss-blocker;1</a></h4></div></div></div><p>
319)
320) This component subscribes to the Firefox <a class="ulink" href="https://developer.mozilla.org/en/Observer_Notifications#Session_Store" target="_top">sessionstore-state-write</a>
321) observer event to filter out URLs from tabs loaded during Tor, to prevent them
322) from being written to disk. To do this, it checks the
323) <span class="command"><strong>__tb_tor_fetched</strong></span> tag of tab objects before writing them out. If
324) the tag is from a blocked Tor state, the tab is not written to disk. This is
325) a rather expensive operation that involves potentially very large JSON
326) evaluations and object tree traversals, but it preferable to replacing the
327) Firefox session store with our own implementation, which is what was done in
328) years past.
329)
330) </p></div><div class="sect3" title="@torproject.org/torRefSpoofer;1"><div class="titlepage"><div><div><h4 class="title"><a id="refspoofer"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/torRefSpoofer.js" target="_top">@torproject.org/torRefSpoofer;1</a></h4></div></div></div><p>
331) This component handles optional referrer spoofing for Torbuton. It implements a
332) form of "smart" referer spoofing using <a class="ulink" href="https://developer.mozilla.org/en/Setting_HTTP_request_headers" target="_top">http-on-modify-request</a>
333) to modify the Referrer header. The code sends the default browser referrer
334) header only if the destination domain is a suffix of the source, or if the
335) source is a suffix of the destination. Otherwise, it sends no referer. This
336) strange suffix logic is used as a heuristic: some rare sites on the web block
337) requests without proper referer headers, and this logic is an attempt to cater
338) to them. Unfortunately, it may not be enough. For example, google.fr will not
339) send a referer to google.com using this logic. Hence, it is off by default.
340) </p></div><div class="sect3" title="@torproject.org/cssblocker;1 - components/cssblocker.js"><div class="titlepage"><div><div><h4 class="title"><a id="contentpolicy"></a><a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cssblocker.js" target="_top">@torproject.org/cssblocker;1
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
341) - components/cssblocker.js</a></h4></div></div></div><p>This is a key component to Torbutton's security measures. When Tor is
342) toggled, Javascript is disabled, and pages are instructed to stop loading.
343) However, CSS is still able to perform network operations by loading styles for
344) onmouseover events and other operations. In addition, favicons can still be
345) loaded by the browser. The cssblocker component prevents this by implementing
346) and registering an <a class="ulink" href="https://developer.mozilla.org/en/nsIContentPolicy" target="_top">nsIContentPolicy</a>.
347) When an nsIContentPolicy is registered, Firefox checks every attempted network
348) request against its <a class="ulink" href="https://developer.mozilla.org/en/nsIContentPolicy#shouldLoad()" target="_top">shouldLoad</a>
349) member function to determine if the load should proceed. In Torbutton's case,
350) the content policy looks up the appropriate browser tab using the <a class="link" href="#windowmapper" title="@torproject.org/content-window-mapper;1 - components/window-mapper.js">window mapper</a>,
351) and checks that tab's load tag against the current Tor state. If the tab was
352) loaded in a different state than the current state, the fetch is denied.
353) Otherwise, it is allowed.</p> This helps to achieve the <a class="link" href="#isolation">Network
354) Isolation</a> requirements of Torbutton.
355)
356) <p>In addition, the content policy also blocks website javascript from
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
357) <a class="ulink" href="http://webdevwonders.com/detecting-firefox-add-ons/" target="_top">querying for
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
358) versions and existence of extension chrome</a> while Tor is enabled, and
359) also masks the presence of Torbutton to website javascript while Tor is
360) disabled. </p><p>
361)
362) Finally, some of the work that logically belongs to the content policy is
363) instead handled by the <span class="command"><strong>torbutton_http_observer</strong></span> and
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
364) <span class="command"><strong>torbutton_weblistener</strong></span> in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js" target="_top">torbutton.js</a>. These two objects handle blocking of
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
365) Firefox 3 favicon loads, popups, and full page plugins, which for whatever
366) reason are not passed to the Firefox content policy itself (see Firefox Bugs
367) <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437014" target="_top">437014</a> and
368) <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=401296" target="_top">401296</a>).
369)
370) </p><p>
371)
372) This helps to fulfill both the <a class="link" href="#setpreservation">Anonymity Set Preservation</a> and the <a class="link" href="#undiscoverability">Tor Undiscoverability</a> requirements of
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
373) Torbutton.</p></div></div></div><div class="sect1" title="3. Chrome"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2636893"></a>3. Chrome</h2></div></div></div><p>The chrome is where all the torbutton graphical elements and windows are
374) located. </p><div class="sect2" title="3.1. XUL Windows and Overlays"><div class="titlepage"><div><div><h3 class="title"><a id="id2658833"></a>3.1. XUL Windows and Overlays</h3></div></div></div><p>
375) Each window is described as an <a class="ulink" href="http://developer.mozilla.org/en/docs/XUL_Reference" target="_top">XML file</a>, with zero or more Javascript
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
376) files attached. The scope of these Javascript files is their containing
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
377) window. XUL files that add new elements and script to existing Firefox windows
378) are called overlays.</p><div class="sect3" title="Browser Overlay - torbutton.xul"><div class="titlepage"><div><div><h4 class="title"><a id="browseroverlay"></a>Browser Overlay - <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.xul" target="_top">torbutton.xul</a></h4></div></div></div><p>The browser overlay, torbutton.xul, defines the toolbar button, the status
379) bar, and events for toggling the button. The overlay code is in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js" target="_top">chrome/content/torbutton.js</a>.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
380) It contains event handlers for preference update, shutdown, upgrade, and
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
381) location change events.</p></div><div class="sect3" title="Preferences Window - preferences.xul"><div class="titlepage"><div><div><h4 class="title"><a id="id2647653"></a>Preferences Window - <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.xul" target="_top">preferences.xul</a></h4></div></div></div><p>The preferences window of course lays out the Torbutton preferences, with
382) handlers located in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.js" target="_top">chrome/content/preferences.js</a>.</p></div><div class="sect3" title="Other Windows"><div class="titlepage"><div><div><h4 class="title"><a id="id2665081"></a>Other Windows</h4></div></div></div><p>There are additional windows that describe popups for right clicking on
383) the status bar, the toolbutton, and the about page.</p></div></div><div class="sect2" title="3.2. Major Chrome Observers"><div class="titlepage"><div><div><h3 class="title"><a id="id2655137"></a>3.2. Major Chrome Observers</h3></div></div></div><p>
384) In addition to the <a class="link" href="#components" title="2. Components">components described
385) above</a>, Torbutton also instantiates several observers in the browser
386) overlay window. These mostly grew due to scoping convenience, and many should
387) probably be relocated into their own components.
388) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><span class="command"><strong>torbutton_window_pref_observer</strong></span><p>
389) This is an observer that listens for Torbutton state changes, for the purposes
390) of updating the Torbutton button graphic as the Tor state changes.
391) </p></li><li class="listitem"><span class="command"><strong>torbutton_unique_pref_observer</strong></span><p>
392)
393) This is an observer that only runs in one window, called the main window. It
394) listens for changes to all of the Torbutton preferences, as well as Torbutton
395) controlled Firefox preferences. It is what carries out the toggle path when
396) the proxy settings change. When the main window is closed, the
397) torbutton_close_window event handler runs to dub a new window the "main
398) window".
399)
400) </p></li><li class="listitem"><span class="command"><strong>tbHistoryListener</strong></span><p>
401) The tbHistoryListener exists to prevent client window Javascript from
402) interacting with window.history to forcibly navigate a user to a tab session
403) history entry from a different Tor state. It also expunges the window.history
404) entries during toggle. This listener helps Torbutton
405) satisfy the <a class="link" href="#isolation">Network Isolation</a> requirement as
406) well as the <a class="link" href="#state">State Separation</a> requirement.
407)
408) </p></li><li class="listitem"><span class="command"><strong>torbutton_http_observer</strong></span><p>
409)
410) The torbutton_http_observer performs some of the work that logically belongs
411) to the content policy. This handles blocking of
412) Firefox 3 favicon loads, which for whatever
413) reason are not passed to the Firefox content policy itself (see Firefox Bugs
414) <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437014" target="_top">437014</a> and
415) <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=401296" target="_top">401296</a>).
416)
417) </p><p>
418) The observer is also responsible for redirecting users to alternate
419) search engines when Google presents them with a Captcha, as well as copying
420) Google Captcha-related cookies between international Google domains.
421) </p></li><li class="listitem"><span class="command"><strong>torbutton_proxyservice</strong></span><p>
422) The Torbutton proxy service handles redirecting Torbutton-related update
423) checks on addons.mozilla.org through Tor. This is done to help satisfy the
424) <a class="link" href="#undiscoverability">Tor Undiscoverability</a> requirement.
425) </p></li><li class="listitem"><span class="command"><strong>torbutton_weblistener</strong></span><p>The <a class="ulink" href="https://developer.mozilla.org/en/nsIWebProgressListener#onLocationChange" target="_top">location
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
426) change</a> <a class="ulink" href="https://developer.mozilla.org/en/nsIWebProgress" target="_top">webprogress
427) listener</a>, <span class="command"><strong>torbutton_weblistener</strong></span> is one of the most
428) important parts of the chrome from a security standpoint. It is a <a class="ulink" href="https://developer.mozilla.org/en/nsIWebProgressListener" target="_top">webprogress
429) listener</a> that handles receiving an event every time a page load or
430) iframe load occurs. This class eventually calls down to
431) <code class="function">torbutton_update_tags()</code> and
432) <code class="function">torbutton_hookdoc()</code>, which apply the browser Tor load
433) state tags, plugin permissions, and install the Javascript hooks to hook the
434) <a class="ulink" href="https://developer.mozilla.org/en/DOM/window.screen" target="_top">window.screen</a>
435) object to obfuscate browser and desktop resolution information.
436)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
437) </p></li></ol></div></div></div><div class="sect1" title="4. Toggle Code Path"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2657565"></a>4. Toggle Code Path</h2></div></div></div><p>
438)
439) The act of toggling is connected to <code class="function">torbutton_toggle()</code>
440) via the <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.xul" target="_top">torbutton.xul</a>
441) and <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/popup.xul" target="_top">popup.xul</a>
442) overlay files. Most of the work in the toggling process is present in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js" target="_top">torbutton.js</a>
443)
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
444) </p><p>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
445)
446) Toggling is a 3 stage process: Button Click, Proxy Update, and
447) Settings Update. These stages are reflected in the prefs
448) <span class="command"><strong>extensions.torbutton.tor_enabled</strong></span>,
449) <span class="command"><strong>extensions.torbutton.proxies_applied</strong></span>, and
450) <span class="command"><strong>extensions.torbutton.settings_applied</strong></span>. The reason for the
451) three stage preference update is to ensure immediate enforcement of <a class="link" href="#isolation">Network Isolation</a> via the <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">content policy</a>. Since the content window
452) javascript runs on a different thread than the chrome javascript, it is
453) important to properly convey the stages to the content policy to avoid race
454) conditions and leakage, especially with <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=409737" target="_top">Firefox Bug
455) 409737</a> unfixed. The content policy does not allow any network activity
456) whatsoever during this three stage transition.
457)
458) </p><div class="sect2" title="4.1. Button Click"><div class="titlepage"><div><div><h3 class="title"><a id="id2653926"></a>4.1. Button Click</h3></div></div></div><p>
459)
460) This is the first step in the toggling process. When the user clicks the
461) toggle button or the toolbar, <code class="function">torbutton_toggle()</code> is
462) called. This function checks the current Tor status by comparing the current
463) proxy settings to the selected Tor settings, and then sets the proxy settings
464) to the opposite state, and sets the pref
465) <span class="command"><strong>extensions.torbutton.tor_enabled</strong></span> to reflect the new state.
466) It is this proxy pref update that gives notification via the <a class="ulink" href="https://developer.mozilla.org/en/NsIPrefBranch2#addObserver.28.29" target="_top">pref
467) observer</a>
468) <span class="command"><strong>torbutton_unique_pref_observer</strong></span> to perform the rest of the
469) toggle.
470)
471) </p></div><div class="sect2" title="4.2. Proxy Update"><div class="titlepage"><div><div><h3 class="title"><a id="id2652911"></a>4.2. Proxy Update</h3></div></div></div><p>
472)
473) When Torbutton receives any proxy change notifications via its
474) <span class="command"><strong>torbutton_unique_pref_observer</strong></span>, it calls
475) <code class="function">torbutton_set_status()</code> which checks against the Tor
476) settings to see if the Tor proxy settings match the current settings. If so,
477) it calls <code class="function">torbutton_update_status()</code>, which determines if
478) the Tor state has actually changed, and sets
479) <span class="command"><strong>extensions.torbutton.proxies_applied</strong></span> to the appropriate Tor
480) state value, and ensures that
481) <span class="command"><strong>extensions.torbutton.tor_enabled</strong></span> is also set to the correct
482) value. This is decoupled from the button click functionality via the pref
483) observer so that other addons (such as SwitchProxy) can switch the proxy
484) settings between multiple proxies.
485)
486) </p></div><div class="sect2" title="4.3. Settings Update"><div class="titlepage"><div><div><h3 class="title"><a id="id2647095"></a>4.3. Settings Update</h3></div></div></div><p>
487)
488) The next stage is also handled by
489) <code class="function">torbutton_update_status()</code>. This function sets scores of
490) Firefox preferences, saving the original values to prefs under
491) <span class="command"><strong>extensions.torbutton.saved.*</strong></span>, and performs the <a class="link" href="#cookiejar" title="@torproject.org/cookie-jar-selector;2 - components/cookie-jar-selector.js">cookie jarring</a>, state clearing (such as window.name
492) and DOM storage), and <a class="link" href="#preferences" title="4.4. Firefox preferences touched during Toggle">preference
493) toggling</a>. At the
494) end of its work, it sets
495) <span class="command"><strong>extensions.torbutton.settings_applied</strong></span>, which signifies the
496) completion of the toggle operation to the <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">content policy</a>.
497)
498) </p></div><div class="sect2" title="4.4. Firefox preferences touched during Toggle"><div class="titlepage"><div><div><h3 class="title"><a id="preferences"></a>4.4. Firefox preferences touched during Toggle</h3></div></div></div><p>
499) There are also a number of Firefox preferences set in
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
500) <code class="function">torbutton_update_status()</code> that aren't governed by any
501) Torbutton setting. These are:
502) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="ulink" href="http://kb.mozillazine.org/Network.security.ports.banned" target="_top">network.security.ports.banned</a><p>
503) Torbutton sets this setting to add ports 8123, 8118, 9050 and 9051 (which it
504) reads from <span class="command"><strong>extensions.torbutton.banned_ports</strong></span>) to the list
505) of ports Firefox is forbidden to access. These ports are Polipo, Privoxy, Tor,
506) and the Tor control port, respectively. This is set for both Tor and Non-Tor
507) usage, and prevents websites from attempting to do http fetches from these
508) ports to see if they are open, which addresses the <a class="link" href="#undiscoverability">Tor Undiscoverability</a> requirement.
509) </p></li><li class="listitem"><a class="ulink" href="http://kb.mozillazine.org/Browser.send_pings" target="_top">browser.send_pings</a><p>
510) This setting is currently always disabled. If anyone ever complains saying
511) that they *want* their browser to be able to send ping notifications to a
512) page or arbitrary link, I'll make this a pref or Tor-only. But I'm not holding
513) my breath. I haven't checked if the content policy is called for pings, but if
514) not, this setting helps with meeting the <a class="link" href="#isolation">Network
515) Isolation</a> requirement.
516) </p></li><li class="listitem"><a class="ulink" href="http://kb.mozillazine.org/Browser.safebrowsing.remoteLookups" target="_top">browser.safebrowsing.remoteLookups</a><p>
517) Likewise for this setting. I find it hard to imagine anyone who wants to ask
518) Google in real time if each URL they visit is safe, especially when the list
519) of unsafe URLs is downloaded anyway. This helps fulfill the <a class="link" href="#disk">Disk Avoidance</a> requirement, by preventing your entire
520) browsing history from ending up on Google's disks.
521) </p></li><li class="listitem"><a class="ulink" href="http://kb.mozillazine.org/Browser.safebrowsing.enabled" target="_top">browser.safebrowsing.enabled</a><p>
522) Safebrowsing does <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=360387" target="_top">unauthenticated
523) updates under Firefox 2</a>, so it is disabled during Tor usage.
524) This helps fulfill the <a class="link" href="#updates">Update
525) Safety</a> requirement. Firefox 3 has the fix for that bug, and so
526) safebrowsing updates are enabled during Tor usage.
527) </p></li><li class="listitem"><a class="ulink" href="http://kb.mozillazine.org/Network.protocol-handler.warn-external.%28protocol%29" target="_top">network.protocol-handler.warn-external.(protocol)</a><p>
528) If Tor is enabled, we need to prevent random external applications from
529) launching without at least warning the user. This group of settings only
530) partially accomplishes this, however. Applications can still be launched via
531) plugins. The mechanisms for handling this are described under the "Disable
532) Plugins During Tor Usage" preference. This helps fulfill the <a class="link" href="#proxy">Proxy Obedience</a> requirement, by preventing external
533) applications from accessing network resources at the command of Tor-fetched
534) pages. Unfortunately, due to <a class="link" href="#FirefoxBugs" title="6. Relevant Firefox Bugs">Firefox Bug</a>
535) <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=440892" target="_top">440892</a>,
536) these prefs are no longer obeyed. They are set still anyway out of respect for
537) the dead.
538) </p></li><li class="listitem"><a class="ulink" href="http://kb.mozillazine.org/Browser.sessionstore.max_tabs_undo" target="_top">browser.sessionstore.max_tabs_undo</a><p>
539)
540) To help satisfy the Torbutton <a class="link" href="#state">State Separation</a>
541) and <a class="link" href="#isolation">Network Isolation</a> requirements,
542) Torbutton needs to purge the Undo Tab history on toggle to prevent repeat
543) "Undo Close" operations from accidentally restoring tabs from a different Tor
544) State. This purge is accomplished by setting this preference to 0 and then
545) restoring it to the previous user value upon toggle.
546)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
547) </p></li><li class="listitem"><span class="command"><strong>security.enable_ssl2</strong></span> or <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/interfaces/nsIDOMCrypto" target="_top">nsIDOMCrypto::logout()</a><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
548) TLS Session IDs can persist for an indefinite duration, providing an
549) identifier that is sent to TLS sites that can be used to link activity. This
550) is particularly troublesome now that we have certificate verification in place
551) in Firefox 3: The OCSP server can use this Session ID to build a history of
552) TLS sites someone visits, and also correlate their activity as users move from
553) network to network (such as home to work to coffee shop, etc), inside and
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
554) outside of Tor. To handle this and to help satisfy our <a class="link" href="#state">State Separation Requirement</a>, we call the logout()
555) function of nsIDOMCrypto. Since this may be absent, or may fail, we fall back
556) to toggling
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
557) <span class="command"><strong>security.enable_ssl2</strong></span>, which clears the SSL Session ID
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
558) cache via the pref observer at <a class="ulink" href="http://mxr.mozilla.org/security/source/security/manager/ssl/src/nsNSSComponent.cpp" target="_top">nsNSSComponent.cpp</a>.
559) </p></li><li class="listitem"><span class="command"><strong>security.OCSP.enabled</strong></span><p>
560) Similarly, we toggle <span class="command"><strong>security.OCSP.enabled</strong></span>, which clears the OCSP certificate
561) validation cache via the pref observer at <a class="ulink" href="http://mxr.mozilla.org/security/source/security/manager/ssl/src/nsNSSComponent.cpp" target="_top">nsNSSComponent.cpp</a>.
562) In this way, exit nodes will not be able to fingerprint you
563) based the fact that non-Tor OCSP lookups were obviously previously cached.
564) To handle this and to help satisfy our <a class="link" href="#state">State Separation Requirement</a>,
565) </p></li><li class="listitem"><span class="command"><strong><a class="ulink" href="http://kb.mozillazine.org/Updating_extensions#Disabling_update_checks_for_individual_add-ons_-_Advanced_users" target="_top">extensions.e0204bd5-9d31-402b-a99d-a6aa8ffebdca.getAddons.cache.enabled</a></strong></span><p>
566) We permanently disable addon usage statistic reporting to the
567) addons.mozilla.org statistics engine. These statistics send version
568) information about Torbutton users via non-Tor, allowing their Tor use to be
569) uncovered. Disabling this reporting helps Torbutton to satisfy its <a class="link" href="#undiscoverability">Tor Undiscoverability</a> requirement.
570)
571) </p></li><li class="listitem"><span class="command"><strong><a class="ulink" href="http://www.mozilla.com/en-US/firefox/geolocation/" target="_top">geo.enabled</a></strong></span><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
572)
573) Torbutton disables Geolocation support in Firefox 3.5 and above whenever tor
574) is enabled. This helps Torbutton maintain its
575) <a class="link" href="#location">Location Neutrality</a> requirement.
576) While Firefox does prompt before divulging geolocational information,
577) the assumption is that Tor users will never want to give their
578) location away during Tor usage, and even allowing websites to prompt
579) them to do so will only cause confusion and accidents to happen. Moreover,
580) just because users may approve a site to know their location in non-Tor mode
581) does not mean they want it divulged during Tor mode.
582)
583) </p></li><li class="listitem"><span class="command"><strong><a class="ulink" href="http://kb.mozillazine.org/Browser.zoom.siteSpecific" target="_top">browser.zoom.siteSpecific</a></strong></span><p>
584)
585) Firefox actually remembers your zoom settings for certain sites. CSS
586) and Javascript rule can use this to recognize previous visitors to a site.
587) This helps Torbutton fulfill its <a class="link" href="#state">State Separation</a>
588) requirement.
589)
590) </p></li><li class="listitem"><span class="command"><strong><a class="ulink" href="https://developer.mozilla.org/en/controlling_dns_prefetching" target="_top">network.dns.disablePrefetch</a></strong></span><p>
591)
592) Firefox 3.5 and above implement prefetching of DNS resolution for hostnames in
593) links on a page to decrease page load latency. While Firefox does typically
594) disable this behavior when proxies are enabled, we set this pref for added
595) safety during Tor usage. Additionally, to prevent Tor-loaded tabs from having
596) their links prefetched after a toggle to Non-Tor mode occurs,
597) we also set the docShell attribute
598) <a class="ulink" href="http://www.oxymoronical.com/experiments/apidocs/interface/nsIDocShell" target="_top">
599) allowDNSPrefetch</a> to false on Tor loaded tabs. This happens in the same
600) positions in the code as those for disabling plugins via the allowPlugins
601) docShell attribute. This helps Torbutton fulfill its <a class="link" href="#isolation">Network Isolation</a> requirement.
602)
603) </p></li><li class="listitem"><span class="command"><strong><a class="ulink" href="http://kb.mozillazine.org/Browser.cache.offline.enable" target="_top">browser.cache.offline.enable</a></strong></span><p>
604)
605) Firefox has the ability to store web applications in a special cache to allow
606) them to continue to operate while the user is offline. Since this subsystem
607) is actually different than the normal disk cache, it must be dealt with
608) separately. Thus, Torbutton sets this preference to false whenever Tor is
609) enabled. This helps Torbutton fulfill its <a class="link" href="#disk">Disk
610) Avoidance</a> and <a class="link" href="#state">State Separation</a>
611) requirements.
612)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
613) </p></li></ol></div></div></div><div class="sect1" title="5. Description of Options"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id2659431"></a>5. Description of Options</h2></div></div></div><p>This section provides a detailed description of Torbutton's options. Each
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
614) option is presented as the string from the preferences window, a summary, the
615) preferences it touches, and the effect this has on the components, chrome, and
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
616) browser properties.</p><div class="sect2" title="5.1. Proxy Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2661813"></a>5.1. Proxy Settings</h3></div></div></div><div class="sect3" title="Test Settings"><div class="titlepage"><div><div><h4 class="title"><a id="id2663502"></a>Test Settings</h4></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
617) This button under the Proxy Settings tab provides a way to verify that the
618) proxy settings are correct, and actually do route through the Tor network. It
619) performs this check by issuing an <a class="ulink" href="http://developer.mozilla.org/en/docs/XMLHttpRequest" target="_top">XMLHTTPRequest</a>
620) for <a class="ulink" href="https://check.torproject.org/?TorButton=True" target="_top">https://check.torproject.org/?Torbutton=True</a>.
621) This is a special page that returns very simple, yet well-formed XHTML that
622) Torbutton can easily inspect for a hidden link with an id of
623) <span class="command"><strong>TorCheckResult</strong></span> and a target of <span class="command"><strong>success</strong></span>
624) or <span class="command"><strong>failure</strong></span> to indicate if the
625) user hit the page from a Tor IP, a non-Tor IP. This check is handled in
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
626) <code class="function">torbutton_test_settings()</code> in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js" target="_top">torbutton.js</a>.
627) Presenting the results to the user is handled by the <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.xul" target="_top">preferences
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
628) window</a>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
629) callback <code class="function">torbutton_prefs_test_settings()</code> in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.js" target="_top">preferences.js</a>.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
630)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
631) </p></div></div><div class="sect2" title="5.2. Dynamic Content Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2660939"></a>5.2. Dynamic Content Settings</h3></div></div></div><div class="sect3" title="Disable plugins on Tor Usage (crucial)"><div class="titlepage"><div><div><h4 class="title"><a id="plugins"></a>Disable plugins on Tor Usage (crucial)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.no_tor_plugins</strong></span></p><p>Java and plugins <a class="ulink" href="http://java.sun.com/j2se/1.5.0/docs/api/java/net/class-use/NetworkInterface.html" target="_top">can query</a> the <a class="ulink" href="http://www.rgagnon.com/javadetails/java-0095.html" target="_top">local IP
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
632) address</a> and report it back to the
633) remote site. They can also <a class="ulink" href="http://decloak.net" target="_top">bypass proxy settings</a> and directly connect to a
634) remote site without Tor. Every browser plugin we have tested with Firefox has
635) some form of network capability, and every one ignores proxy settings or worse - only
636) partially obeys them. This includes but is not limited to:
637) QuickTime, Windows Media Player, RealPlayer, mplayerplug-in, AcroRead, and
638) Flash.
639)
640) </p><p>
641) Enabling this preference causes the above mentioned Torbutton chrome web progress
642) listener <span class="command"><strong>torbutton_weblistener</strong></span> to disable Java via <span class="command"><strong>security.enable_java</strong></span> and to disable
643) plugins via the browser <a class="ulink" href="https://developer.mozilla.org/en/XUL%3aProperty%3adocShell" target="_top">docShell</a>
644) attribute <span class="command"><strong>allowPlugins</strong></span>. These flags are set every time a new window is
645) created (<code class="function">torbutton_tag_new_browser()</code>), every time a web
646) load
647) event occurs
648) (<code class="function">torbutton_update_tags()</code>), and every time the tor state is changed
649) (<code class="function">torbutton_update_status()</code>). As a backup measure, plugins are also
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
650) prevented from loading by the content policy in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cssblocker.js" target="_top">@torproject.org/cssblocker;1</a> if Tor is
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
651) enabled and this option is set.
652) </p><p>All of this turns out to be insufficient if the user directly clicks
653) on a plugin-handled mime-type. <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=401296" target="_top">In this case</a>,
654) the browser decides that maybe it should ignore all these other settings and
655) load the plugin anyways, because maybe the user really did want to load it
656) (never mind this same load-style could happen automatically with meta-refresh
657) or any number of other ways..). To handle these cases, Torbutton stores a list
658) of plugin-handled mime-types, and sets the pref
659) <span class="command"><strong>plugin.disable_full_page_plugin_for_types</strong></span> to this list.
660) Additionally, (since nothing can be assumed when relying on Firefox
661) preferences and internals) if it detects a load of one of them from the web
662) progress listener, it cancels the request, tells the associated DOMWindow to
663) stop loading, clears the document, AND throws an exception. Anything short of
664) all this and the plugin managed to find some way to load.
665) </p><p>
666) All this could be avoided, of course, if Firefox would either <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=401296" target="_top">obey
667) allowPlugins</a> for directly visited URLs, or notify its content policy for such
668) loads either <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=309524" target="_top">via</a> <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=380556" target="_top">shouldProcess</a> or shouldLoad. The fact that it does not is
669) not very encouraging.
670) </p><p>
671)
672) Since most plugins completely ignore browser proxy settings, the actions
673) performed by this setting are crucial to satisfying the <a class="link" href="#proxy">Proxy Obedience</a> requirement.
674)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
675) </p></div><div class="sect3" title="Isolate Dynamic Content to Tor State (crucial)"><div class="titlepage"><div><div><h4 class="title"><a id="id2660188"></a>Isolate Dynamic Content to Tor State (crucial)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.isolate_content</strong></span></p><p>Enabling this preference is what enables the <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cssblocker.js" target="_top">@torproject.org/cssblocker;1</a> content policy
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
676) mentioned above, and causes it to block content load attempts in pages an
677) opposite Tor state from the current state. Freshly loaded <a class="ulink" href="https://developer.mozilla.org/en/XUL/tabbrowser" target="_top">browser
678) tabs</a> are tagged
679) with a <span class="command"><strong>__tb_load_state</strong></span> member in
680) <code class="function">torbutton_update_tags()</code> and this
681) value is compared against the current tor state in the content policy.</p><p>It also kills all Javascript in each page loaded under that state by
682) toggling the <span class="command"><strong>allowJavascript</strong></span> <a class="ulink" href="https://developer.mozilla.org/en/XUL%3aProperty%3adocShell" target="_top">docShell</a> property, and issues a
683) <a class="ulink" href="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWebNavigation#stop()" target="_top">webNavigation.stop(webNavigation.STOP_ALL)</a> to each browser tab (the
684) equivalent of hitting the STOP button).</p><p>
685)
686) Unfortunately, <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=409737" target="_top">Firefox bug
687) 409737</a> prevents <span class="command"><strong>docShell.allowJavascript</strong></span> from killing
688) all event handlers, and event handlers registered with <a class="ulink" href="http://developer.mozilla.org/en/docs/DOM:element.addEventListener" target="_top">addEventListener()</a>
689) are still able to execute. The <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">Torbutton Content
690) Policy</a> should prevent such code from performing network activity within
691) the current tab, but activity that happens via a popup window or via a
692) Javascript redirect can still slip by. For this reason, Torbutton blocks
693) popups by checking for a valid <a class="ulink" href="http://developer.mozilla.org/en/docs/DOM:window.opener" target="_top">window.opener</a>
694) attribute in <code class="function">torbutton_check_progress()</code>. If the window
695) has an opener from a different Tor state, its load is blocked. The content
696) policy also takes similar action to prevent Javascript redirects. This also
697) has the side effect/feature of preventing the user from following any links
698) from a page loaded in an opposite Tor state.
699)
700) </p><p>
701) This setting is responsible for satisfying the <a class="link" href="#isolation">Network Isolation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
702) </p></div><div class="sect3" title="Hook Dangerous Javascript"><div class="titlepage"><div><div><h4 class="title"><a id="jshooks"></a>Hook Dangerous Javascript</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.kill_bad_js</strong></span></p><p>This setting enables injection of the <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/jshooks.js" target="_top">Javascript
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
703) hooking code</a>. This is done in the chrome in
704) <code class="function">torbutton_hookdoc()</code>, which is called ultimately by both the
705) <a class="ulink" href="https://developer.mozilla.org/en/nsIWebProgressListener" target="_top">webprogress
706) listener</a> <span class="command"><strong>torbutton_weblistener</strong></span> and the <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">content policy</a> (the latter being a hack to handle
707) javascript: urls).
708)
709) In the Firefox 2 days, this option did a lot more than
710) it does now. It used to be responsible for timezone and improved useragent
711) spoofing, and history object cloaking. However, now it only provides
712) obfuscation of the <a class="ulink" href="https://developer.mozilla.org/en/DOM/window.screen" target="_top">window.screen</a>
713) object to mask your browser and desktop resolution.
714) The resolution hooks
715) effectively make the Firefox browser window appear to websites as if the renderable area
716) takes up the entire desktop, has no toolbar or other GUI element space, and
717) the desktop itself has no toolbars.
718) These hooks drastically reduce the amount of information available to do <a class="link" href="#fingerprinting">anonymity set reduction attacks</a> and help to
719) meet the <a class="link" href="#setpreservation">Anonymity Set Preservation</a>
720) requirements. Unfortunately, Gregory Fleischer discovered it is still possible
721) to retrieve the original screen values by using <a class="ulink" href="http://pseudo-flaw.net/tor/torbutton/unmask-sandbox-xpcnativewrapper.html" target="_top">XPCNativeWrapper</a>
722) or <a class="ulink" href="http://pseudo-flaw.net/tor/torbutton/unmask-components-lookupmethod.html" target="_top">Components.lookupMethod</a>.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
723) We are still looking for a workaround as of Torbutton 1.3.2.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
724)
725)
726)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
727) </p></div><div class="sect3" title="Resize windows to multiples of 50px during Tor usage (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2629024"></a>Resize windows to multiples of 50px during Tor usage (recommended)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.resize_windows</strong></span></p><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
728)
729) This option drastically cuts down on the number of distinct anonymity sets
730) that divide the Tor web userbase. Without this setting, the dimensions for a
731) typical browser window range from 600-1200 horizontal pixels and 400-1000
732) vertical pixels, or about 600x600 = 360000 different sets. Resizing the
733) browser window to multiples of 50 on each side reduces the number of sets by
734) 50^2, bringing the total number of sets to 144. Of course, the distribution
735) among these sets are not uniform, but scaling by 50 will improve the situation
736) due to this non-uniformity for users in the less common resolutions.
737) Obviously the ideal situation would be to lie entirely about the browser
738) window size, but this will likely cause all sorts of rendering issues, and is
739) also not implementable in a foolproof way from extension land.
740)
741) </p><p>
742)
743) The implementation of this setting is spread across a couple of different
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
744) locations in the Torbutton javascript <a class="link" href="#browseroverlay" title="Browser Overlay - torbutton.xul">browser
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
745) overlay</a>. Since resizing minimized windows causes them to be restored,
746) and since maximized windows remember their previous size to the pixel, windows
747) must be resized before every document load (at the time of browser tagging)
748) via <code class="function">torbutton_check_round()</code>, called by
749) <code class="function">torbutton_update_tags()</code>. To prevent drift, the extension
750) tracks the original values of the windows and uses this to perform the
751) rounding on document load. In addition, to prevent the user from resizing a
752) window to a non-50px multiple, a resize listener
753) (<code class="function">torbutton_do_resize()</code>) is installed on every new browser
754) window to record the new size and round it to a 50px multiple while Tor is
755) enabled. In all cases, the browser's contentWindow.innerWidth and innerHeight
756) are set. This ensures that there is no discrepancy between the 50 pixel cutoff
757) and the actual renderable area of the browser (so that it is not possible to
758) infer toolbar size/presence by the distance to the nearest 50 pixel roundoff).
759)
760) </p><p>
761) This setting helps to meet the <a class="link" href="#setpreservation">Anonymity Set Preservation</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
762) </p></div><div class="sect3" title="Disable Search Suggestions during Tor (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2629109"></a>Disable Search Suggestions during Tor (recommended)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.no_search</strong></span></p><p>
763) This setting causes Torbutton to disable <a class="ulink" href="http://kb.mozillazine.org/Browser.search.suggest.enabled" target="_top"><span class="command"><strong>browser.search.suggest.enabled</strong></span></a>
764) during Tor usage.
765) This governs if you get Google search suggestions during Tor
766) usage. Your Google cookie is transmitted with google search suggestions, hence
767) this is recommended to be disabled.
768)
769) </p><p>
770) While this setting doesn't satisfy any Torbutton requirements, the fact that
771) cookies are transmitted for partially typed queries does not seem desirable
772) for Tor usage.
773) </p></div><div class="sect3" title="Disable Updates During Tor"><div class="titlepage"><div><div><h4 class="title"><a id="id2629148"></a>Disable Updates During Tor</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.no_updates</strong></span></p><p>This setting causes Torbutton to disable the four <a class="ulink" href="http://wiki.mozilla.org/Update:Users/Checking_For_Updates#Preference_Controls_and_State" target="_top">Firefox
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
774) update settings</a> during Tor
775) usage: <span class="command"><strong>extensions.update.enabled</strong></span>,
776) <span class="command"><strong>app.update.enabled</strong></span>,
777) <span class="command"><strong>app.update.auto</strong></span>, and
778) <span class="command"><strong>browser.search.update</strong></span>. These prevent the
779) browser from updating extensions, checking for Firefox upgrades, and
780) checking for search plugin updates while Tor is enabled.
781) </p><p>
782) This setting satisfies the <a class="link" href="#updates">Update Safety</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
783) </p></div><div class="sect3" title="Redirect Torbutton Updates Via Tor (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2629209"></a>Redirect Torbutton Updates Via Tor (recommended)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.update_torbutton_via_tor</strong></span></p><p>This setting causes Torbutton to install an
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
784)
785) <a class="ulink" href="https://developer.mozilla.org/en/nsIProtocolProxyFilter" target="_top">nsIProtocolProxyFilter</a>
786) in order to redirect all version update checks and Torbutton update downloads
787) via Tor, regardless of if Tor is enabled or not. This was done both to address
788) concerns about data retention done by <a class="ulink" href="https://www.addons.mozilla.org" target="_top">addons.mozilla.org</a>, as well as to
789) help censored users meet the <a class="link" href="#undiscoverability">Tor
790) Undiscoverability</a> requirement.
791)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
792) </p></div><div class="sect3" title="Disable livemarks updates during Tor usage (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2629253"></a>Disable livemarks updates during Tor usage (recommended)</h4></div></div></div><p>Option:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
793) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.disable_livemarks</strong></span></td></tr></table><p>
794) </p><p>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
795)
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
796) This option causes Torbutton to prevent Firefox from loading <a class="ulink" href="http://www.mozilla.com/firefox/livebookmarks.html" target="_top">Livemarks</a> during
797) Tor usage. Because people often have very personalized Livemarks (such as RSS
798) feeds of Wikipedia articles they maintain, etc). This is accomplished both by
799) <a class="link" href="#livemarks" title="@mozilla.org/browser/livemark-service;2 - components/block-livemarks.js">wrapping the livemark-service component</a> and
800) by calling stopUpdateLivemarks() on the <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/livemark-service;2" target="_top">Livemark
801) service</a> when Tor is enabled.
802)
803) </p><p>
804) This helps satisfy the <a class="link" href="#isolation">Network
805) Isolation</a> and <a class="link" href="#setpreservation">Anonymity Set
806) Preservation</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
807) </p></div><div class="sect3" title="Block Tor/Non-Tor access to network from file:// urls (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2629325"></a>Block Tor/Non-Tor access to network from file:// urls (recommended)</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
808) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.block_tor_file_net</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.block_nontor_file_net</strong></span></td></tr></table><p>
809) </p><p>
810)
811) These settings prevent file urls from performing network operations during the
812) respective Tor states. Firefox 2's implementation of same origin policy allows
813) file urls to read and <a class="ulink" href="http://www.gnucitizen.org/blog/content-disposition-hacking/" target="_top">submit
814) arbitrary files from the local filesystem</a> to arbitrary websites. To
815) make matters worse, the 'Content-Disposition' header can be injected
816) arbitrarily by exit nodes to trick users into running arbitrary html files in
817) the local context. These preferences cause the <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">content policy</a> to block access to any network
818) resources from File urls during the appropriate Tor state.
819)
820) </p><p>
821)
822) This preference helps to ensure Tor's <a class="link" href="#isolation">Network
823) Isolation</a> requirement, by preventing file urls from executing network
824) operations in opposite Tor states. Also, allowing pages to submit arbitrary
825) files to arbitrary sites just generally seems like a bad idea.
826)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
827) </p></div><div class="sect3" title="Close all Tor/Non-Tor tabs and windows on toggle (optional)"><div class="titlepage"><div><div><h4 class="title"><a id="id2629397"></a>Close all Tor/Non-Tor tabs and windows on toggle (optional)</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
828) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.close_nontor</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.close_tor</strong></span></td></tr></table><p>
829) </p><p>
830)
831) These settings cause Torbutton to enumerate through all windows and close all
832) tabs in each window for the appropriate Tor state. This code can be found in
833) <code class="function">torbutton_update_status()</code>. The main reason these settings
834) exist is as a backup mechanism in the event of any Javascript or content policy
835) leaks due to <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=409737" target="_top">Firefox Bug
836) 409737</a>. Torbutton currently tries to block all Javascript network
837) activity via the content policy, but until that bug is fixed, there is some
838) risk that there are alternate ways to bypass the policy. This option is
839) available as an extra assurance of <a class="link" href="#isolation">Network
840) Isolation</a> for those who would like to be sure that when Tor is toggled
841) all page activity has ceased. It also serves as a potential future workaround
842) in the event a content policy failure is discovered, and provides an additional
843) level of protection for the <a class="link" href="#disk">Disk Avoidance</a>
844) protection so that browser state is not sitting around waiting to be swapped
845) out longer than necessary.
846)
847) </p><p>
848) While this setting doesn't satisfy any Torbutton requirements, the fact that
849) cookies are transmitted for partially typed queries does not seem desirable
850) for Tor usage.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
851) </p></div></div><div class="sect2" title="5.3. History and Forms Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2670963"></a>5.3. History and Forms Settings</h3></div></div></div><div class="sect3" title="Isolate Access to History navigation to Tor state (crucial)"><div class="titlepage"><div><div><h4 class="title"><a id="id2670968"></a>Isolate Access to History navigation to Tor state (crucial)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.block_js_history</strong></span></p><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
852) This setting determines if Torbutton installs an <a class="ulink" href="http://www.oxymoronical.com/experiments/apidocs/interface/nsISHistoryListener" target="_top">nsISHistoryListener</a>
853) attached to the <a class="ulink" href="http://www.oxymoronical.com/experiments/apidocs/interface/nsISHistory" target="_top">sessionHistory</a> of
854) of each browser's <a class="ulink" href="https://developer.mozilla.org/en/XUL%3aProperty%3awebNavigation" target="_top">webNavigatator</a>.
855) The nsIShistoryListener is instantiated with a reference to the containing
856) browser window and blocks the back, forward, and reload buttons on the browser
857) navigation bar when Tor is in an opposite state than the one to load the
858) current tab. In addition, Tor clears the session history during a new document
859) load if this setting is enabled.
860)
861) </p><p>
862)
863) This is marked as a crucial setting in part
864) because Javascript access to the history object is indistinguishable from
865) user clicks, and because
866) <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=409737" target="_top">Firefox Bug
867) 409737</a> allows javascript to execute in opposite Tor states, javascript
868) can issue reloads after Tor toggle to reveal your original IP. Even without
869) this bug, however, Javascript is still able to access previous pages in your
870) session history that may have been loaded under a different Tor state, to
871) attempt to correlate your activity.
872)
873) </p><p>
874)
875) This setting helps to fulfill Torbutton's <a class="link" href="#state">State
876) Separation</a> and (until Bug 409737 is fixed) <a class="link" href="#isolation">Network Isolation</a>
877) requirements.
878)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
879) </p></div><div class="sect3" title="History Access Settings"><div class="titlepage"><div><div><h4 class="title"><a id="id2671045"></a>History Access Settings</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
880) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.block_thread</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.block_nthread</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.block_thwrite</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.block_nthwrite</strong></span></td></tr></table><p>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
881) </p><p>On Firefox 3.x, these four settings govern the behavior of the <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/ignore-history.js" target="_top">components/ignore-history.js</a>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
882) history blocker component mentioned above. By hooking the browser's view of
883) the history itself via the <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/global-history;2" target="_top">@mozilla.org/browser/global-history;2</a>
884) and <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/nav-history-service;1" target="_top">@mozilla.org/browser/nav-history-service;1</a>
885) components, this mechanism defeats all document-based <a class="ulink" href="http://whattheinternetknowsaboutyou.com/" target="_top">history disclosure
886) attacks</a>, including <a class="ulink" href="http://ha.ckers.org/weird/CSS-history.cgi" target="_top">CSS-only attacks</a>.
887)
888) The component also hooks functions involved in writing history to disk via
889) both the <a class="ulink" href="http://developer.mozilla.org/en/docs/Places_migration_guide#History" target="_top">Places
890) Database</a> and the older Firefox 2 mechanisms.
891)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
892) </p><p>
893) On Firefox 4, Mozilla finally <a class="ulink" href="https://developer.mozilla.org/en/CSS/Privacy_and_the_%3avisited_selector" target="_top">addressed
894) these issues</a>, so we can effectively ignore the "read" pair of the
895) above prefs. We then only need to link the write prefs to
896) <span class="command"><strong>places.history.enabled</strong></span>, which disabled writing to the
897) history store while set.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
898) </p><p>
899) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> and <a class="link" href="#disk">Disk Avoidance</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
900) </p></div><div class="sect3" title="Clear History During Tor Toggle (optional)"><div class="titlepage"><div><div><h4 class="title"><a id="id2671171"></a>Clear History During Tor Toggle (optional)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.clear_history</strong></span></p><p>This setting governs if Torbutton calls
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
901) <a class="ulink" href="https://developer.mozilla.org/en/nsIBrowserHistory#removeAllPages.28.29" target="_top">nsIBrowserHistory.removeAllPages</a>
902) and <a class="ulink" href="http://www.oxymoronical.com/experiments/apidocs/interface/nsISHistory" target="_top">nsISHistory.PurgeHistory</a>
903) for each tab on Tor toggle.</p><p>
904) This setting is an optional way to help satisfy the <a class="link" href="#state">State Separation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
905) </p></div><div class="sect3" title="Block Password+Form saving during Tor/Non-Tor"><div class="titlepage"><div><div><h4 class="title"><a id="id2671214"></a>Block Password+Form saving during Tor/Non-Tor</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
906) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.block_tforms</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.block_ntforms</strong></span></td></tr></table><p>
907) </p><p>These settings govern if Torbutton disables
908) <span class="command"><strong>browser.formfill.enable</strong></span>
909) and <span class="command"><strong>signon.rememberSignons</strong></span> during Tor and Non-Tor usage.
910) Since form fields can be read at any time by Javascript, this setting is a lot
911) more important than it seems.
912) </p><p>
913) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> and <a class="link" href="#disk">Disk Avoidance</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
914) </p></div></div><div class="sect2" title="5.4. Cache Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2671276"></a>5.4. Cache Settings</h3></div></div></div><div class="sect3" title="Block Tor disk cache and clear all cache on Tor Toggle"><div class="titlepage"><div><div><h4 class="title"><a id="id2671281"></a>Block Tor disk cache and clear all cache on Tor Toggle</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.clear_cache</strong></span>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
915) </p><p>This option causes Torbutton to call <a class="ulink" href="https://developer.mozilla.org/en/nsICacheService#evictEntries.28.29" target="_top">nsICacheService.evictEntries(0)</a>
916) on Tor toggle to remove all entries from the cache. In addition, this setting
917) causes Torbutton to set <a class="ulink" href="http://kb.mozillazine.org/Browser.cache.disk.enable" target="_top">browser.cache.disk.enable</a> to false.
918) </p><p>
919) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> and <a class="link" href="#disk">Disk Avoidance</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
920) </p></div><div class="sect3" title="Block disk and memory cache during Tor"><div class="titlepage"><div><div><h4 class="title"><a id="id2671331"></a>Block disk and memory cache during Tor</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.block_cache</strong></span></p><p>This setting
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
921) causes Torbutton to set <a class="ulink" href="http://kb.mozillazine.org/Browser.cache.memory.enable" target="_top">browser.cache.memory.enable</a>,
922) <a class="ulink" href="http://kb.mozillazine.org/Browser.cache.disk.enable" target="_top">browser.cache.disk.enable</a> and
923) <a class="ulink" href="http://kb.mozillazine.org/Network.http.use-cache" target="_top">network.http.use-cache</a> to false during tor usage.
924) </p><p>
925) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> and <a class="link" href="#disk">Disk Avoidance</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
926) </p></div></div><div class="sect2" title="5.5. Cookie and Auth Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2671385"></a>5.5. Cookie and Auth Settings</h3></div></div></div><div class="sect3" title="Clear Cookies on Tor Toggle"><div class="titlepage"><div><div><h4 class="title"><a id="id2671390"></a>Clear Cookies on Tor Toggle</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.clear_cookies</strong></span>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
927) </p><p>
928)
929) This setting causes Torbutton to call <a class="ulink" href="https://developer.mozilla.org/en/nsICookieManager#removeAll.28.29" target="_top">nsICookieManager.removeAll()</a> on
930) every Tor toggle. In addition, this sets <a class="ulink" href="http://kb.mozillazine.org/Network.cookie.lifetimePolicy" target="_top">network.cookie.lifetimePolicy</a>
931) to 2 for Tor usage, which causes all cookies to be demoted to session cookies,
932) which prevents them from being written to disk.
933)
934) </p><p>
935) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> and <a class="link" href="#disk">Disk Avoidance</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
936) </p></div><div class="sect3" title="Store Non-Tor cookies in a protected jar"><div class="titlepage"><div><div><h4 class="title"><a id="id2671441"></a>Store Non-Tor cookies in a protected jar</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.cookie_jars</strong></span>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
937) </p><p>
938)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
939) This setting causes Torbutton to use <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js" target="_top">@torproject.org/cookie-jar-selector;2</a> to store
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
940) non-tor cookies in a cookie jar during Tor usage, and clear the Tor cookies
941) before restoring the jar.
942) </p><p>
943) This setting also sets <a class="ulink" href="http://kb.mozillazine.org/Network.cookie.lifetimePolicy" target="_top">network.cookie.lifetimePolicy</a>
944) to 2 for Tor usage, which causes all cookies to be demoted to session cookies,
945) which prevents them from being written to disk.
946)
947) </p><p>
948) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> and <a class="link" href="#disk">Disk Avoidance</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
949) </p></div><div class="sect3" title="Store both Non-Tor and Tor cookies in a protected jar (dangerous)"><div class="titlepage"><div><div><h4 class="title"><a id="id2671498"></a>Store both Non-Tor and Tor cookies in a protected jar (dangerous)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.dual_cookie_jars</strong></span>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
950) </p><p>
951)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
952) This setting causes Torbutton to use <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js" target="_top">@torproject.org/cookie-jar-selector;2</a> to store
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
953) both Tor and Non-Tor cookies into protected jars.
954) </p><p>
955) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
956) </p></div><div class="sect3" title="Manage My Own Cookies (dangerous)"><div class="titlepage"><div><div><h4 class="title"><a id="id2671540"></a>Manage My Own Cookies (dangerous)</h4></div></div></div><p>Options: None</p><p>This setting disables all Torbutton cookie handling by setting the above
957) cookie prefs all to false.</p></div><div class="sect3" title="Disable DOM Storage during Tor usage (crucial)"><div class="titlepage"><div><div><h4 class="title"><a id="id2671556"></a>Disable DOM Storage during Tor usage (crucial)</h4></div></div></div><div class="sect3" title="Do not write Tor/Non-Tor cookies to disk"><div class="titlepage"><div><div><h4 class="title"><a id="id2671558"></a>Do not write Tor/Non-Tor cookies to disk</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
958) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.tor_memory_jar</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.nontor_memory_jar</strong></span></td></tr></table><p>
959) </p><p>
960) These settings (contributed by arno) cause Torbutton to set <a class="ulink" href="http://kb.mozillazine.org/Network.cookie.lifetimePolicy" target="_top">network.cookie.lifetimePolicy</a>
961) to 2 during the appropriate Tor state, and to store cookies acquired in that
962) state into a Javascript
963) <a class="ulink" href="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Processing_XML_with_E4X" target="_top">E4X</a>
964) object as opposed to writing them to disk.
965) </p><p>
966) This allows Torbutton to provide an option to preserve a user's
967) cookies while still satisfying the <a class="link" href="#disk">Disk Avoidance</a>
968) requirement.
969) </p></div><p>Option: <span class="command"><strong>extensions.torbutton.disable_domstorage</strong></span>
970) </p><p>
971)
972) This setting causes Torbutton to toggle <span class="command"><strong>dom.storage.enabled</strong></span> during Tor
973) usage to prevent
974) <a class="ulink" href="http://developer.mozilla.org/en/docs/DOM:Storage" target="_top">DOM Storage</a> from
975) being used to store persistent information across Tor states.</p><p>
976) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
977) </p></div><div class="sect3" title="Clear HTTP Auth on Tor Toggle (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2671659"></a>Clear HTTP Auth on Tor Toggle (recommended)</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.clear_http_auth</strong></span>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
978) </p><p>
979) This setting causes Torbutton to call <a class="ulink" href="http://www.oxymoronical.com/experiments/apidocs/interface/nsIHttpAuthManager" target="_top">nsIHttpAuthManager.clearAll()</a>
980) every time Tor is toggled.
981) </p><p>
982) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
983) </p></div></div><div class="sect2" title="5.6. Startup Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2671698"></a>5.6. Startup Settings</h3></div></div></div><div class="sect3" title="On Browser Startup, set Tor state to: Tor, Non-Tor"><div class="titlepage"><div><div><h4 class="title"><a id="id2671703"></a>On Browser Startup, set Tor state to: Tor, Non-Tor</h4></div></div></div><p>Options:
984) <span class="command"><strong>extensions.torbutton.restore_tor</strong></span>
985) </p><p>This option governs what Tor state tor is loaded in to.
986) <code class="function">torbutton_set_initial_state()</code> covers the case where the
987) browser did not crash, and <code class="function">torbutton_crash_recover()</code>
988) covers the case where the <a class="link" href="#crashobserver" title="@torproject.org/crash-observer;1">crash observer</a>
989) detected a crash.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
990) </p><p>
991)
992) Since the Tor state after a Firefox crash is unknown/indeterminate, this
993) setting helps to satisfy the <a class="link" href="#state">State Separation</a>
994) requirement in the event of Firefox crashes by ensuring all cookies,
995) settings and saved sessions are reloaded from a fixed Tor state.
996)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
997) </p></div><div class="sect3" title="Prevent session store from saving Non-Tor/Tor-loaded tabs"><div class="titlepage"><div><div><h4 class="title"><a id="id2671754"></a>Prevent session store from saving Non-Tor/Tor-loaded tabs</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
998) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.nonontor_sessionstore</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.notor_sessionstore</strong></span></td></tr></table><p>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
999) </p><p>If these options are enabled, the <a class="link" href="#tbsessionstore" title="@torproject.org/torbutton-ss-blocker;1">tbSessionStore.js</a> component uses the session
1000) store listeners to filter out the appropriate tabs before writing the session
1001) store data to disk.
1002) </p><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1003) This setting helps to satisfy the <a class="link" href="#disk">Disk Avoidance</a>
1004) requirement, and also helps to satisfy the <a class="link" href="#state">State Separation</a> requirement in the event of Firefox
1005) crashes.
1006)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1007) </p></div></div><div class="sect2" title="5.7. Shutdown Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2671812"></a>5.7. Shutdown Settings</h3></div></div></div><div class="sect3" title="Clear cookies on Tor/Non-Tor shutdown"><div class="titlepage"><div><div><h4 class="title"><a id="id2671818"></a>Clear cookies on Tor/Non-Tor shutdown</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.shutdown_method</strong></span>
1008) </p><p> This option variable can actually take 3 values: 0, 1, and 2. 0 means no
1009) cookie clearing, 1 means clear only during Tor-enabled shutdown, and 2 means
1010) clear for both Tor and Non-Tor shutdown. When set to 1 or 2, Torbutton listens
1011) for the <a class="ulink" href="http://developer.mozilla.org/en/docs/Observer_Notifications#Application_shutdown" target="_top">quit-application-granted</a> event in
1012) <a class="link" href="#crashobserver" title="@torproject.org/crash-observer;1">crash-observer.js</a> and use <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js" target="_top">@torproject.org/cookie-jar-selector;2</a>
1013) to clear out all cookies and all cookie jars upon shutdown.
1014) </p><p>
1015) This setting helps to satisfy the <a class="link" href="#state">State Separation</a> requirement.
1016) </p></div></div><div class="sect2" title="5.8. Header Settings"><div class="titlepage"><div><div><h3 class="title"><a id="id2671872"></a>5.8. Header Settings</h3></div></div></div><div class="sect3" title="Set user agent during Tor usage (crucial)"><div class="titlepage"><div><div><h4 class="title"><a id="id2671878"></a>Set user agent during Tor usage (crucial)</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1017) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.set_uagent</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.platform_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.oscpu_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.buildID_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.productsub_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.appname_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.appversion_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.useragent_override</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.useragent_vendor</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.useragent_vendorSub</strong></span></td></tr></table><p>
1018) </p><p>On face, user agent switching appears to be straight-forward in Firefox.
1019) It provides several options for controlling the browser user agent string:
1020) <span class="command"><strong>general.appname.override</strong></span>,
1021) <span class="command"><strong>general.appversion.override</strong></span>,
1022) <span class="command"><strong>general.platform.override</strong></span>,
1023) <span class="command"><strong>general.oscpu.override</strong></span>,
1024) <span class="command"><strong>general.productSub.override</strong></span>,
1025) <span class="command"><strong>general.buildID.override</strong></span>,
1026) <span class="command"><strong>general.useragent.override</strong></span>,
1027) <span class="command"><strong>general.useragent.vendor</strong></span>, and
1028) <span class="command"><strong>general.useragent.vendorSub</strong></span>. If
1029) the Torbutton preference <span class="command"><strong>extensions.torbutton.set_uagent</strong></span> is
1030) true, Torbutton copies all of the other above prefs into their corresponding
1031) browser preferences during Tor usage.</p><p>
1032)
1033) It also turns out that it is possible to detect the original Firefox version
1034) by <a class="ulink" href="http://ha.ckers.org/blog/20070516/read-firefox-settings-poc/" target="_top">inspecting
1035) certain resource:// files</a>. These cases are handled by Torbutton's
1036) <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">content policy</a>.
1037)
1038) </p><p>
1039) This setting helps to satisfy the <a class="link" href="#setpreservation">Anonymity Set Preservation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1040) </p></div><div class="sect3" title="Spoof US English Browser"><div class="titlepage"><div><div><h4 class="title"><a id="id2672052"></a>Spoof US English Browser</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1041) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.spoof_english</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.spoof_charset</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.spoof_language</strong></span></td></tr></table><p>
1042) </p><p> This option causes Torbutton to set
1043) <span class="command"><strong>general.useragent.locale</strong></span>
1044) <span class="command"><strong>intl.accept_languages</strong></span> to the value specified in
1045) <span class="command"><strong>extensions.torbutton.spoof_locale</strong></span>,
1046) <span class="command"><strong>extensions.torbutton.spoof_charset</strong></span> and
1047) <span class="command"><strong>extensions.torbutton.spoof_language</strong></span> during Tor usage, as
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1048) well as hooking <span class="command"><strong>navigator.language</strong></span> via its <a class="link" href="#jshooks" title="Hook Dangerous Javascript">javascript hooks</a>.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1049) </p><p>
1050) This setting helps to satisfy the <a class="link" href="#setpreservation">Anonymity Set Preservation</a> and <a class="link" href="#location">Location Neutrality</a> requirements.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1051) </p></div><div class="sect3" title="Referer Spoofing Options"><div class="titlepage"><div><div><h4 class="title"><a id="id2672145"></a>Referer Spoofing Options</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.refererspoof</strong></span>
1052) </p><p>
1053) This option variable has three values. If it is 0, "smart" referer spoofing is
1054) enabled. If it is 1, the referer behaves as normal. If it is 2, no referer is
1055) sent. The default value is 1. The smart referer spoofing is implemented by the
1056) <a class="link" href="#refspoofer" title="@torproject.org/torRefSpoofer;1">torRefSpoofer</a> component.
1057)
1058) </p><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1059) This setting also does not directly satisfy any Torbutton requirement, but
1060) some may desire to mask their referrer for general privacy concerns.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1061) </p></div><div class="sect3" title="Strip platform and language off of Google Search Box queries"><div class="titlepage"><div><div><h4 class="title"><a id="id2672179"></a>Strip platform and language off of Google Search Box queries</h4></div></div></div><p>Option: <span class="command"><strong>extensions.torbutton.fix_google_srch</strong></span>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1062) </p><p>
1063)
1064) This option causes Torbutton to use the <a class="ulink" href="https://wiki.mozilla.org/Search_Service:API" target="_top">@mozilla.org/browser/search-service;1</a>
1065) component to wrap the Google search plugin. On many platforms, notably Debian
1066) and Ubuntu, the Google search plugin is set to reveal a lot of language and
1067) platform information. This setting strips off that info while Tor is enabled.
1068)
1069) </p><p>
1070) This setting helps Torbutton to fulfill its <a class="link" href="#setpreservation">Anonymity Set Preservation</a> requirement.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1071) </p></div><div class="sect3" title="Automatically use an alternate search engine when presented with a Google Captcha"><div class="titlepage"><div><div><h4 class="title"><a id="id2672220"></a>Automatically use an alternate search engine when presented with a
1072) Google Captcha</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1073) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.asked_google_captcha</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.dodge_google_captcha</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.google_redir_url</strong></span></td></tr></table><p>
1074) </p><p>
1075)
1076) Google's search engine has rate limiting features that cause it to
1077) <a class="ulink" href="http://googleonlinesecurity.blogspot.com/2007/07/reason-behind-were-sorry-message.html" target="_top">present
1078) captchas</a> and sometimes even outright ban IPs that issue large numbers
1079) of search queries, especially if a lot of these queries appear to be searching
1080) for software vulnerabilities or unprotected comment areas.
1081)
1082) </p><p>
1083)
1084) Despite multiple discussions with Google, we were unable to come to a solution
1085) or any form of compromise that would reduce the number of captchas and
1086) outright bans seen by Tor users issuing regular queries.
1087)
1088) </p><p>
1089) As a result, we've implemented this option as an <a class="ulink" href="https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers" target="_top">'http-on-modify-request'</a>
1090) http observer to optionally redirect banned or captcha-triggering Google
1091) queries to search engines that do not rate limit Tor users. The current
|
Update FF bugs in design do...
Mike Perry authored 13 years ago
|
1092) options are duckduckgo.com, ixquick.com, bing.com, yahoo.com and scroogle.org. These are
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1093) encoded in the preferences
|
Update FF bugs in design do...
Mike Perry authored 13 years ago
|
1094) <span class="command"><strong>extensions.torbutton.redir_url.[1-5]</strong></span>.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1095)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1096) </p></div><div class="sect3" title="Store SSL/CA Certs in separate jars for Tor/Non-Tor (recommended)"><div class="titlepage"><div><div><h4 class="title"><a id="id2672300"></a>Store SSL/CA Certs in separate jars for Tor/Non-Tor (recommended)</h4></div></div></div><p>Options:
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1097) </p><table border="0" summary="Simple list" class="simplelist"><tr><td><span class="command"><strong>extensions.torbutton.jar_certs</strong></span></td></tr><tr><td><span class="command"><strong>extensions.torbutton.jar_ca_certs</strong></span></td></tr></table><p>
1098) </p><p>
1099)
1100) These settings govern if Torbutton attempts to isolate the user's SSL
1101) certificates into separate jars for each Tor state. This isolation is
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1102) implemented in <code class="function">torbutton_jar_certs()</code> in <a class="ulink" href="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js" target="_top">chrome/content/torbutton.js</a>,
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1103) which calls <code class="function">torbutton_jar_cert_type()</code> and
1104) <code class="function">torbutton_unjar_cert_type()</code> for each certificate type in
1105) the <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/security/nsscertcache;1" target="_top">@mozilla.org/security/nsscertcache;1</a>.
1106) Certificates are deleted from and imported to the <a class="ulink" href="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/security/x509certdb;1" target="_top">@mozilla.org/security/x509certdb;1</a>.
1107) </p><p>
1108) The first time this pref is used, a backup of the user's certificates is
1109) created in their profile directory under the name
1110) <code class="filename">cert8.db.bak</code>. This file can be copied back to
1111) <code class="filename">cert8.db</code> to fully restore the original state of the
1112) user's certificates in the event of any error.
1113) </p><p>
1114) Since exit nodes and malicious sites can insert content elements sourced to
1115) specific SSL sites to query if a user has a certain certificate,
1116) this setting helps to satisfy the <a class="link" href="#state">State
1117) Separation</a> requirement of Torbutton. Unfortunately, <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435159" target="_top">Firefox Bug
1118) 435159</a> prevents it from functioning correctly in the event of rapid Tor toggle, so it
1119) is currently not exposed via the preferences UI.
1120)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1121) </p></div></div></div><div class="sect1" title="6. Relevant Firefox Bugs"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="FirefoxBugs"></a>6. Relevant Firefox Bugs</h2></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1122)
1123) </p><div class="sect2" title="6.1. Bugs impacting security"><div class="titlepage"><div><div><h3 class="title"><a id="FirefoxSecurity"></a>6.1. Bugs impacting security</h3></div></div></div><p>
1124)
1125) Torbutton has to work around a number of Firefox bugs that impact its
1126) security. Most of these are mentioned elsewhere in this document, but they
1127) have also been gathered here for reference. In order of decreasing severity,
1128) they are:
1129)
1130) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=429070" target="_top">Bug 429070 - exposing
1131) Components.interfaces to untrusted content leaks information about installed
1132) extensions</a><p>
1133) <a class="ulink" href="http://pseudo-flaw.net/" target="_top">Gregory Fleischer</a> demonstrated at Defcon 17 that these interfaces can
1134) also be used to <a class="ulink" href="http://pseudo-flaw.net/tor/torbutton/fingerprint-firefox.html" target="_top">fingerprint
1135) Firefox down the to the minor version</a>. Note that his test has not been
1136) updated since 3.5.3, hence it reports 3.5.3 for more recent Firefoxes. This
1137) bug interferes with Torbutton's ability to satisfy its <a class="link" href="#setpreservation">Anonymity Set Preservation</a> requirement.
1138) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=280661" target="_top">Bug 280661 - SOCKS proxy server
1139) connection timeout hard-coded</a><p>
1140)
1141) This bug prevents us from using the Firefox SOCKS layer directly, and
1142) currently requires us to ship an auxiliary HTTP proxy called <a class="ulink" href="http://www.pps.jussieu.fr/~jch/software/polipo/" target="_top">Polipo</a>. If this
1143) patch were landed, we would no longer need to ship Polipo, which has a number
1144) of privacy and security issues of its own (in addition to being unmaintained).
1145)
1146) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=418986" target="_top">Bug 418986 - window.screen
1147) provides a large amount of identifiable information</a><p>
1148)
1149) As <a class="link" href="#fingerprinting">mentioned above</a>, a large amount of
1150) information is available from <a class="ulink" href="http://developer.mozilla.org/en/docs/DOM:window.screen" target="_top">window.screen</a>.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1151) The most sensitive data to anonymity is actually that which is not used in
|
Update FF bugs in design do...
Mike Perry authored 13 years ago
|
1152) rendering - such as desktop resolution, and window decoration size.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1153) Currently, there is no way to obscure this information without Javascript
|
Update FF bugs in design do...
Mike Perry authored 13 years ago
|
1154) hooking. In addition, many of this same desktop and window decoration
1155) resolution information is available via <a class="ulink" href="https://developer.mozilla.org/En/CSS/Media_queries" target="_top">CSS Media
1156) Queries</a>, so perhaps some more lower-level rendering controls or
1157) preferences need to be provided. These issues interfere with Torbutton's
1158) ability to fulfill its <a class="link" href="#setpreservation">Anonymity Set
1159) Preservation</a> requirement.
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1160)
1161) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435159" target="_top">Bug 435159 -
1162) nsNSSCertificateDB::DeleteCertificate has race conditions</a><p>
1163)
1164) In Torbutton 1.2.0rc1, code was added to attempt to isolate SSL certificates
1165) the user has installed. Unfortunately, the method call to delete a certificate
1166) from the current certificate database acts lazily: it only sets a variable
1167) that marks a cert for deletion later, and it is not cleared if that
1168) certificate is re-added. This means that if the Tor state is toggled quickly,
1169) that certificate could remain present until it is re-inserted (causing an
1170) error dialog), and worse, it would still be deleted after that. The lack of
1171) this functionality is considered a Torbutton security bug because cert
1172) isolation is considered a <a class="link" href="#state">State Separation</a>
1173) feature.
1174)
|
Update design html.
Mike Perry authored 13 years ago
|
1175) </p></li><li class="listitem">Give more visibility into and control over TLS
1176) negotiation
1177) <p>
1178)
1179) There are several <a class="ulink" href="https://trac.torproject.org/projects/tor/ticket/2482" target="_top">TLS issues
1180) impacting Torbutton security</a>. It is not clear if these should be one
1181) Firefox bug or several, but in particular we need better control over various
1182) aspects of TLS connections. Firefox currently provides no observer capable of
1183) extracting TLS parameters or certificates early enough to cancel a TLS
1184) request. We would like to be able to provide <a class="ulink" href="https://www.eff.org/https-everywhere" target="_top">HTTPS-Everywhere</a> users with
1185) the ability to <a class="ulink" href="https://trac.torproject.org/projects/tor/wiki/HTTPSEverywhere/SSLObservatorySubmission" target="_top">have
1186) their certificates audited</a> by a <a class="ulink" href="http://www.networknotary.org/" target="_top">Perspectives</a>-style set of
1187) notaries. The problem with this is that the API observer points do not exist
1188) for any Firefox addon to actually block authentication token submission over a
1189) TLS channel, so every addon to date (including Perspectives) is actually
1190) providing users with notification *after* their authentication tokens have
1191) already been compromised. This obviously needs to be fixed.
1192) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=575230" target="_top">Bug 575230 - Provide option to
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1193) reduce precision of Date()</a><p>
1194)
1195) Currently it is possible to <a class="ulink" href="http://arstechnica.com/tech-policy/news/2010/02/firm-uses-typing-cadence-to-finger-unauthorized-users.ars" target="_top">fingerprint
1196) users based on their typing cadence</a> using the high precision timer
1197) available to javascript. Using this same precision, it is possible to compute
1198) an identifier based upon the clock drift of the client from some nominal
1199) source. The latter is not much of a concern for Tor users, as the variable
1200) delay to load and run a page is measured on the order of seconds, but the high
1201) precision timer can still be used to fingerprint aspects of a browser's
1202) javascript engine and processor, and apparently also a user's typing cadence.
1203) This bug hinders Torbutton's ability to satisfy its <a class="link" href="#setpreservation">Anonymity Set Preservation</a> requirement.
1204)
|
Update FF bugs in design do...
Mike Perry authored 13 years ago
|
1205) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=122752" target="_top">SOCKS
1206) Username/Password Support</a><p>
1207) We need <a class="ulink" href="https://developer.mozilla.org/en/nsIProxyInfo" target="_top">Firefox
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1208) APIs</a> or about:config settings to control the SOCKS Username and
|
Update FF bugs in design do...
Mike Perry authored 13 years ago
|
1209) Password fields. The reason why we need this support is to utilize an (as yet
1210) unimplemented) scheme to separate Tor traffic based <a class="ulink" href="https://gitweb.torproject.org/torspec.git/blob_plain/HEAD:/proposals/171-separate-streams.txt" target="_top">on
1211) SOCKS username/password</a>.
1212) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=409737" target="_top">Bug 409737 -
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1213) javascript.enabled and docShell.allowJavascript do not disable all event
1214) handlers</a><p>
1215)
1216) This bug allows pages to execute javascript via addEventListener and perhaps
1217) other callbacks. In order to prevent this bug from enabling an attacker to
1218) break the <a class="link" href="#isolation">Network Isolation</a> requirement,
1219) Torbutton 1.1.13 began blocking popups and history manipulation from different
1220) Tor states. So long as there are no ways to open popups or redirect the user
1221) to a new page, the <a class="link" href="#contentpolicy" title="@torproject.org/cssblocker;1 - components/cssblocker.js">Torbutton content
1222) policy</a> should block Javascript network access. However, if there are
1223) ways to open popups or perform redirects such that Torbutton cannot block
1224) them, pages may still have free reign to break that requirement and reveal a
1225) user's original IP address.
1226)
1227) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=448743" target="_top">Bug 448743 -
1228) Decouple general.useragent.locale from spoofing of navigator.language</a><p>
1229)
1230) Currently, Torbutton spoofs the <span class="command"><strong>navigator.language</strong></span>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1231) attribute via <a class="link" href="#jshooks" title="Hook Dangerous Javascript">Javascript hooks</a>. Unfortunately,
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1232) these do not work on Firefox 3. It would be ideal to have
1233) a pref to set this value (something like a
1234) <span class="command"><strong>general.useragent.override.locale</strong></span>),
1235) to avoid fragmenting the anonymity set of users of foreign locales. This issue
1236) impedes Torbutton from fully meeting its <a class="link" href="#setpreservation">Anonymity Set Preservation</a>
1237) requirement on Firefox 3.
1238)
1239) </p></li></ol></div></div><div class="sect2" title="6.2. Bugs blocking functionality"><div class="titlepage"><div><div><h3 class="title"><a id="FirefoxWishlist"></a>6.2. Bugs blocking functionality</h3></div></div></div><p>
1240) The following bugs impact Torbutton and similar extensions' functionality.
1241) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=445696" target="_top">Bug 445696 -
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1242) Extensions cannot determine if Firefox is full screen</a><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1243)
1244) The windowState property of <a class="ulink" href="https://developer.mozilla.org/en/XUL/window" target="_top">ChromeWindows</a> does not accurately reflect the true
1245) state of the window in some cases on Linux. This causes Torbutton to attempt
1246) to resize maximized and minimized windows when it should not.
1247)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1248) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=629820" target="_top">nsIContentPolicy::shouldLoad not
1249) called for web request in Firefox Mobile</a><p>
1250)
1251) The new <a class="ulink" href="https://wiki.mozilla.org/Mobile/Fennec/Extensions/Electrolysis" target="_top">Electrolysis</a>
1252) multiprocess system appears to have some pretty rough edge cases with respect
1253) to registering XPCOM category managers such as the nsIContentPolicy, which
1254) make it difficult to do a straight-forward port of Torbutton or
1255) HTTPS-Everywhere to Firefox Mobile. It probably also has similar issues with
1256) wrapping existing <a class="link" href="#hookedxpcom" title="2.1. Hooked Components">Firefox XPCOM components</a>,
1257) which will also cause more problems for porting Torbutton.
1258)
1259) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=290456" target="_top">Bug 290456 -
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1260) Block/clear Flash MX "cookies" as well</a><p>
1261)
1262) Today, it is possible to allow plugins if you have a transparent proxy such as
1263) <a class="ulink" href="http://anonymityanywhere.com/incognito/" target="_top">Incognito</a> to prevent proxy bypass. However, flash cookies can still be used to
1264) link your Tor and Non-Tor activity, and this reveal your IP to an adversary
1265) that does so. This can be solved by manually removing your flash cookies (like
1266) <a class="ulink" href="https://addons.mozilla.org/en-US/firefox/addon/6623" target="_top">BetterPrivacy</a> does), but
1267) it would be nice if there was a standard way to do this from a Firefox API.
1268)
1269) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=417869" target="_top">Bug 417869 -
1270) Browser context is difficult to obtain from many XPCOM callbacks</a><p>
1271)
1272) It is difficult to determine which tabbrowser many XPCOM callbacks originate
1273) from, and in some cases absolutely no context information is provided at all.
1274) While this doesn't have much of an effect on Torbutton, it does make writing
1275) extensions that would like to do per-tab settings and content filters (such as
1276) FoxyProxy) difficult to impossible to implement securely.
1277)
1278) </p></li></ol></div></div><div class="sect2" title="6.3. Low Priority Bugs"><div class="titlepage"><div><div><h3 class="title"><a id="FirefoxMiscBugs"></a>6.3. Low Priority Bugs</h3></div></div></div><p>
1279) The following bugs have an effect upon Torbutton, but are superseded by more
1280) practical and more easily fixable variant bugs above; or have stable, simple
1281) workarounds.
1282) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=435151" target="_top">Bug 435151 - XPCSafeJSObjectWrapper breaks evalInSandbox</a><p>
1283)
1284) Under Firefox 3, the XPCSafeJSObjectWrapper breaks when you try to use
1285) constructors of classes defined from within the scope of the sandbox, among
1286) other things. This prevents Torbutton from applying the Timezone hooks under
1287) Firefox 3, but a better solution for Torbutton's specific date hooking needs
1288) would be a fix for the above mentioned Bug 392274. Of course, many more
1289) extensions may be interested in the sandbox hooking functionality working
1290) properly though.
1291)
1292) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=440892" target="_top">Bug 440892 -
1293) network.protocol-handler.warn-external are ignored</a><p>
1294)
1295) Sometime in the Firefox 3 development cycle, the preferences that governed
1296) warning a user when external apps were launched got disconnected from the code
1297) that does the launching. Torbutton depended on these prefs to prevent websites
1298) from launching specially crafted documents and application arguments that
1299) caused Proxy Bypass. We currently work around this issue by <a class="link" href="#appblocker" title="@mozilla.org/uriloader/external-protocol-service;1 , @mozilla.org/uriloader/external-helper-app-service;1, and @mozilla.org/mime;1 - components/external-app-blocker.js">wrapping the app launching components</a> to present a
1300) popup before launching external apps while Tor is enabled. While this works,
1301) it would be nice if these prefs were either fixed or removed.
1302)
1303) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=437014" target="_top">Bug 437014 -
1304) nsIContentPolicy::shouldLoad no longer called for favicons</a><p>
1305)
1306) Firefox 3.0 stopped calling the shouldLoad call of content policy for favicon
1307) loads. Torbutton had relied on this call to block favicon loads for opposite
1308) Tor states. The workaround it employs for Firefox 3 is to cancel the request
1309) when it arrives in the <span class="command"><strong>torbutton_http_observer</strong></span> used for
1310) blocking full page plugin loads. This seems to work just fine, but is a bit
1311) dirty.
1312)
1313) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=309524" target="_top">Bug 309524</a>
1314) and <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=380556" target="_top">Bug
1315) 380556</a> - nsIContentPolicy::shouldProcess is not called.
1316) <p>
1317)
1318) This is a call that would be useful to develop a better workaround for the
1319) allowPlugins issue above. If the content policy were called before a URL was
1320) handed over to a plugin or helper app, it would make the workaround for the
1321) above allowPlugins bug a lot cleaner. Obviously this bug is not as severe as
1322) the others though, but it might be nice to have this API as a backup.
1323)
1324) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=401296" target="_top">Bug 401296 - docShell.allowPlugins
1325) not honored for direct links</a> (Perhaps subset of <a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=282106" target="_top">Bug 282106</a>?)
1326) <p>
1327)
1328) Similar to the javascript plugin disabling attribute, the plugin disabling
1329) attribute is also not perfect — it is ignored for direct links to plugin
1330) handled content, as well as meta-refreshes to plugin handled content. This
1331) requires Torbutton to listen to a number of different http events to intercept
1332) plugin-related mime type URLs and cancel their requests. Again, since plugins
1333) are quite horrible about obeying proxy settings, loading a plugin pretty much
1334) ensures a way to break the <a class="link" href="#isolation">Network Isolation</a>
1335) requirement and reveal a user's original IP address. Torbutton's code to
1336) perform this workaround has been subverted at least once already by Kyle
1337) Williams.
1338)
1339) </p></li><li class="listitem"><a class="ulink" href="https://bugzilla.mozilla.org/show_bug.cgi?id=419598" target="_top">Bug 419598 - 'var
1340) Date' is deletable</a><p>
1341)
1342) Based on Page 62 of the <a class="ulink" href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-262.pdf" target="_top">ECMA-262
1343) Javascript spec</a>, it seems like it should be possible to do something
1344) like the following to prevent the Date object from being unmasked:
1345) </p><pre class="screen">
1346) with(window) {
1347) var Date = fakeDate;
1348) var otherVariable = 42;
1349) }
1350)
1351) delete window.Date; // Should fail. Instead succeeds, revealing original Date.
1352) delete window.otherVariable; // Fails, leaving window.otherVariable set to 42.
1353) </pre><p>
1354)
1355) From the ECMA-262 spec:
1356)
1357) </p><div class="blockquote"><blockquote class="blockquote">
1358) If the variable statement occurs inside a FunctionDeclaration, the variables
1359) are defined with function-local scope in that function, as described in
1360) s10.1.3. Otherwise, they are defined with global scope (that is, they are
1361) created as members of the global object, as described in 10.1.3) using
1362) property attributes { DontDelete }. Variables are created when the execution
1363) scope is entered. A Block does not define a new execution scope. Only Program
1364) and FunctionDeclaration produce a new scope. Variables are initialized to
1365) undefined when created. A variable with an Initialiser is assigned the value
1366) of its AssignmentExpression when the VariableStatement is executed, not when
1367) the variable is created.
1368) </blockquote></div><p>
1369)
1370) In fact, this is exactly how the with statement with a variable declaration
1371) behaves <span class="emphasis"><em>for all other variables other than ones that shadow system
1372) variables</em></span>. Some variables (such as
1373) <span class="command"><strong>window.screen</strong></span>, and <span class="command"><strong>window.history</strong></span>) can't
1374) even be shadowed in this way, and give an error about lacking a setter. If
1375) such shadowing were possible, it would greatly simplify the Javascript hooking
1376) code, which currently relies on undocumented semantics of
1377) <span class="command"><strong>__proto__</strong></span> to copy the original values in the event of a
1378) delete. This <span class="command"><strong>__proto__</strong></span> hack unfortunately does not work for
1379) the Date object though.
1380)
1381) </p></li></ol></div></div></div><div class="sect1" title="7. Testing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="TestPlan"></a>7. Testing</h2></div></div></div><p>
1382)
1383) The purpose of this section is to cover all the known ways that Tor browser
1384) security can be subverted from a penetration testing perspective. The hope
1385) is that it will be useful both for creating a "Tor Safety Check"
1386) page, and for developing novel tests and actively attacking Torbutton with the
1387) goal of finding vulnerabilities in either it or the Mozilla components,
1388) interfaces and settings upon which it relies.
1389)
1390) </p><div class="sect2" title="7.1. Single state testing"><div class="titlepage"><div><div><h3 class="title"><a id="SingleStateTesting"></a>7.1. Single state testing</h3></div></div></div><p>
1391)
1392) Torbutton is a complicated piece of software. During development, changes to
1393) one component can affect a whole slough of unrelated features. A number of
1394) aggregated test suites exist that can be used to test for regressions in
1395) Torbutton and to help aid in the development of Torbutton-like addons and
1396) other privacy modifications of other browsers. Some of these test suites exist
1397) as a single automated page, while others are a series of pages you must visit
1398) individually. They are provided here for reference and future regression
1399) testing, and also in the hope that some brave soul will one day decide to
1400) combine them into a comprehensive automated test suite.
1401)
1402) </p><div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"><a class="ulink" href="http://decloak.net/" target="_top">Decloak.net</a><p>
1403)
1404) Decloak.net is the canonical source of plugin and external-application based
1405) proxy-bypass exploits. It is a fully automated test suite maintained by <a class="ulink" href="http://digitaloffense.net/" target="_top">HD Moore</a> as a service for people to
1406) use to test their anonymity systems.
1407)
1408) </p></li><li class="listitem"><a class="ulink" href="http://deanonymizer.com/" target="_top">Deanonymizer.com</a><p>
1409)
1410) Deanonymizer.com is another automated test suite that tests for proxy bypass
1411) and other information disclosure vulnerabilities. It is maintained by Kyle
1412) Williams, the author of <a class="ulink" href="http://www.janusvm.com/" target="_top">JanusVM</a>
1413) and <a class="ulink" href="http://www.januspa.com/" target="_top">JanusPA</a>.
1414)
1415) </p></li><li class="listitem"><a class="ulink" href="https://www.jondos.de/en/anontest" target="_top">JonDos
1416) AnonTest</a><p>
1417)
1418) The <a class="ulink" href="https://www.jondos.de" target="_top">JonDos people</a> also provide an
1419) anonymity tester. It is more focused on HTTP headers than plugin bypass, and
1420) points out a couple of headers Torbutton could do a better job with
1421) obfuscating.
1422)
1423) </p></li><li class="listitem"><a class="ulink" href="http://browserspy.dk" target="_top">Browserspy.dk</a><p>
1424)
1425) Browserspy.dk provides a tremendous collection of browser fingerprinting and
1426) general privacy tests. Unfortunately they are only available one page at a
1427) time, and there is not really solid feedback on good vs bad behavior in
1428) the test results.
1429)
1430) </p></li><li class="listitem"><a class="ulink" href="http://analyze.privacy.net/" target="_top">Privacy
1431) Analyzer</a><p>
1432)
1433) The Privacy Analyzer provides a dump of all sorts of browser attributes and
1434) settings that it detects, including some information on your origin IP
1435) address. Its page layout and lack of good vs bad test result feedback makes it
1436) not as useful as a user-facing testing tool, but it does provide some
1437) interesting checks in a single page.
1438)
1439) </p></li><li class="listitem"><a class="ulink" href="http://ha.ckers.org/mr-t/" target="_top">Mr. T</a><p>
1440)
1441) Mr. T is a collection of browser fingerprinting and deanonymization exploits
1442) discovered by the <a class="ulink" href="http://ha.ckers.org" target="_top">ha.ckers.org</a> crew
1443) and others. It is also not as user friendly as some of the above tests, but it
1444) is a useful collection.
1445)
1446) </p></li><li class="listitem">Gregory Fleischer's <a class="ulink" href="http://pseudo-flaw.net/content/tor/torbutton/" target="_top">Torbutton</a> and
1447) <a class="ulink" href="http://pseudo-flaw.net/content/defcon/dc-17-demos/d.html" target="_top">Defcon
1448) 17</a> Test Cases
1449) <p>
1450)
1451) Gregory Fleischer has been hacking and testing Firefox and Torbutton privacy
1452) issues for the past 2 years. He has an excellent collection of all his test
1453) cases that can be used for regression testing. In his Defcon work, he
1454) demonstrates ways to infer Firefox version based on arcane browser properties.
1455) We are still trying to determine the best way to address some of those test
1456) cases.
1457)
1458) </p></li><li class="listitem"><a class="ulink" href="https://torcheck.xenobite.eu/index.php" target="_top">Xenobite's
1459) TorCheck Page</a><p>
1460)
1461) This page checks to ensure you are using a valid Tor exit node and checks for
1462) some basic browser properties related to privacy. It is not very fine-grained
1463) or complete, but it is automated and could be turned into something useful
1464) with a bit of work.
1465)
1466) </p></li></ol></div><p>
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1467) </p></div><div class="sect2" title="7.2. Multi-state testing"><div class="titlepage"><div><div><h3 class="title"><a id="id2673409"></a>7.2. Multi-state testing</h3></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1468)
1469) The tests in this section are geared towards a page that would instruct the
1470) user to toggle their Tor state after the fetch and perform some operations:
1471) mouseovers, stray clicks, and potentially reloads.
1472)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1473) </p><div class="sect3" title="Cookies and Cache Correlation"><div class="titlepage"><div><div><h4 class="title"><a id="id2673421"></a>Cookies and Cache Correlation</h4></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1474) The most obvious test is to set a cookie, ask the user to toggle tor, and then
1475) have them reload the page. The cookie should no longer be set if they are
1476) using the default Torbutton settings. In addition, it is possible to leverage
1477) the cache to <a class="ulink" href="http://crypto.stanford.edu/sameorigin/safecachetest.html" target="_top">store unique
1478) identifiers</a>. The default settings of Torbutton should also protect
1479) against these from persisting across Tor Toggle.
1480)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1481) </p></div><div class="sect3" title="Javascript timers and event handlers"><div class="titlepage"><div><div><h4 class="title"><a id="id2673444"></a>Javascript timers and event handlers</h4></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1482)
1483) Javascript can set timers and register event handlers in the hopes of fetching
1484) URLs after the user has toggled Torbutton.
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1485) </p></div><div class="sect3" title="CSS Popups and non-script Dynamic Content"><div class="titlepage"><div><div><h4 class="title"><a id="id2673456"></a>CSS Popups and non-script Dynamic Content</h4></div></div></div><p>
|
add in the torbutton design...
Andrew Lewman authored 14 years ago
|
1486)
1487) Even if Javascript is disabled, CSS is still able to
1488) <a class="ulink" href="http://www.tjkdesign.com/articles/css%20pop%20ups/" target="_top">create popup-like
1489) windows</a>
1490) via the 'onmouseover' CSS attribute, which can cause arbitrary browser
1491) activity as soon as the mouse enters into the content window. It is also
1492) possible for meta-refresh tags to set timers long enough to make it likely
1493) that the user has toggled Tor before fetching content.
1494)
1495) </p></div></div><div class="sect2" title="7.3. Active testing (aka How to Hack Torbutton)"><div class="titlepage"><div><div><h3 class="title"><a id="HackTorbutton"></a>7.3. Active testing (aka How to Hack Torbutton)</h3></div></div></div><p>
1496)
1497) The idea behind active testing is to discover vulnerabilities in Torbutton to
1498) bypass proxy settings, run script in an opposite Tor state, store unique
1499) identifiers, leak location information, or otherwise violate <a class="link" href="#requirements" title="1.2. Torbutton Requirements">its requirements</a>. Torbutton has ventured out
1500) into a strange and new security landscape. It depends on Firefox mechanisms
1501) that haven't necessarily been audited for security, certainly not for the
1502) threat model that Torbutton seeks to address. As such, it and the interfaces
1503) it depends upon still need a 'trial by fire' typical of new technologies. This
1504) section of the document was written with the intention of making that period
1505) as fast as possible. Please help us get through this period by considering
1506) these attacks, playing with them, and reporting what you find (and potentially
1507) submitting the test cases back to be run in the standard batch of Torbutton
1508) tests.
1509)
|
Update Torbutton design doc.
Mike Perry authored 13 years ago
|
1510) </p><div class="sect3" title="Some suggested vectors to investigate"><div class="titlepage"><div><div><h4 class="title"><a id="id2673511"></a>Some suggested vectors to investigate</h4></div></div></div><p>
|