759dcea9ed99f8f0c37ffbe5dbe478170550a3d2
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1) <?xml version="1.0" encoding="ISO-8859-1"?>
2) <!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
3)      "file:///usr/share/sgml/docbook/xml-dtd-4.4-1.0-30.1/docbookx.dtd">
4) 
5) <article id="design">
6)  <articleinfo>
7)   <title>Torbutton Design Documentation</title>
8)    <author>
9)     <firstname>Mike</firstname><surname>Perry</surname>
10)     <affiliation>
11)      <address><email>mikeperry.fscked/org</email></address>
12)     </affiliation>
13)    </author>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

14)    <pubdate>Apr 3 2011</pubdate>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

15)  </articleinfo>
16) 
17) <sect1>
18)   <title>Introduction</title>
19)   <para>
20) 
21) This document describes the goals, operation, and testing procedures of the
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

22) Torbutton Firefox extension. It is current as of Torbutton 1.3.2.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

23) 
24)   </para>
25)   <sect2 id="adversary">
26)    <title>Adversary Model</title>
27)    <para>
28) 
29) A Tor web browser adversary has a number of goals, capabilities, and attack
30) types that can be used to guide us towards a set of requirements for the
31) Torbutton extension. Let's start with the goals.
32) 
33)    </para>
34)    <sect3 id="adversarygoals">
35)     <title>Adversary Goals</title>
36)     <orderedlist>
37) <!-- These aren't really commands.. But it's the closest I could find in an
38) acceptable style.. Don't really want to make my own stylesheet -->
39)      <listitem><command>Bypassing proxy settings</command>
40)      <para>The adversary's primary goal is direct compromise and bypass of 
41) Tor, causing the user to directly connect to an IP of the adversary's
42) choosing.</para>
43)      </listitem>
44)      <listitem><command>Correlation of Tor vs Non-Tor Activity</command>
45)      <para>If direct proxy bypass is not possible, the adversary will likely
46) happily settle for the ability to correlate something a user did via Tor with
47) their non-Tor activity. This can be done with cookies, cache identifiers,
48) javascript events, and even CSS. Sometimes the fact that a user uses Tor may
49) be enough for some authorities.</para>
50)      </listitem>
51)      <listitem><command>History disclosure</command>
52)      <para>
53) The adversary may also be interested in history disclosure: the ability to
54) query a user's history to see if they have issued certain censored search
55) queries, or visited censored sites.
56)      </para>
57)      </listitem>
58)      <listitem><command>Location information</command>
59)      <para>
60) 
61) Location information such as timezone and locality can be useful for the
62) adversary to determine if a user is in fact originating from one of the
63) regions they are attempting to control, or to zero-in on the geographical
64) location of a particular dissident or whistleblower.
65) 
66)      </para>
67)      </listitem>
68)      <listitem><command>Miscellaneous anonymity set reduction</command>
69)      <para>
70) 
71) Anonymity set reduction is also useful in attempting to zero in on a
72) particular individual. If the dissident or whistleblower is using a rare build
73) of Firefox for an obscure operating system, this can be very useful
74) information for tracking them down, or at least <link
75) linkend="fingerprinting">tracking their activities</link>.
76) 
77)      </para>
78)      </listitem>
79)      <listitem><command>History records and other on-disk
80) information</command>
81)      <para>
82) In some cases, the adversary may opt for a heavy-handed approach, such as
83) seizing the computers of all Tor users in an area (especially after narrowing
84) the field by the above two pieces of information). History records and cache
85) data are the primary goals here.
86)      </para>
87)      </listitem>
88)     </orderedlist>
89)    </sect3>
90) 
91)    <sect3 id="adversarypositioning">
92)     <title>Adversary Capabilities - Positioning</title>
93)     <para>
94) The adversary can position themselves at a number of different locations in
95) order to execute their attacks.
96)     </para>
97)     <orderedlist>
98)      <listitem><command>Exit Node or Upstream Router</command>
99)      <para>
100) The adversary can run exit nodes, or alternatively, they may control routers
101) upstream of exit nodes. Both of these scenarios have been observed in the
102) wild.
103)      </para>
104)      </listitem>
105)      <listitem><command>Adservers and/or Malicious Websites</command>
106)      <para>
107) The adversary can also run websites, or more likely, they can contract out
108) ad space from a number of different adservers and inject content that way. For
109) some users, the adversary may be the adservers themselves. It is not
110) inconceivable that adservers may try to subvert or reduce a user's anonymity 
111) through Tor for marketing purposes.
112)      </para>
113)      </listitem>
114)      <listitem><command>Local Network/ISP/Upstream Router</command>
115)      <para>
116) The adversary can also inject malicious content at the user's upstream router
117) when they have Tor disabled, in an attempt to correlate their Tor and Non-Tor
118) activity.
119)      </para>
120)      </listitem>
121)      <listitem><command>Physical Access</command>
122)      <para>
123) Some users face adversaries with intermittent or constant physical access.
124) Users in Internet cafes, for example, face such a threat. In addition, in
125) countries where simply using tools like Tor is illegal, users may face
126) confiscation of their computer equipment for excessive Tor usage or just
127) general suspicion.
128)      </para>
129)      </listitem>
130)     </orderedlist>
131)    </sect3>
132) 
133)    <sect3 id="attacks">
134)     <title>Adversary Capabilities - Attacks</title>
135)     <para>
136) 
137) The adversary can perform the following attacks from a number of different 
138) positions to accomplish various aspects of their goals. It should be noted
139) that many of these attacks (especially those involving IP address leakage) are
140) often performed by accident by websites that simply have Javascript, dynamic 
141) CSS elements, and plugins. Others are performed by adservers seeking to
142) correlate users' activity across different IP addresses, and still others are
143) performed by malicious agents on the Tor network and at national firewalls.
144) 
145)     </para>
146)     <orderedlist>
147)      <listitem><command>Inserting Javascript</command>
148)      <para>
149) If not properly disabled, Javascript event handlers and timers
150) can cause the browser to perform network activity after Tor has been disabled,
151) thus allowing the adversary to correlate Tor and Non-Tor activity and reveal
152) a user's non-Tor IP address. Javascript
153) also allows the adversary to execute <ulink
154) url="http://whattheinternetknowsaboutyou.com/">history disclosure attacks</ulink>:
155) to query the history via the different attributes of 'visited' links to search
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

156) for particular Google queries, sites, or even to <ulink
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

157) url="http://www.mikeonads.com/2008/07/13/using-your-browser-url-history-estimate-gender/">profile
158) users based on gender and other classifications</ulink>. Finally,
159) Javascript can be used to query the user's timezone via the
160) <function>Date()</function> object, and to reduce the anonymity set by querying
161) the <function>navigator</function> object for operating system, CPU, locale, 
162) and user agent information.
163)      </para>
164)      </listitem>
165) 
166)      <listitem><command>Inserting Plugins</command>
167)      <para>
168) 
169) Plugins are abysmal at obeying the proxy settings of the browser. Every plugin
170) capable of performing network activity that the author has
171) investigated is also capable of performing network activity independent of
172) browser proxy settings - and often independent of its own proxy settings.
173) Sites that have plugin content don't even have to be malicious to obtain a
174) user's
175) Non-Tor IP (it usually leaks by itself), though <ulink
176) url="http://decloak.net">plenty of active
177) exploits</ulink> are possible as well. In addition, plugins can be used to store unique identifiers that are more
178) difficult to clear than standard cookies. 
179) <ulink url="http://epic.org/privacy/cookies/flash.html">Flash-based
180) cookies</ulink> fall into this category, but there are likely numerous other
181) examples.
182) 
183)      </para>
184)      </listitem>
185)      <listitem><command>Inserting CSS</command>
186)      <para>
187) 
188) CSS can also be used to correlate Tor and Non-Tor activity and reveal a user's
189) Non-Tor IP address, via the usage of
190) <ulink url="http://www.tjkdesign.com/articles/css%20pop%20ups/">CSS
191) popups</ulink> - essentially CSS-based event handlers that fetch content via
192) CSS's onmouseover attribute. If these popups are allowed to perform network
193) activity in a different Tor state than they were loaded in, they can easily
194) correlate Tor and Non-Tor activity and reveal a user's IP address. In
195) addition, CSS can also be used without Javascript to perform <ulink
196) url="http://ha.ckers.org/weird/CSS-history.cgi">CSS-only history disclosure
197) attacks</ulink>.
198)      </para>
199)      </listitem>
200)      <listitem><command>Read and insert cookies</command>
201)      <para>
202) 
203) An adversary in a position to perform MITM content alteration can inject
204) document content elements to both read and inject cookies for
205) arbitrary domains. In fact, many "SSL secured" websites are vulnerable to this
206) sort of <ulink url="http://seclists.org/bugtraq/2007/Aug/0070.html">active
207) sidejacking</ulink>.
208) 
209)      </para>
210)      </listitem>
211)      <listitem><command>Create arbitrary cached content</command>
212)      <para>
213) 
214) Likewise, the browser cache can also be used to <ulink
215) url="http://crypto.stanford.edu/sameorigin/safecachetest.html">store unique
216) identifiers</ulink>. Since by default the cache has no same-origin policy,
217) these identifiers can be read by any domain, making them an ideal target for
218) adserver-class adversaries.
219) 
220)      </para>
221)      </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

222) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

223)      <listitem id="fingerprinting"><command>Fingerprint users based on browser
224) attributes</command>
225) <para>
226) 
227) There is an absurd amount of information available to websites via attributes
228) of the browser. This information can be used to reduce anonymity set, or even
229) <ulink url="http://mandark.fr/0x000000/articles/Total_Recall_On_Firefox..html">uniquely
230) fingerprint individual users</ulink>. </para>
231) <para>
232) For illustration, let's perform a
233) back-of-the-envelope calculation on the number of anonymity sets for just the
234) resolution information available in the <ulink
235) url="http://developer.mozilla.org/en/docs/DOM:window">window</ulink> and
236) <ulink
237) url="http://developer.mozilla.org/en/docs/DOM:window.screen">window.screen</ulink>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

238) objects.
239) 
240) 
241) 
242) Browser window resolution information provides something like
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

243) (1280-640)*(1024-480)=348160 different anonymity sets. Desktop resolution
244) information contributes about another factor of 5 (for about 5 resolutions in
245) typical use). In addition, the dimensions and position of the desktop taskbar
246) are available, which can reveal hints on OS information. This boosts the count
247) by a factor of 5 (for each of the major desktop taskbars - Windows, OSX, KDE
248) and Gnome, and None). Subtracting the browser content window
249) size from the browser outer window size provide yet more information.
250) Firefox toolbar presence gives about a factor of 8 (3 toolbars on/off give
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

251) 2<superscript>3</superscript>=8). Interface effects such as title bar font size
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

252) and window manager settings gives a factor of about 9 (say 3 common font sizes
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

253) for the title bar and 3 common sizes for browser GUI element fonts).
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

254) Multiply this all out, and you have (1280-640)*(1024-480)*5*5*8*9 ~=
255) 2<superscript>29</superscript>, or a 29 bit identifier based on resolution
256) information alone. </para>
257) 
258) <para>
259) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

260) Of course, this space is non-uniform in user density and prone to incremental
261) changes. The <ulink
262) url="https://wiki.mozilla.org/Fingerprinting#Data">Panopticlick study
263) done</ulink> by the EFF attempts to measure the actual entropy - the number of
264) identifying bits of information encoded in browser properties.  Their result
265) data is definitely useful, and the metric is probably the appropriate one for
266) determining how identifying a particular browser property is. However, some
267) quirks of their study means that they do not extract as much information as
268) they could from display information: they only use desktop resolution (which
269) Torbutton reports as the window resolution) and do not attempt to infer the
270) size of toolbars.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

271) 
272) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

273) <!--
274) FIXME: This is no longer true. Only certain addons are now discoverable, and
275) only if they want to be:
276) http://webdevwonders.com/detecting-firefox-add-ons/
277) https://developer.mozilla.org/en/Updating_web_applications_for_Firefox_3#section_7
278) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

279) <para>
280) 
281) To add insult to injury, <ulink
282) url="http://pseudo-flaw.net/content/tor/torbutton/">chrome URL disclosure
283) attacks</ulink> mean that each and every extension on <ulink
284) url="https://addons.mozilla.org">addons.mozilla.org</ulink> adds another bit
285) to that 2<superscript>29</superscript>. With hundreds of popular extensions
286) and thousands of extensions total, it is easy to see that this sort of
287) information is an impressively powerful identifier if used properly by a
288) competent and determined adversary such as an ad network.  Again, a
289) nearest-neighbor bit vector space approach here would also gracefully handle
290) incremental changes to installed extensions.
291) 
292) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

293) -->
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

294)      </listitem>
295)      <listitem><command>Remotely or locally exploit browser and/or
296) OS</command>
297)      <para>
298) Last, but definitely not least, the adversary can exploit either general 
299) browser vulnerabilities, plugin vulnerabilities, or OS vulnerabilities to
300) install malware and surveillance software. An adversary with physical access
301) can perform similar actions. Regrettably, this last attack capability is
302) outside of Torbutton's ability to defend against, but it is worth mentioning
303) for completeness.
304)      </para>
305)      </listitem>
306)     </orderedlist>
307)    </sect3>
308) 
309)   </sect2>
310) 
311)   <sect2 id="requirements">
312)    <title>Torbutton Requirements</title>
313) <note>
314) 
315) Since many settings satisfy multiple requirements, this design document is
316) organized primarily by Torbutton components and settings. However, if you are
317) the type that would rather read the document from the requirements
318) perspective, it is in fact possible to search for each of the following
319) requirement phrases in the text to find the relevant features that help meet
320) that requirement.
321) 
322) </note>
323)    <para>
324) 
325) From the above Adversary Model, a number of requirements become clear. 
326) 
327)    </para>
328) 
329) <orderedlist> 
330) <!-- These aren't really commands.. But it's the closest I could find in an
331) acceptable style.. Don't really want to make my own stylesheet -->
332)  <listitem id="proxy"><command>Proxy Obedience</command> 
333)  <para>The browser
334) MUST NOT bypass Tor proxy settings for any content.</para></listitem>
335)  <listitem id="isolation"><command>Network Isolation</command>
336)  <para>Pages MUST NOT perform any network activity in a Tor state different
337)  from the state they were originally loaded in.</para></listitem>
338)  <listitem id="state"><command>State Separation</command>
339)  <para>Browser state (cookies, cache, history, 'DOM storage'), accumulated in
340)  one Tor state MUST NOT be accessible via the network in
341)  another Tor state.</para></listitem>
342)  <listitem id="undiscoverability"><command>Tor Undiscoverability</command><para>With
343) the advent of bridge support in Tor 0.2.0.x, there are now a class of Tor
344) users whose network fingerprint does not obviously betray the fact that they
345) are using Tor. This should extend to the browser as well - Torbutton MUST NOT 
346) reveal its presence while Tor is disabled.</para></listitem>
347)  <listitem id="disk"><command>Disk Avoidance</command><para>The browser SHOULD NOT write any Tor-related state to disk, or store it
348)  in memory beyond the duration of one Tor toggle.</para></listitem>
349)  <listitem id="location"><command>Location Neutrality</command><para>The browser SHOULD NOT leak location-specific information, such as
350)  timezone or locale via Tor.</para></listitem>
351)  <listitem id="setpreservation"><command>Anonymity Set
352) Preservation</command><para>The browser SHOULD NOT leak any other anonymity set reducing information 
353)  (such as user agent, extension presence, and resolution information)
354) automatically via Tor. The assessment of the attacks above should make it clear
355) that anonymity set reduction is a very powerful method of tracking and
356) eventually identifying anonymous users.
357) </para></listitem>
358)  <listitem id="updates"><command>Update Safety</command><para>The browser
359) SHOULD NOT perform unauthenticated updates or upgrades via Tor.</para></listitem>
360)  <listitem id="interoperate"><command>Interoperability</command><para>Torbutton SHOULD interoperate with third-party proxy switchers that
361)  enable the user to switch between a number of different proxies. It MUST
362)  provide full Tor protection in the event a third-party proxy switcher has
363)  enabled the Tor proxy settings.</para></listitem>
364) </orderedlist>
365)   </sect2>
366)   <sect2 id="layout">
367)    <title>Extension Layout</title>
368) 
369) <para>Firefox extensions consist of two main categories of code: 'Components' and
370) 'Chrome'. Components are a fancy name for classes that implement a given
371) interface or interfaces. In Firefox, components <ulink
372) url="https://developer.mozilla.org/en/XPCOM">can be
373) written</ulink> in C++,
374) Javascript, or a mixture of both. Components have two identifiers: their
375) '<ulink
376) url="http://www.mozilla.org/projects/xpcom/book/cxc/html/quicktour2.html#1005005">Contract
377) ID</ulink>' (a human readable path-like string), and their '<ulink
378) url="http://www.mozilla.org/projects/xpcom/book/cxc/html/quicktour2.html#1005329">Class
379) ID</ulink>' (a GUID hex-string). In addition, the interfaces they implement each have a hex
380) 'Interface ID'. It is possible to 'hook' system components - to reimplement
381) their interface members with your own wrappers - but only if the rest of the
382) browser refers to the component by its Contract ID. If the browser refers to
383) the component by Class ID, it bypasses your hooks in that use case.
384) Technically, it may be possible to hook Class IDs by unregistering the
385) original component, and then re-registering your own, but this relies on
386) obsolete and deprecated interfaces and has proved to be less than
387) stable.</para>
388) 
389) <para>'Chrome' is a combination of XML and Javascript used to describe a window.
390) Extensions are allowed to create 'overlays' that are 'bound' to existing XML
391) window definitions, or they can create their own windows. The DTD for this XML
392) is called <ulink
393) url="http://developer.mozilla.org/en/docs/XUL_Reference">XUL</ulink>.</para>
394)   </sect2>
395) </sect1>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

396) <sect1 id="components">
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

397)   <title>Components</title>
398)   <para>
399) 
400) Torbutton installs components for two purposes: hooking existing components to
401) reimplement their interfaces; and creating new components that provide
402) services to other pieces of the extension.
403) 
404)   </para>
405) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

406)   <sect2 id="hookedxpcom">
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

407)    <title>Hooked Components</title>
408) 
409) <para>Torbutton makes extensive use of Contract ID hooking, and implements some
410) of its own standalone components as well.  Let's discuss the hooked components
411) first.</para>
412) 
413) <sect3 id="appblocker">
414)  <title><ulink
415) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/uriloader/external-protocol-service%3B1">@mozilla.org/uriloader/external-protocol-service;1
416) </ulink>, <ulink
417) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/uriloader/external-helper-app-service%3B1">@mozilla.org/uriloader/external-helper-app-service;1</ulink>,
418) and <ulink url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/mime%3B1">@mozilla.org/mime;1</ulink>
419) - <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

420)   url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/external-app-blocker.js">components/external-app-blocker.js</ulink></title>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

421)  <para>
422) Due to <link linkend="FirefoxBugs">Firefox Bug</link> <ulink
423) url="https://bugzilla.mozilla.org/show_bug.cgi?id=440892">440892</ulink> allowing Firefox 3.x to automatically launch some
424) applications without user intervention, Torbutton had to wrap the three
425) components involved in launching external applications to provide user
426) confirmation before doing so while Tor is enabled. Since external applications
427) do not obey proxy settings, they can be manipulated to automatically connect
428) back to arbitrary servers outside of Tor with no user intervention. Fixing
429) this issue helps to satisfy Torbutton's <link linkend="proxy">Proxy
430) Obedience</link> Requirement.
431)  </para>
432) </sect3>
433) <sect3>
434) <title><ulink url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/global-history;2">@mozilla.org/browser/global-history;2</ulink>
435) - <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

436)   url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/ignore-history.js">components/ignore-history.js</ulink></title>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

437) 
438) <para>This component was contributed by <ulink
439) url="http://www.collinjackson.com/">Collin Jackson</ulink> as a method for defeating
440) CSS and Javascript-based methods of history disclosure. The global-history
441) component is what is used by Firefox to determine if a link was visited or not
442) (to apply the appropriate style to the link). By hooking the <ulink
443) url="https://developer.mozilla.org/en/nsIGlobalHistory2#isVisited.28.29">isVisited</ulink>
444) and <ulink 
445) url="https://developer.mozilla.org/en/nsIGlobalHistory2#addURI.28.29">addURI</ulink>
446) methods, Torbutton is able to selectively prevent history items from being
447) added or being displayed as visited, depending on the Tor state and the user's
448) preferences.
449) </para>
450) <para>
451) This component helps satisfy the <link linkend="state">State Separation</link>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

452) and <link linkend="disk">Disk Avoidance</link> requirements of Torbutton. It
453) is only needed for Firefox 3.x. On Firefox 4, we omit this component in favor
454) of the <ulink
455) url="https://developer.mozilla.org/en/CSS/Privacy_and_the_%3avisited_selector">built-in
456) history protections</ulink>.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

457) </para>
458) </sect3>
459) <sect3 id="livemarks">
460) <title><ulink
461) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/livemark-service;2">@mozilla.org/browser/livemark-service;2</ulink>
462) - <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

463)   url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/block-livemarks.js">components/block-livemarks.js</ulink></title>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

464) <para>
465) 
466) The <ulink
467) url="http://www.mozilla.com/en-US/firefox/livebookmarks.html">livemark</ulink> service
468) is started by a timer that runs 5 seconds after Firefox
469) startup. As a result, we cannot simply call the stopUpdateLivemarks() method to
470) disable it. We must wrap the component to prevent this start() call from
471) firing in the event the browser starts in Tor mode.
472) 
473) </para>
474) <para>
475) This component helps satisfy the <link linkend="isolation">Network
476) Isolation</link> and <link linkend="setpreservation">Anonymity Set
477) Preservation</link> requirements.
478) </para>
479) </sect3>
480) </sect2>
481) <sect2>
482) <title>New Components</title>
483) 
484) <para>Torbutton creates four new components that are used throughout the
485) extension. These components do not hook any interfaces, nor are they used
486) anywhere besides Torbutton itself.</para>
487) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

488) <sect3 id="cookiejar">
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

489) <title><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

490) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js">@torproject.org/cookie-jar-selector;2
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

491) - components/cookie-jar-selector.js</ulink></title>
492) 
493) <para>The cookie jar selector (also based on code from <ulink
494) url="http://www.collinjackson.com/">Collin
495) Jackson</ulink>) is used by the Torbutton chrome to switch between
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

496) Tor and Non-Tor cookies. It stores an XML representation of the current
497) cookie state in memory and/or on disk. When Tor is toggled, it syncs the
498) current cookies to this XML store, and then loads the cookies for the other
499) state from the XML store.
500) </para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

501) 
502) <para>
503) This component helps to address the <link linkend="state">State
504) Isolation</link> requirement of Torbutton.
505) </para>
506) 
507) </sect3>
508) <sect3>
509) <title><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

510) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/torbutton-logger.js">@torproject.org/torbutton-logger;1
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

511) - components/torbutton-logger.js</ulink></title>
512) 
513) <para>The torbutton logger component allows on-the-fly redirection of torbutton
514) logging messages to either Firefox stderr
515) (<command>extensions.torbutton.logmethod=0</command>), the Javascript error console
516) (<command>extensions.torbutton.logmethod=1</command>), or the DebugLogger extension (if
517) available - <command>extensions.torbutton.logmethod=2</command>). It also allows you to
518) change the loglevel on the fly by changing
519) <command>extensions.torbutton.loglevel</command> (1-5, 1 is most verbose).
520) </para>
521) </sect3>
522) <sect3 id="windowmapper">
523) 
524) <title><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

525) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/window-mapper.js">@torproject.org/content-window-mapper;1
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

526) - components/window-mapper.js</ulink></title>
527) 
528) <para>Torbutton tags Firefox <ulink
529) url="https://developer.mozilla.org/en/XUL_Tutorial/Tabboxes">tabs</ulink> with a special variable that indicates the Tor
530) state the tab was most recently used under to fetch a page. The problem is
531) that for many Firefox events, it is not possible to determine the tab that is
532) actually receiving the event. The Torbutton window mapper allows the Torbutton
533) chrome and other components to look up a <ulink
534) url="https://developer.mozilla.org/en/XUL/tabbrowser">browser
535) tab</ulink> for a given <ulink
536) url="https://developer.mozilla.org/en/nsIDOMWindow">HTML content
537) window</ulink>. It does this by traversing all windows and all browsers, until it
538) finds the browser with the requested <ulink
539) url="https://developer.mozilla.org/en/XUL/tabbrowser#p-contentWindow">contentWindow</ulink> element. Since the content policy
540) and page loading in general can generate hundreds of these lookups, this
541) result is cached inside the component.
542) </para>
543) </sect3>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

544) <sect3 id="crashobserver">
545)  <title><ulink
546) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/crash-observer.js">@torproject.org/crash-observer;1</ulink></title>
547)   <para>
548) 
549) This component detects when Firefox crashes by altering Firefox prefs during
550) runtime and checking for the same values at startup. It <ulink
551) url="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIPrefService#savePrefFile()">synchronizes
552) the preference service</ulink> to ensure the altered prefs are written to disk
553) immediately.
554) 
555)   </para>
556) </sect3>
557) <sect3 id="tbsessionstore">
558)  <title><ulink
559) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/tbSessionStore.js">@torproject.org/torbutton-ss-blocker;1</ulink></title>
560)   <para>
561) 
562) This component subscribes to the Firefox <ulink
563) url="https://developer.mozilla.org/en/Observer_Notifications#Session_Store">sessionstore-state-write</ulink>
564) observer event to filter out URLs from tabs loaded during Tor, to prevent them
565) from being written to disk. To do this, it checks the
566) <command>__tb_tor_fetched</command> tag of tab objects before writing them out. If
567) the tag is from a blocked Tor state, the tab is not written to disk.  This is
568) a rather expensive operation that involves potentially very large JSON
569) evaluations and object tree traversals, but it preferable to replacing the
570) Firefox session store with our own implementation, which is what was done in
571) years past.
572) 
573)   </para>
574) </sect3>
575) 
576) <sect3 id="refspoofer">
577)  <title><ulink
578) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/torRefSpoofer.js">@torproject.org/torRefSpoofer;1</ulink></title>
579)  <para>
580) This component handles optional referrer spoofing for Torbuton. It implements a
581) form of "smart" referer spoofing using <ulink
582) url="https://developer.mozilla.org/en/Setting_HTTP_request_headers">http-on-modify-request</ulink>
583) to modify the Referrer header. The code sends the default browser referrer
584) header only if the destination domain is a suffix of the source, or if the
585) source is a suffix of the destination. Otherwise, it sends no referer. This
586) strange suffix logic is used as a heuristic: some rare sites on the web block
587) requests without proper referer headers, and this logic is an attempt to cater
588) to them. Unfortunately, it may not be enough. For example, google.fr will not
589) send a referer to google.com using this logic. Hence, it is off by default.
590)  </para>
591) </sect3>
592) 
593) <!-- FIXME: tor-protocol, tors-protocol need documenting, but
594) they are disabled by default for now, so no reason to add the
595) clutter+confusion. -->
596) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

597) <sect3 id="contentpolicy">
598) <title><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

599) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cssblocker.js">@torproject.org/cssblocker;1
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

600) - components/cssblocker.js</ulink></title>
601) 
602) <para>This is a key component to Torbutton's security measures. When Tor is
603) toggled, Javascript is disabled, and pages are instructed to stop loading.
604) However, CSS is still able to perform network operations by loading styles for
605) onmouseover events and other operations. In addition, favicons can still be
606) loaded by the browser. The cssblocker component prevents this by implementing
607) and registering an <ulink
608) url="https://developer.mozilla.org/en/nsIContentPolicy">nsIContentPolicy</ulink>.
609) When an nsIContentPolicy is registered, Firefox checks every attempted network
610) request against its <ulink
611) url="https://developer.mozilla.org/en/nsIContentPolicy#shouldLoad()">shouldLoad</ulink>
612) member function to determine if the load should proceed. In Torbutton's case,
613) the content policy looks up the appropriate browser tab using the <link
614) linkend="windowmapper">window mapper</link>,
615) and checks that tab's load tag against the current Tor state. If the tab was
616) loaded in a different state than the current state, the fetch is denied.
617) Otherwise, it is allowed.</para> This helps to achieve the <link
618) linkend="isolation">Network
619) Isolation</link> requirements of Torbutton.
620) 
621) <para>In addition, the content policy also blocks website javascript from
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

622) <ulink
623) url="http://webdevwonders.com/detecting-firefox-add-ons/">querying for
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

624) versions and existence of extension chrome</ulink> while Tor is enabled, and
625) also masks the presence of Torbutton to website javascript while Tor is
626) disabled. </para>
627) 
628) <para>
629) 
630) Finally, some of the work that logically belongs to the content policy is
631) instead handled by the <command>torbutton_http_observer</command> and
632) <command>torbutton_weblistener</command> in <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

633) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js">torbutton.js</ulink>. These two objects handle blocking of
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

634) Firefox 3 favicon loads, popups, and full page plugins, which for whatever
635) reason are not passed to the Firefox content policy itself (see Firefox Bugs 
636) <ulink
637) url="https://bugzilla.mozilla.org/show_bug.cgi?id=437014">437014</ulink> and 
638) <ulink
639) url="https://bugzilla.mozilla.org/show_bug.cgi?id=401296">401296</ulink>).
640) 
641) </para>
642) 
643) <!-- 
644) FIXME: Hrmm, the content policy doesn't really lend itself well to display 
645) this way.. People looking for this much detail should consult the source.
646) 
647) <para>
648)     <table rowheader="firstcol" frame='all'><title>Access Permissions Table</title>
649)     <tgroup cols='5' align='left' colsep='1' rowsep='1'>
650)        <tbody>
651)        <row>
652)          <entry></entry>
653)          <entry>chrome/resource</entry>
654)          <entry>a3</entry>
655)          <entry>a4</entry>
656)          <entry>a5</entry>
657)        </row>
658)        <row>
659)          <entry>file</entry>
660)          <entry>b2</entry>
661)          <entry>b3</entry>
662)          <entry>b4</entry>
663)          <entry>b5</entry>
664)        </row>
665)        <row>
666)          <entry>c1</entry>
667)          <entry>c2</entry>
668)          <entry>c3</entry>
669)          <entry>c4</entry>
670)          <entry>c5</entry>
671)        </row>
672)        <row>
673)          <entry>d1</entry>
674)          <entry>d2</entry>
675)          <entry>d3</entry>
676)          <entry>d4</entry>
677)          <entry>d5</entry>
678)        </row>
679)        </tbody>
680)        </tgroup>
681)        </table>
682) </para>
683) -->
684) 
685) <para>
686) 
687) This helps to fulfill both the <link
688) linkend="setpreservation">Anonymity Set Preservation</link> and the <link
689) linkend="undiscoverability">Tor Undiscoverability</link> requirements of
690) Torbutton.</para>
691) 
692) </sect3>
693) </sect2>
694) </sect1>
695) <sect1>
696)  <title>Chrome</title>
697) 
698) <para>The chrome is where all the torbutton graphical elements and windows are
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

699) located. </para>
700) <sect2>
701)  <title>XUL Windows and Overlays</title>
702) <para>
703) Each window is described as an <ulink
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

704) url="http://developer.mozilla.org/en/docs/XUL_Reference">XML file</ulink>, with zero or more Javascript
705) files attached. The scope of these Javascript files is their containing
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

706) window. XUL files that add new elements and script to existing Firefox windows
707) are called overlays.</para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

708) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

709) <sect3 id="browseroverlay">
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

710) <title>Browser Overlay - <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

711) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.xul">torbutton.xul</ulink></title>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

712) 
713) <para>The browser overlay, torbutton.xul, defines the toolbar button, the status
714) bar, and events for toggling the button. The overlay code is in <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

715) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js">chrome/content/torbutton.js</ulink>.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

716) It contains event handlers for preference update, shutdown, upgrade, and
717) location change events.</para>
718) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

719) </sect3>
720) <sect3>
721)  <title>Preferences Window - <ulink
722) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.xul">preferences.xul</ulink></title>
723) 
724) <para>The preferences window of course lays out the Torbutton preferences, with
725) handlers located in <ulink
726) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.js">chrome/content/preferences.js</ulink>.</para>
727) </sect3>
728) <sect3>
729)  <title>Other Windows</title>
730) 
731) <para>There are additional windows that describe popups for right clicking on
732) the status bar, the toolbutton, and the about page.</para>
733) 
734) </sect3>
735) </sect2>
736) <sect2>
737)  <title>Major Chrome Observers</title>
738)  <para>
739) In addition to the <link linkend="components">components described
740) above</link>, Torbutton also instantiates several observers in the browser
741) overlay window. These mostly grew due to scoping convenience, and many should
742) probably be relocated into their own components.
743)  </para>
744)   <orderedlist>
745)    <listitem><command>torbutton_window_pref_observer</command>
746)     <para>
747) This is an observer that listens for Torbutton state changes, for the purposes
748) of updating the Torbutton button graphic as the Tor state changes.
749)     </para>
750)    </listitem>
751) 
752)    <listitem><command>torbutton_unique_pref_observer</command>
753)     <para>
754) 
755) This is an observer that only runs in one window, called the main window. It
756) listens for changes to all of the Torbutton preferences, as well as Torbutton
757) controlled Firefox preferences. It is what carries out the toggle path when
758) the proxy settings change. When the main window is closed, the
759) torbutton_close_window event handler runs to dub a new window the "main
760) window".
761) 
762)     </para>
763)    </listitem>
764) 
765)    <listitem><command>tbHistoryListener</command>
766)     <para>
767) The tbHistoryListener exists to prevent client window Javascript from
768) interacting with window.history to forcibly navigate a user to a tab session
769) history entry from a different Tor state. It also expunges the window.history
770) entries during toggle. This listener helps Torbutton
771) satisfy the <link linkend="isolation">Network Isolation</link> requirement as
772) well as the <link linkend="state">State Separation</link> requirement.
773) 
774)     </para>
775)    </listitem>
776) 
777)    <listitem><command>torbutton_http_observer</command>
778)     <para>
779) 
780) The torbutton_http_observer performs some of the work that logically belongs
781) to the content policy. This handles blocking of
782) Firefox 3 favicon loads, which for whatever
783) reason are not passed to the Firefox content policy itself (see Firefox Bugs
784) <ulink
785) url="https://bugzilla.mozilla.org/show_bug.cgi?id=437014">437014</ulink> and
786) <ulink
787) url="https://bugzilla.mozilla.org/show_bug.cgi?id=401296">401296</ulink>).
788) 
789)     </para>
790)     <para>
791) The observer is also responsible for redirecting users to alternate
792) search engines when Google presents them with a Captcha, as well as copying
793) Google Captcha-related cookies between international Google domains.
794)     </para>
795)    </listitem>
796) 
797)    <listitem><command>torbutton_proxyservice</command>
798)     <para>
799) The Torbutton proxy service handles redirecting Torbutton-related update
800) checks on addons.mozilla.org through Tor. This is done to help satisfy the
801) <link linkend="undiscoverability">Tor Undiscoverability</link> requirement.
802)     </para>
803)    </listitem>
804) 
805)    <listitem><command>torbutton_weblistener</command>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

806) <para>The <ulink
807) url="https://developer.mozilla.org/en/nsIWebProgressListener#onLocationChange">location
808) change</ulink> <ulink
809) url="https://developer.mozilla.org/en/nsIWebProgress">webprogress
810) listener</ulink>, <command>torbutton_weblistener</command> is one of the most
811) important parts of the chrome from a security standpoint. It is a <ulink
812) url="https://developer.mozilla.org/en/nsIWebProgressListener">webprogress
813) listener</ulink> that handles receiving an event every time a page load or
814) iframe load occurs. This class eventually calls down to
815) <function>torbutton_update_tags()</function> and
816) <function>torbutton_hookdoc()</function>, which apply the browser Tor load
817) state tags, plugin permissions, and install the Javascript hooks to hook the
818) <ulink
819) url="https://developer.mozilla.org/en/DOM/window.screen">window.screen</ulink>
820) object to obfuscate browser and desktop resolution information.
821) 
822) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

823)    </listitem>
824) 
825)   </orderedlist>
826)  </sect2>
827) </sect1>
828) 
829) <sect1>
830)  <title>Toggle Code Path</title>
831)  <para>
832) 
833) The act of toggling is connected to <function>torbutton_toggle()</function>
834) via the <ulink
835) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.xul">torbutton.xul</ulink>
836) and <ulink
837) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/popup.xul">popup.xul</ulink>
838) overlay files. Most of the work in the toggling process is present in <ulink
839) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js">torbutton.js</ulink> 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

840) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

841) </para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

842) <para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

843) 
844) Toggling is a 3 stage process: Button Click, Proxy Update, and
845) Settings Update. These stages are reflected in the prefs
846) <command>extensions.torbutton.tor_enabled</command>,
847) <command>extensions.torbutton.proxies_applied</command>, and
848) <command>extensions.torbutton.settings_applied</command>. The reason for the
849) three stage preference update is to ensure immediate enforcement of <link
850) linkend="isolation">Network Isolation</link> via the <link
851) linkend="contentpolicy">content policy</link>. Since the content window
852) javascript runs on a different thread than the chrome javascript, it is
853) important to properly convey the stages to the content policy to avoid race
854) conditions and leakage, especially with <ulink
855) url="https://bugzilla.mozilla.org/show_bug.cgi?id=409737">Firefox Bug 
856) 409737</ulink> unfixed. The content policy does not allow any network activity
857) whatsoever during this three stage transition.
858) 
859)  </para>
860)  <sect2>
861)   <title>Button Click</title>
862)   <para>
863) 
864) This is the first step in the toggling process. When the user clicks the
865) toggle button or the toolbar, <function>torbutton_toggle()</function> is
866) called. This function checks the current Tor status by comparing the current
867) proxy settings to the selected Tor settings, and then sets the proxy settings
868) to the opposite state, and sets the pref
869) <command>extensions.torbutton.tor_enabled</command> to reflect the new state.
870) It is this proxy pref update that gives notification via the <ulink
871) url="https://developer.mozilla.org/en/NsIPrefBranch2#addObserver.28.29">pref
872) observer</ulink>
873) <command>torbutton_unique_pref_observer</command> to perform the rest of the
874) toggle.
875) 
876)   </para>
877)  </sect2>
878)  <sect2>
879)   <title>Proxy Update</title>
880)   <para>
881) 
882) When Torbutton receives any proxy change notifications via its
883) <command>torbutton_unique_pref_observer</command>, it calls
884) <function>torbutton_set_status()</function> which checks against the Tor
885) settings to see if the Tor proxy settings match the current settings. If so,
886) it calls <function>torbutton_update_status()</function>, which determines if
887) the Tor state has actually changed, and sets
888) <command>extensions.torbutton.proxies_applied</command> to the appropriate Tor
889) state value, and ensures that
890) <command>extensions.torbutton.tor_enabled</command> is also set to the correct
891) value. This is decoupled from the button click functionality via the pref
892) observer so that other addons (such as SwitchProxy) can switch the proxy
893) settings between multiple proxies.
894) 
895)   </para>
896)  </sect2>
897) <!-- FIXME: Describe tab tagging and other state clearing hacks? -->
898)  <sect2>
899)   <title>Settings Update</title>
900)   <para>
901) 
902) The next stage is also handled by
903) <function>torbutton_update_status()</function>. This function sets scores of
904) Firefox preferences, saving the original values to prefs under
905) <command>extensions.torbutton.saved.*</command>, and performs the <link
906) linkend="cookiejar">cookie jarring</link>, state clearing (such as window.name
907) and DOM storage), and <link linkend="preferences">preference
908) toggling</link><!--, and ssl certificate jaring work of Torbutton-->. At the
909) end of its work, it sets
910) <command>extensions.torbutton.settings_applied</command>, which signifies the
911) completion of the toggle operation to the <link
912) linkend="contentpolicy">content policy</link>.
913) 
914)   </para>
915)  </sect2>
916) <sect2 id="preferences">
917) <title>Firefox preferences touched during Toggle</title>
918) <para>
919) There are also a number of Firefox preferences set in
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

920) <function>torbutton_update_status()</function> that aren't governed by any
921) Torbutton setting. These are:
922) </para>
923) <orderedlist>
924) 
925) <!--
926) Not set any more.
927)  <listitem><ulink
928) url="http://kb.mozillazine.org/Browser.bookmarks.livemark_refresh_seconds">browser.bookmarks.livemark_refresh_seconds</ulink>
929) <para>
930) This pref is set in an attempt to disable the fetching of LiveBookmarks via
931) Tor. Since users can potentially collect a large amount of live bookmarks to
932) very personal sites (blogs of friends, wikipedia articles they maintain,
933) comment feeds of their own blog), it is not possible to cleanly isolate these
934) fetches and they are simply disabled during Tor usage.
935) This helps to address the <link
936) linkend="state">State Separation</link> requirement.
937) Unfortunately <ulink
938) url="https://bugzilla.mozilla.org/show_bug.cgi?id=436250">Firefox Bug
939) 436250</ulink> prevents this from
940) functioning completely correctly.
941) </para>
942)   </listitem>
943) -->
944) 
945)  <listitem><ulink
946) url="http://kb.mozillazine.org/Network.security.ports.banned">network.security.ports.banned</ulink>
947)  <para>
948) Torbutton sets this setting to add ports 8123, 8118, 9050 and 9051 (which it
949) reads from <command>extensions.torbutton.banned_ports</command>) to the list
950) of ports Firefox is forbidden to access. These ports are Polipo, Privoxy, Tor,
951) and the Tor control port, respectively. This is set for both Tor and Non-Tor
952) usage, and prevents websites from attempting to do http fetches from these
953) ports to see if they are open, which addresses the <link
954) linkend="undiscoverability">Tor Undiscoverability</link> requirement.
955)  </para>
956)  </listitem>
957)  <listitem><ulink url="http://kb.mozillazine.org/Browser.send_pings">browser.send_pings</ulink>
958)  <para>
959) This setting is currently always disabled. If anyone ever complains saying
960) that they *want* their browser to be able to send ping notifications to a
961) page or arbitrary link, I'll make this a pref or Tor-only. But I'm not holding
962) my breath. I haven't checked if the content policy is called for pings, but if
963) not, this setting helps with meeting the <link linkend="isolation">Network
964) Isolation</link> requirement.
965)  </para>
966)  </listitem>
967)  <listitem><ulink
968) url="http://kb.mozillazine.org/Browser.safebrowsing.remoteLookups">browser.safebrowsing.remoteLookups</ulink>
969)  <para>
970) Likewise for this setting. I find it hard to imagine anyone who wants to ask
971) Google in real time if each URL they visit is safe, especially when the list
972) of unsafe URLs is downloaded anyway. This helps fulfill the <link
973) linkend="disk">Disk Avoidance</link> requirement, by preventing your entire
974) browsing history from ending up on Google's disks.
975)  </para>
976)  </listitem>
977)  <listitem><ulink
978) url="http://kb.mozillazine.org/Browser.safebrowsing.enabled">browser.safebrowsing.enabled</ulink>
979)  <para>
980) Safebrowsing does <ulink
981) url="https://bugzilla.mozilla.org/show_bug.cgi?id=360387">unauthenticated
982) updates under Firefox 2</ulink>, so it is disabled during Tor usage. 
983) This helps fulfill the <link linkend="updates">Update
984) Safety</link> requirement. Firefox 3 has the fix for that bug, and so
985) safebrowsing updates are enabled during Tor usage.
986)  </para>
987)  </listitem>
988)  <listitem><ulink
989) url="http://kb.mozillazine.org/Network.protocol-handler.warn-external.%28protocol%29">network.protocol-handler.warn-external.(protocol)</ulink>
990)  <para>
991) If Tor is enabled, we need to prevent random external applications from
992) launching without at least warning the user. This group of settings only
993) partially accomplishes this, however. Applications can still be launched via
994) plugins. The mechanisms for handling this are described under the "Disable
995) Plugins During Tor Usage" preference. This helps fulfill the <link
996) linkend="proxy">Proxy Obedience</link> requirement, by preventing external
997) applications from accessing network resources at the command of Tor-fetched
998) pages. Unfortunately, due to <link linkend="FirefoxBugs">Firefox Bug</link>
999) <ulink
1000) url="https://bugzilla.mozilla.org/show_bug.cgi?id=440892">440892</ulink>,
1001) these prefs are no longer obeyed. They are set still anyway out of respect for
1002) the dead.
1003)  </para>
1004) </listitem>
1005)   <listitem><ulink
1006) url="http://kb.mozillazine.org/Browser.sessionstore.max_tabs_undo">browser.sessionstore.max_tabs_undo</ulink>
1007)    <para>
1008) 
1009) To help satisfy the Torbutton <link linkend="state">State Separation</link>
1010) and <link linkend="isolation">Network Isolation</link> requirements,
1011) Torbutton needs to purge the Undo Tab history on toggle to prevent repeat
1012) "Undo Close" operations from accidentally restoring tabs from a different Tor
1013) State. This purge is accomplished by setting this preference to 0 and then
1014) restoring it to the previous user value upon toggle.
1015) 
1016)    </para>
1017)   </listitem>
1018) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1019)   <listitem><command>security.enable_ssl2</command> or <ulink
1020) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/interfaces/nsIDOMCrypto">nsIDOMCrypto::logout()</ulink>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1021)    <para>
1022) TLS Session IDs can persist for an indefinite duration, providing an
1023) identifier that is sent to TLS sites that can be used to link activity. This
1024) is particularly troublesome now that we have certificate verification in place
1025) in Firefox 3: The OCSP server can use this Session ID to build a history of
1026) TLS sites someone visits, and also correlate their activity as users move from
1027) network to network (such as home to work to coffee shop, etc), inside and
1028) outside of Tor. To handle this and to help satisfy our <link
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1029) linkend="state">State Separation Requirement</link>, we call the logout()
1030) function of nsIDOMCrypto. Since this may be absent, or may fail, we fall back
1031) to toggling
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1032) <command>security.enable_ssl2</command>, which clears the SSL Session ID
1033) cache via the pref observer at <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1034) url="http://mxr.mozilla.org/security/source/security/manager/ssl/src/nsNSSComponent.cpp">nsNSSComponent.cpp</ulink>.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1035)    </para>
1036)   </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1037)   <listitem><command>security.OCSP.enabled</command>
1038)    <para>
1039) Similarly, we toggle <command>security.OCSP.enabled</command>, which clears the OCSP certificate
1040) validation cache via the pref observer at <ulink
1041) url="http://mxr.mozilla.org/security/source/security/manager/ssl/src/nsNSSComponent.cpp">nsNSSComponent.cpp</ulink>.
1042) In this way, exit nodes will not be able to fingerprint you
1043) based the fact that non-Tor OCSP lookups were obviously previously cached.
1044) To handle this and to help satisfy our <link
1045) linkend="state">State Separation Requirement</link>,
1046)    </para>
1047)   </listitem>
1048)   <listitem><command><ulink
1049) url="http://kb.mozillazine.org/Updating_extensions#Disabling_update_checks_for_individual_add-ons_-_Advanced_users">extensions.e0204bd5-9d31-402b-a99d-a6aa8ffebdca.getAddons.cache.enabled</ulink></command>
1050)   <para>
1051) We permanently disable addon usage statistic reporting to the
1052) addons.mozilla.org statistics engine. These statistics send version
1053) information about Torbutton users via non-Tor, allowing their Tor use to be
1054) uncovered. Disabling this reporting helps Torbutton to satisfy its <link
1055) linkend="undiscoverability">Tor Undiscoverability</link> requirement.
1056) 
1057)   </para>
1058)   </listitem>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1059) 
1060)   <listitem><command><ulink url="http://www.mozilla.com/en-US/firefox/geolocation/">geo.enabled</ulink></command>
1061)    <para>
1062) 
1063) Torbutton disables Geolocation support in Firefox 3.5 and above whenever tor
1064) is enabled. This helps Torbutton maintain its
1065) <link linkend="location">Location Neutrality</link> requirement.
1066) While Firefox does prompt before divulging geolocational information,
1067) the assumption is that Tor users will never want to give their
1068) location away during Tor usage, and even allowing websites to prompt
1069) them to do so will only cause confusion and accidents to happen. Moreover,
1070) just because users may approve a site to know their location in non-Tor mode
1071) does not mean they want it divulged during Tor mode.
1072) 
1073)    </para>
1074)   </listitem>
1075) 
1076)   <listitem><command><ulink
1077) url="http://kb.mozillazine.org/Browser.zoom.siteSpecific">browser.zoom.siteSpecific</ulink></command>
1078)    <para>
1079) 
1080) Firefox actually remembers your zoom settings for certain sites. CSS
1081) and Javascript rule can use this to recognize previous visitors to a site.
1082) This helps Torbutton fulfill its <link linkend="state">State Separation</link>
1083) requirement.
1084) 
1085)    </para>
1086)   </listitem>
1087) 
1088)   <listitem><command><ulink
1089) url="https://developer.mozilla.org/en/controlling_dns_prefetching">network.dns.disablePrefetch</ulink></command>
1090)    <para>
1091) 
1092) Firefox 3.5 and above implement prefetching of DNS resolution for hostnames in
1093) links on a page to decrease page load latency. While Firefox does typically
1094) disable this behavior when proxies are enabled, we set this pref for added
1095) safety during Tor usage. Additionally, to prevent Tor-loaded tabs from having
1096) their links prefetched after a toggle to Non-Tor mode occurs,
1097) we also set the docShell attribute
1098) <ulink
1099) url="http://www.oxymoronical.com/experiments/apidocs/interface/nsIDocShell">
1100) allowDNSPrefetch</ulink> to false on Tor loaded tabs. This happens in the same
1101) positions in the code as those for disabling plugins via the allowPlugins
1102) docShell attribute. This helps Torbutton fulfill its <link
1103) linkend="isolation">Network Isolation</link> requirement.
1104) 
1105)    </para>
1106)   </listitem>
1107) 
1108)   <listitem><command><ulink
1109) url="http://kb.mozillazine.org/Browser.cache.offline.enable">browser.cache.offline.enable</ulink></command>
1110)    <para>
1111) 
1112) Firefox has the ability to store web applications in a special cache to allow
1113) them to continue to operate while the user is offline. Since this subsystem
1114) is actually different than the normal disk cache, it must be dealt with
1115) separately. Thus, Torbutton sets this preference to false whenever Tor is
1116) enabled. This helps Torbutton fulfill its <link linkend="disk">Disk
1117) Avoidance</link> and <link linkend="state">State Separation</link>
1118) requirements.
1119) 
1120)    </para>
1121)   </listitem>
1122) 
1123) <!-- FIXME: We should make it possible to search for ALL modified FF prefs -->
1124) 
1125) </orderedlist>
1126) </sect2>
1127) 
1128) </sect1>
1129) 
1130) <sect1>
1131)  <title>Description of Options</title>
1132) <para>This section provides a detailed description of Torbutton's options. Each
1133) option is presented as the string from the preferences window, a summary, the
1134) preferences it touches, and the effect this has on the components, chrome, and
1135) browser properties.</para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1136) <!-- FIXME: figure out how to give subsections # ids or make this into a
1137) listitem -->
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1138)  <sect2>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1139)   <title>Proxy Settings</title>
1140)  <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1141)   <title>Test Settings</title>
1142)   <para>
1143) This button under the Proxy Settings tab provides a way to verify that the 
1144) proxy settings are correct, and actually do route through the Tor network. It
1145) performs this check by issuing an <ulink
1146) url="http://developer.mozilla.org/en/docs/XMLHttpRequest">XMLHTTPRequest</ulink>
1147) for <ulink
1148) url="https://check.torproject.org/?TorButton=True">https://check.torproject.org/?Torbutton=True</ulink>.
1149) This is a special page that returns very simple, yet well-formed XHTML that
1150) Torbutton can easily inspect for a hidden link with an id of
1151) <command>TorCheckResult</command> and a target of <command>success</command>
1152) or <command>failure</command> to indicate if the
1153) user hit the page from a Tor IP, a non-Tor IP. This check is handled in
1154) <function>torbutton_test_settings()</function> in <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1155) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js">torbutton.js</ulink>.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1156) Presenting the results to the user is handled by the <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1157) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.xul">preferences
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1158) window</ulink>
1159) callback <function>torbutton_prefs_test_settings()</function> in <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1160) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/preferences.js">preferences.js</ulink>.  
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1161) 
1162)   </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1163)  </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1164)  </sect2>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1165)  <sect2>
1166)   <title>Dynamic Content Settings</title>
1167)  <sect3 id="plugins">
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1168)   <title>Disable plugins on Tor Usage (crucial)</title>
1169)  <para>Option: <command>extensions.torbutton.no_tor_plugins</command></para>
1170) 
1171)  <para>Java and plugins <ulink
1172) url="http://java.sun.com/j2se/1.5.0/docs/api/java/net/class-use/NetworkInterface.html">can query</ulink> the <ulink
1173) url="http://www.rgagnon.com/javadetails/java-0095.html">local IP
1174) address</ulink> and report it back to the
1175) remote site. They can also <ulink
1176) url="http://decloak.net">bypass proxy settings</ulink> and directly connect to a
1177) remote site without Tor. Every browser plugin we have tested with Firefox has
1178) some form of network capability, and every one ignores proxy settings or worse - only
1179) partially obeys them. This includes but is not limited to:
1180) QuickTime, Windows Media Player, RealPlayer, mplayerplug-in, AcroRead, and
1181) Flash. 
1182) 
1183)  </para>
1184)  <para>
1185) Enabling this preference causes the above mentioned Torbutton chrome web progress
1186)  listener <command>torbutton_weblistener</command> to disable Java via <command>security.enable_java</command> and to disable
1187)  plugins via the browser <ulink
1188)  url="https://developer.mozilla.org/en/XUL%3aProperty%3adocShell">docShell</ulink>
1189)  attribute <command>allowPlugins</command>. These flags are set every time a new window is
1190)  created (<function>torbutton_tag_new_browser()</function>), every time a web
1191) load
1192) event occurs
1193)  (<function>torbutton_update_tags()</function>), and every time the tor state is changed
1194)  (<function>torbutton_update_status()</function>). As a backup measure, plugins are also
1195)  prevented from loading by the content policy in <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1196) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cssblocker.js">@torproject.org/cssblocker;1</ulink> if Tor is
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1197)  enabled and this option is set.
1198)  </para>
1199) 
1200)  <para>All of this turns out to be insufficient if the user directly clicks
1201) on a plugin-handled mime-type. <ulink
1202) url="https://bugzilla.mozilla.org/show_bug.cgi?id=401296">In this case</ulink>,
1203) the browser decides that maybe it should ignore all these other settings and
1204) load the plugin anyways, because maybe the user really did want to load it
1205) (never mind this same load-style could happen automatically  with meta-refresh
1206) or any number of other ways..). To handle these cases, Torbutton stores a list
1207) of plugin-handled mime-types, and sets the pref
1208) <command>plugin.disable_full_page_plugin_for_types</command> to this list.
1209) Additionally, (since nothing can be assumed when relying on Firefox
1210) preferences and internals) if it detects a load of one of them from the web
1211) progress listener, it cancels the request, tells the associated DOMWindow to
1212) stop loading, clears the document, AND throws an exception. Anything short of
1213) all this and the plugin managed to find some way to load.
1214)  </para>
1215) 
1216) <!--
1217) 
1218) FIXME: Hrmm, technically this behavior is not covered by this pref.
1219) 
1220)  <para>
1221) Furthermore, with version 3.0 and above, Firefox
1222) <ulink
1223) url="https://bugzilla.mozilla.org/show_bug.cgi?id=440892">began ignoring</ulink>
1224) 
1225) <ulink
1226) url="http://kb.mozillazine.org/Network.protocol-handler.warn-external.%28protocol%29">network.protocol-handler.warn-external.(protocol)</ulink>
1227) prefs, which caused us to have to <link linkend="appblocker">wrap the external
1228) app launcher components</link> to prevent external apps from being loaded to
1229) bypass proxy settings.
1230)  </para>
1231) -->
1232) 
1233)  <para>
1234)  All this could be avoided, of course, if Firefox would either <ulink
1235) url="https://bugzilla.mozilla.org/show_bug.cgi?id=401296">obey
1236)  allowPlugins</ulink> for directly visited URLs, or notify its content policy for such
1237)  loads either <ulink
1238) url="https://bugzilla.mozilla.org/show_bug.cgi?id=309524">via</ulink> <ulink
1239) url="https://bugzilla.mozilla.org/show_bug.cgi?id=380556">shouldProcess</ulink> or shouldLoad. The fact that it does not is
1240)  not very encouraging.
1241)  </para>
1242) 
1243) 
1244)  <para>
1245) 
1246) Since most plugins completely ignore browser proxy settings, the actions
1247) performed by this setting are crucial to satisfying the <link
1248) linkend="proxy">Proxy Obedience</link> requirement.
1249) 
1250)  </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1251) </sect3>
1252) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1253)  <title>Isolate Dynamic Content to Tor State (crucial)</title>
1254) 
1255)  <para>Option: <command>extensions.torbutton.isolate_content</command></para>
1256) 
1257) <para>Enabling this preference is what enables the <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1258) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cssblocker.js">@torproject.org/cssblocker;1</ulink> content policy
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1259) mentioned above, and causes it to block content load attempts in pages an
1260) opposite Tor state from the current state. Freshly loaded <ulink
1261) url="https://developer.mozilla.org/en/XUL/tabbrowser">browser
1262) tabs</ulink> are tagged
1263) with a <command>__tb_load_state</command> member in
1264) <function>torbutton_update_tags()</function> and this
1265) value is compared against the current tor state in the content policy.</para>
1266) 
1267) <para>It also kills all Javascript in each page loaded under that state by
1268) toggling the <command>allowJavascript</command> <ulink
1269) url="https://developer.mozilla.org/en/XUL%3aProperty%3adocShell">docShell</ulink> property, and issues a
1270) <ulink
1271) url="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIWebNavigation#stop()">webNavigation.stop(webNavigation.STOP_ALL)</ulink> to each browser tab (the
1272) equivalent of hitting the STOP button).</para>
1273) 
1274) <para>
1275) 
1276) Unfortunately, <ulink
1277) url="https://bugzilla.mozilla.org/show_bug.cgi?id=409737">Firefox bug
1278) 409737</ulink> prevents <command>docShell.allowJavascript</command> from killing
1279) all event handlers, and event handlers registered with <ulink
1280) url="http://developer.mozilla.org/en/docs/DOM:element.addEventListener">addEventListener()</ulink>
1281) are still able to execute. The <link linkend="contentpolicy">Torbutton Content
1282) Policy</link> should prevent such code from performing network activity within
1283) the current tab, but activity that happens via a popup window or via a
1284) Javascript redirect can still slip by. For this reason, Torbutton blocks
1285) popups by checking for a valid <ulink
1286) url="http://developer.mozilla.org/en/docs/DOM:window.opener">window.opener</ulink>
1287) attribute in <function>torbutton_check_progress()</function>. If the window
1288) has an opener from a different Tor state, its load is blocked. The content
1289) policy also takes similar action to prevent Javascript redirects. This also
1290) has the side effect/feature of preventing the user from following any links
1291) from a page loaded in an opposite Tor state.
1292) 
1293) </para>
1294) 
1295) <para>
1296) This setting is responsible for satisfying the <link
1297) linkend="isolation">Network Isolation</link> requirement.
1298) </para>
1299) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1300) </sect3>
1301) <sect3 id="jshooks">
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1302) 
1303) <title>Hook Dangerous Javascript</title>
1304) 
1305)  <para>Option: <command>extensions.torbutton.kill_bad_js</command></para>
1306) 
1307) <para>This setting enables injection of the <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1308) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/jshooks.js">Javascript
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1309) hooking code</ulink>. This is done in the chrome in
1310) <function>torbutton_hookdoc()</function>, which is called ultimately by both the 
1311) <ulink
1312) url="https://developer.mozilla.org/en/nsIWebProgressListener">webprogress
1313) listener</ulink> <command>torbutton_weblistener</command> and the <link
1314) linkend="contentpolicy">content policy</link> (the latter being a hack to handle
1315) javascript: urls).
1316) 
1317) In the Firefox 2 days, this option did a lot more than
1318) it does now. It used to be responsible for timezone and improved useragent
1319) spoofing, and history object cloaking. However, now it only provides
1320) obfuscation of the <ulink
1321) url="https://developer.mozilla.org/en/DOM/window.screen">window.screen</ulink>
1322) object to mask your browser and desktop resolution.
1323) The resolution hooks
1324) effectively make the Firefox browser window appear to websites as if the renderable area
1325) takes up the entire desktop, has no toolbar or other GUI element space, and
1326) the desktop itself has no toolbars.
1327) These hooks drastically reduce the amount of information available to do <link
1328) linkend="fingerprinting">anonymity set reduction attacks</link> and help to
1329) meet the <link linkend="setpreservation">Anonymity Set Preservation</link>
1330) requirements. Unfortunately, Gregory Fleischer discovered it is still possible
1331) to retrieve the original screen values by using <ulink
1332) url="http://pseudo-flaw.net/tor/torbutton/unmask-sandbox-xpcnativewrapper.html">XPCNativeWrapper</ulink>
1333) or <ulink
1334) url="http://pseudo-flaw.net/tor/torbutton/unmask-components-lookupmethod.html">Components.lookupMethod</ulink>.
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1335) We are still looking for a workaround as of Torbutton 1.3.2.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1336) 
1337) <!-- FIXME: Don't forget to update this -->
1338) 
1339) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1340) </sect3>
1341) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1342) <title>Resize windows to multiples of 50px during Tor usage (recommended)</title>
1343) 
1344)  <para>Option: <command>extensions.torbutton.resize_windows</command></para>
1345) 
1346) <para>
1347) 
1348) This option drastically cuts down on the number of distinct anonymity sets
1349) that divide the Tor web userbase. Without this setting, the dimensions for a
1350) typical browser window range from 600-1200 horizontal pixels and 400-1000
1351) vertical pixels, or about 600x600 = 360000 different sets. Resizing the
1352) browser window to multiples of 50 on each side reduces the number of sets by
1353) 50^2, bringing the total number of sets to 144. Of course, the distribution
1354) among these sets are not uniform, but scaling by 50 will improve the situation
1355) due to this non-uniformity for users in the less common resolutions.
1356) Obviously the ideal situation would be to lie entirely about the browser
1357) window size, but this will likely cause all sorts of rendering issues, and is
1358) also not implementable in a foolproof way from extension land.
1359) 
1360) </para>
1361) <para>
1362) 
1363) The implementation of this setting is spread across a couple of different
1364) locations in the Torbutton javascript <link linkend="browseroverlay">browser
1365) overlay</link>. Since resizing minimized windows causes them to be restored,
1366) and since maximized windows remember their previous size to the pixel, windows
1367) must be resized before every document load (at the time of browser tagging)
1368) via <function>torbutton_check_round()</function>, called by
1369) <function>torbutton_update_tags()</function>. To prevent drift, the extension
1370) tracks the original values of the windows and uses this to perform the
1371) rounding on document load. In addition, to prevent the user from resizing a
1372) window to a non-50px multiple, a resize listener
1373) (<function>torbutton_do_resize()</function>) is installed on every new browser
1374) window to record the new size and round it to a 50px multiple while Tor is
1375) enabled. In all cases, the browser's contentWindow.innerWidth and innerHeight
1376) are set. This ensures that there is no discrepancy between the 50 pixel cutoff
1377) and the actual renderable area of the browser (so that it is not possible to
1378) infer toolbar size/presence by the distance to the nearest 50 pixel roundoff).
1379) 
1380) </para>
1381) <para>
1382) This setting helps to meet the <link
1383) linkend="setpreservation">Anonymity Set Preservation</link> requirements.
1384) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1385) </sect3>
1386) <sect3>
1387) 
1388) <title>Disable Search Suggestions during Tor (recommended)</title>
1389) 
1390)   <para>Option: <command>extensions.torbutton.no_search</command></para>
1391) 
1392) <para>
1393) This setting causes Torbutton to disable <ulink
1394) url="http://kb.mozillazine.org/Browser.search.suggest.enabled"><command>browser.search.suggest.enabled</command></ulink>
1395) during Tor usage.
1396) This governs if you get Google search suggestions during Tor
1397) usage. Your Google cookie is transmitted with google search suggestions, hence
1398) this is recommended to be disabled.
1399) 
1400) </para>
1401) <para>
1402) While this setting doesn't satisfy any Torbutton requirements, the fact that
1403) cookies are transmitted for partially typed queries does not seem desirable
1404) for Tor usage.
1405) </para>
1406) </sect3>
1407) 
1408) 
1409) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1410) <title>Disable Updates During Tor</title>
1411) 
1412)   <para>Option: <command>extensions.torbutton.no_updates</command></para>
1413) 
1414)   <para>This setting causes Torbutton to disable the four <ulink
1415) url="http://wiki.mozilla.org/Update:Users/Checking_For_Updates#Preference_Controls_and_State">Firefox
1416) update settings</ulink> during Tor
1417)   usage: <command>extensions.update.enabled</command>,
1418) <command>app.update.enabled</command>,
1419)   <command>app.update.auto</command>, and
1420) <command>browser.search.update</command>.  These prevent the
1421)   browser from updating extensions, checking for Firefox upgrades, and
1422)   checking for search plugin updates while Tor is enabled.
1423)   </para>
1424) <para>
1425) This setting satisfies the <link
1426) linkend="updates">Update Safety</link> requirement.
1427) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1428) </sect3>
1429) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1430) <title>Redirect Torbutton Updates Via Tor (recommended)</title>
1431) 
1432)   <para>Option: <command>extensions.torbutton.update_torbutton_via_tor</command></para>
1433) 
1434)   <para>This setting causes Torbutton to install an
1435) 
1436) <ulink
1437) url="https://developer.mozilla.org/en/nsIProtocolProxyFilter">nsIProtocolProxyFilter</ulink>
1438) in order to redirect all version update checks and Torbutton update downloads
1439) via Tor, regardless of if Tor is enabled or not. This was done both to address
1440) concerns about data retention done by <ulink
1441) url="https://www.addons.mozilla.org">addons.mozilla.org</ulink>, as well as to
1442) help censored users meet the <link linkend="undiscoverability">Tor
1443) Undiscoverability</link> requirement.
1444) 
1445)   </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1446) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1447) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1448) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1449) <title>Disable livemarks updates during Tor usage (recommended)</title>
1450)   <para>Option:
1451)    <simplelist>
1452)    <member><command>extensions.torbutton.disable_livemarks</command></member>
1453)    </simplelist>
1454)   </para>
1455) 
1456) <para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1457) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1458) This option causes Torbutton to prevent Firefox from loading <ulink
1459) url="http://www.mozilla.com/firefox/livebookmarks.html">Livemarks</ulink> during
1460) Tor usage. Because people often have very personalized Livemarks (such as RSS
1461) feeds of Wikipedia articles they maintain, etc). This is accomplished both by
1462) <link linkend="livemarks">wrapping the livemark-service component</link> and
1463) by calling stopUpdateLivemarks() on the <ulink
1464) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/livemark-service;2">Livemark
1465) service</ulink> when Tor is enabled.
1466) 
1467) </para>
1468) 
1469) <para>
1470) This helps satisfy the <link linkend="isolation">Network
1471) Isolation</link> and <link linkend="setpreservation">Anonymity Set
1472) Preservation</link> requirements.
1473) </para>
1474) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1475) </sect3>
1476) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1477) <title>Block Tor/Non-Tor access to network from file:// urls (recommended)</title>
1478)   <para>Options:
1479)    <simplelist>
1480)    <member><command>extensions.torbutton.block_tor_file_net</command></member>
1481)    <member><command>extensions.torbutton.block_nontor_file_net</command></member>
1482)    </simplelist>
1483)   </para>
1484) 
1485) <para>
1486) 
1487) These settings prevent file urls from performing network operations during the
1488) respective Tor states. Firefox 2's implementation of same origin policy allows
1489) file urls to read and <ulink
1490) url="http://www.gnucitizen.org/blog/content-disposition-hacking/">submit
1491) arbitrary files from the local filesystem</ulink> to arbitrary websites. To
1492) make matters worse, the 'Content-Disposition' header can be injected
1493) arbitrarily by exit nodes to trick users into running arbitrary html files in
1494) the local context. These preferences cause the <link
1495) linkend="contentpolicy">content policy</link> to block access to any network
1496) resources from File urls during the appropriate Tor state.
1497) 
1498) </para>
1499) <para>
1500) 
1501) This preference helps to ensure Tor's <link linkend="isolation">Network
1502) Isolation</link> requirement, by preventing file urls from executing network
1503) operations in opposite Tor states. Also, allowing pages to submit arbitrary
1504) files to arbitrary sites just generally seems like a bad idea.
1505) 
1506) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1507) </sect3>
1508) 
1509) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1510) 
1511) <title>Close all Tor/Non-Tor tabs and windows on toggle (optional)</title>
1512) 
1513)   <para>Options:
1514)    <simplelist>
1515)    <member><command>extensions.torbutton.close_nontor</command></member>
1516)    <member><command>extensions.torbutton.close_tor</command></member>
1517)    </simplelist>
1518)   </para>
1519) 
1520) <para>
1521) 
1522) These settings cause Torbutton to enumerate through all windows and close all
1523) tabs in each window for the appropriate Tor state. This code can be found in
1524) <function>torbutton_update_status()</function>.  The main reason these settings
1525) exist is as a backup mechanism in the event of any Javascript or content policy
1526) leaks due to <ulink
1527) url="https://bugzilla.mozilla.org/show_bug.cgi?id=409737">Firefox Bug
1528) 409737</ulink>.  Torbutton currently tries to block all Javascript network
1529) activity via the content policy, but until that bug is fixed, there is some
1530) risk that there are alternate ways to bypass the policy. This option is
1531) available as an extra assurance of <link linkend="isolation">Network
1532) Isolation</link> for those who would like to be sure that when Tor is toggled
1533) all page activity has ceased. It also serves as a potential future workaround
1534) in the event a content policy failure is discovered, and provides an additional
1535) level of protection for the <link linkend="disk">Disk Avoidance</link>
1536) protection so that browser state is not sitting around waiting to be swapped
1537) out longer than necessary.
1538) 
1539) </para>
1540) <para>
1541) While this setting doesn't satisfy any Torbutton requirements, the fact that
1542) cookies are transmitted for partially typed queries does not seem desirable
1543) for Tor usage.
1544) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1545) </sect3>
1546)  </sect2>
1547)  <sect2>
1548)   <title>History and Forms Settings</title>
1549) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1550) <title>Isolate Access to History navigation to Tor state (crucial)</title>
1551)   <para>Option: <command>extensions.torbutton.block_js_history</command></para>
1552)   <para>
1553) This setting determines if Torbutton installs an <ulink
1554) url="http://www.oxymoronical.com/experiments/apidocs/interface/nsISHistoryListener">nsISHistoryListener</ulink>
1555) attached to the <ulink
1556) url="http://www.oxymoronical.com/experiments/apidocs/interface/nsISHistory">sessionHistory</ulink> of 
1557) of each browser's <ulink
1558) url="https://developer.mozilla.org/en/XUL%3aProperty%3awebNavigation">webNavigatator</ulink>.
1559) The nsIShistoryListener is instantiated with a reference to the containing
1560) browser window and blocks the back, forward, and reload buttons on the browser
1561) navigation bar when Tor is in an opposite state than the one to load the
1562) current tab. In addition, Tor clears the session history during a new document
1563) load if this setting is enabled. 
1564) 
1565)   </para>
1566)   <para>
1567) 
1568) This is marked as a crucial setting in part
1569) because Javascript access to the history object is indistinguishable from 
1570) user clicks, and because
1571) <ulink
1572) url="https://bugzilla.mozilla.org/show_bug.cgi?id=409737">Firefox Bug
1573) 409737</ulink> allows javascript to execute in opposite Tor states, javascript
1574) can issue reloads after Tor toggle to reveal your original IP. Even without
1575) this bug, however, Javascript is still able to access previous pages in your
1576) session history that may have been loaded under a different Tor state, to
1577) attempt to correlate your activity.
1578) 
1579)    </para>
1580)    <para>
1581) 
1582) This setting helps to fulfill Torbutton's <link linkend="state">State
1583) Separation</link> and (until Bug 409737 is fixed) <link linkend="isolation">Network Isolation</link>
1584) requirements.
1585) 
1586)    </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1587) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1588) 
1589) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1590) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1591) <title>History Access Settings</title>
1592) 
1593)   <para>Options:
1594)   <simplelist>
1595)    <member><command>extensions.torbutton.block_thread</command></member>
1596)    <member><command>extensions.torbutton.block_nthread</command></member>
1597)    <member><command>extensions.torbutton.block_thwrite</command></member>
1598)    <member><command>extensions.torbutton.block_nthwrite</command></member>
1599)   </simplelist>
1600)   </para>
1601) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1602) <para>On Firefox 3.x, these four settings govern the behavior of the <ulink
1603) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/ignore-history.js">components/ignore-history.js</ulink>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1604) history blocker component mentioned above. By hooking the browser's view of
1605) the history itself via the <ulink
1606) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/global-history;2">@mozilla.org/browser/global-history;2</ulink>
1607) and <ulink
1608) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/browser/nav-history-service;1">@mozilla.org/browser/nav-history-service;1</ulink>
1609) components, this mechanism defeats all document-based <ulink
1610) url="http://whattheinternetknowsaboutyou.com/">history disclosure
1611) attacks</ulink>, including <ulink
1612) url="http://ha.ckers.org/weird/CSS-history.cgi">CSS-only attacks</ulink>.
1613) 
1614) The component also hooks functions involved in writing history to disk via
1615) both the <ulink
1616) url="http://developer.mozilla.org/en/docs/Places_migration_guide#History">Places
1617) Database</ulink> and the older Firefox 2 mechanisms.
1618) 
1619) </para>
1620) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1621) <para>
1622) On Firefox 4, Mozilla finally <ulink
1623) url="https://developer.mozilla.org/en/CSS/Privacy_and_the_%3avisited_selector">addressed
1624) these issues</ulink>, so we can effectively ignore the "read" pair of the
1625) above prefs. We then only need to link the write prefs to
1626) <command>places.history.enabled</command>, which disabled writing to the
1627) history store while set.
1628) </para>
1629) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1630) <para>
1631) This setting helps to satisfy the <link
1632) linkend="state">State Separation</link> and <link
1633) linkend="disk">Disk Avoidance</link> requirements.
1634) </para>
1635) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1636) </sect3>
1637) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1638) 
1639) <title>Clear History During Tor Toggle (optional)</title>
1640) 
1641) <para>Option: <command>extensions.torbutton.clear_history</command></para>
1642) 
1643) <para>This setting governs if Torbutton calls
1644) <ulink
1645) url="https://developer.mozilla.org/en/nsIBrowserHistory#removeAllPages.28.29">nsIBrowserHistory.removeAllPages</ulink>
1646) and <ulink
1647) url="http://www.oxymoronical.com/experiments/apidocs/interface/nsISHistory">nsISHistory.PurgeHistory</ulink>
1648) for each tab on Tor toggle.</para>
1649) <para>
1650) This setting is an optional way to help satisfy the <link
1651) linkend="state">State Separation</link> requirement.
1652) </para>
1653) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1654) </sect3>
1655) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1656) <title>Block Password+Form saving during Tor/Non-Tor</title>
1657) 
1658) <para>Options:
1659)   <simplelist>
1660)   <member><command>extensions.torbutton.block_tforms</command></member>
1661)   <member><command>extensions.torbutton.block_ntforms</command></member>
1662)   </simplelist>
1663)   </para>
1664) 
1665) <para>These settings govern if Torbutton disables
1666) <command>browser.formfill.enable</command>
1667) and <command>signon.rememberSignons</command> during Tor and Non-Tor usage.
1668) Since form fields can be read at any time by Javascript, this setting is a lot
1669) more important than it seems.
1670) </para>
1671) 
1672) <para>
1673) This setting helps to satisfy the <link
1674) linkend="state">State Separation</link> and <link
1675) linkend="disk">Disk Avoidance</link> requirements.
1676) </para>
1677) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1678) </sect3>
1679)  </sect2>
1680)  <sect2>
1681)   <title>Cache Settings</title>
1682) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1683)   <title>Block Tor disk cache and clear all cache on Tor Toggle</title>
1684) 
1685)   <para>Option: <command>extensions.torbutton.clear_cache</command>
1686)   </para>
1687) 
1688) <para>This option causes Torbutton to call <ulink
1689) url="https://developer.mozilla.org/en/nsICacheService#evictEntries.28.29">nsICacheService.evictEntries(0)</ulink>
1690) on Tor toggle to remove all entries from the cache. In addition, this setting
1691) causes Torbutton to set <ulink
1692) url="http://kb.mozillazine.org/Browser.cache.disk.enable">browser.cache.disk.enable</ulink> to false.
1693) </para>
1694) <para>
1695) This setting helps to satisfy the <link
1696) linkend="state">State Separation</link> and <link
1697) linkend="disk">Disk Avoidance</link> requirements.
1698) </para>
1699) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1700) </sect3>
1701) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1702)   <title>Block disk and memory cache during Tor</title>
1703) 
1704) <para>Option: <command>extensions.torbutton.block_cache</command></para>
1705) 
1706) <para>This setting
1707) causes Torbutton to set <ulink
1708) url="http://kb.mozillazine.org/Browser.cache.memory.enable">browser.cache.memory.enable</ulink>,
1709) <ulink
1710) url="http://kb.mozillazine.org/Browser.cache.disk.enable">browser.cache.disk.enable</ulink> and
1711) <ulink
1712) url="http://kb.mozillazine.org/Network.http.use-cache">network.http.use-cache</ulink> to false during tor usage.
1713) </para>
1714) <para>
1715) This setting helps to satisfy the <link
1716) linkend="state">State Separation</link> and <link
1717) linkend="disk">Disk Avoidance</link> requirements.
1718) </para>
1719) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1720) </sect3>
1721)  </sect2>
1722)  <sect2>
1723)   <title>Cookie and Auth Settings</title>
1724) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1725)   <title>Clear Cookies on Tor Toggle</title>
1726) 
1727) <para>Option: <command>extensions.torbutton.clear_cookies</command>
1728)   </para>
1729) 
1730) <para>
1731) 
1732) This setting causes Torbutton to call <ulink
1733) url="https://developer.mozilla.org/en/nsICookieManager#removeAll.28.29">nsICookieManager.removeAll()</ulink> on
1734) every Tor toggle. In addition, this sets <ulink
1735) url="http://kb.mozillazine.org/Network.cookie.lifetimePolicy">network.cookie.lifetimePolicy</ulink>
1736) to 2 for Tor usage, which causes all cookies to be demoted to session cookies,
1737) which prevents them from being written to disk. 
1738) 
1739) </para>
1740) <para>
1741) This setting helps to satisfy the <link
1742) linkend="state">State Separation</link> and <link
1743) linkend="disk">Disk Avoidance</link> requirements.
1744) </para>
1745) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1746) </sect3>
1747) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1748)   
1749)   <title>Store Non-Tor cookies in a protected jar</title>
1750) 
1751) <para>Option: <command>extensions.torbutton.cookie_jars</command>
1752)   </para>
1753) 
1754) <para>
1755) 
1756) This setting causes Torbutton to use <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1757) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js">@torproject.org/cookie-jar-selector;2</ulink> to store
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1758) non-tor cookies in a cookie jar during Tor usage, and clear the Tor cookies
1759) before restoring the jar.
1760) </para>
1761) <para>
1762) This setting also sets <ulink
1763) url="http://kb.mozillazine.org/Network.cookie.lifetimePolicy">network.cookie.lifetimePolicy</ulink>
1764) to 2 for Tor usage, which causes all cookies to be demoted to session cookies,
1765) which prevents them from being written to disk. 
1766) 
1767) </para>
1768) 
1769) <para>
1770) This setting helps to satisfy the <link
1771) linkend="state">State Separation</link> and <link
1772) linkend="disk">Disk Avoidance</link> requirements.
1773) </para>
1774) 
1775) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1776) </sect3>
1777) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1778) 
1779)   <title>Store both Non-Tor and Tor cookies in a protected jar (dangerous)</title>
1780) 
1781) <para>Option: <command>extensions.torbutton.dual_cookie_jars</command>
1782)   </para>
1783) 
1784) <para>
1785) 
1786) This setting causes Torbutton to use <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1787) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js">@torproject.org/cookie-jar-selector;2</ulink> to store
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1788) both Tor and Non-Tor cookies into protected jars.
1789) </para>
1790) 
1791) <para>
1792) This setting helps to satisfy the <link
1793) linkend="state">State Separation</link> requirement.
1794) </para>
1795) 
1796) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1797) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1798) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1799) <!-- FIXME: If we decide to keep it, document the cookie protections dialog
1800) -->
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1801) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1802) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1803) 
1804)   <title>Manage My Own Cookies (dangerous)</title>
1805) 
1806) <para>Options: None</para>
1807) <para>This setting disables all Torbutton cookie handling by setting the above
1808) cookie prefs all to false.</para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1809) </sect3>
1810) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1811) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1812) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1813)   <title>Do not write Tor/Non-Tor cookies to disk</title>
1814)   <para>Options:
1815)   <simplelist>
1816)   <member><command>extensions.torbutton.tor_memory_jar</command></member>
1817)   <member><command>extensions.torbutton.nontor_memory_jar</command></member>
1818)   </simplelist>
1819)   </para>
1820) 
1821) <para>
1822) These settings (contributed by arno) cause Torbutton to set <ulink
1823) url="http://kb.mozillazine.org/Network.cookie.lifetimePolicy">network.cookie.lifetimePolicy</ulink>
1824) to 2 during the appropriate Tor state, and to store cookies acquired in that
1825) state into a Javascript
1826) <ulink
1827) url="http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Guide:Processing_XML_with_E4X">E4X</ulink>
1828) object as opposed to writing them to disk.
1829) </para>
1830) 
1831) <para>
1832) This allows Torbutton to provide an option to preserve a user's 
1833) cookies while still satisfying the <link linkend="disk">Disk Avoidance</link>
1834) requirement.
1835) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1836) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1837) 
1838) 
1839)   <title>Disable DOM Storage during Tor usage (crucial)</title>
1840) 
1841) <para>Option: <command>extensions.torbutton.disable_domstorage</command>
1842)   </para>
1843) 
1844) <para>
1845) 
1846) This setting causes Torbutton to toggle <command>dom.storage.enabled</command> during Tor
1847) usage to prevent 
1848) <ulink
1849)   url="http://developer.mozilla.org/en/docs/DOM:Storage">DOM Storage</ulink> from
1850)   being used to store persistent information across Tor states.</para>
1851) <para>
1852) This setting helps to satisfy the <link
1853) linkend="state">State Separation</link> requirement.
1854) </para>
1855) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1856) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1857) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1858) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1859)   <title>Clear HTTP Auth on Tor Toggle (recommended)</title>
1860) <para>Option: <command>extensions.torbutton.clear_http_auth</command>
1861)   </para>
1862) 
1863) <para>
1864) This setting causes Torbutton to call <ulink
1865) url="http://www.oxymoronical.com/experiments/apidocs/interface/nsIHttpAuthManager">nsIHttpAuthManager.clearAll()</ulink>
1866) every time Tor is toggled.
1867) </para>
1868) 
1869) <para>
1870) This setting helps to satisfy the <link
1871) linkend="state">State Separation</link> requirement.
1872) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1873) </sect3>
1874)  </sect2>
1875)  <sect2>
1876)   <title>Startup Settings</title>
1877) <sect3>
1878)   <title>On Browser Startup, set Tor state to: Tor, Non-Tor</title>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1879)   <para>Options:
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1880)    <command>extensions.torbutton.restore_tor</command>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1881)   </para>
1882) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1883)   <para>This option governs what Tor state tor is loaded in to.
1884) <function>torbutton_set_initial_state()</function> covers the case where the
1885) browser did not crash, and <function>torbutton_crash_recover()</function>
1886) covers the case where the <link linkend="crashobserver">crash observer</link>
1887) detected a crash.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1888) </para>
1889) <para>
1890) 
1891) Since the Tor state after a Firefox crash is unknown/indeterminate, this
1892) setting helps to satisfy the <link linkend="state">State Separation</link>
1893) requirement in the event of Firefox crashes by ensuring all cookies,
1894) settings and saved sessions are reloaded from a fixed Tor state.
1895)  
1896) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1897) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1898) 
1899) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1900) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1901)   <title>Prevent session store from saving Non-Tor/Tor-loaded tabs</title>
1902) 
1903)   <para>Options: 
1904)   <simplelist>
1905)     <member><command>extensions.torbutton.nonontor_sessionstore</command></member>
1906)     <member><command>extensions.torbutton.notor_sessionstore</command></member>
1907)   </simplelist>
1908)   </para>
1909) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1910)   <para>If these options are enabled, the <link
1911) linkend="tbsessionstore">tbSessionStore.js</link> component uses the session
1912) store listeners to filter out the appropriate tabs before writing the session
1913) store data to disk.
1914) </para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1915) <para>
1916) This setting helps to satisfy the <link linkend="disk">Disk Avoidance</link>
1917) requirement, and also helps to satisfy the <link
1918) linkend="state">State Separation</link> requirement in the event of Firefox
1919) crashes.
1920) 
1921) </para>
1922) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1923) </sect3>
1924)  </sect2>
1925)  <sect2>
1926)   <title>Shutdown Settings</title>
1927) <sect3>
1928) 
1929)   <title>Clear cookies on Tor/Non-Tor shutdown</title>
1930) 
1931) <para>Option: <command>extensions.torbutton.shutdown_method</command>
1932)   </para>
1933) 
1934) <para> This option variable can actually take 3 values: 0, 1, and 2. 0 means no
1935) cookie clearing, 1 means clear only during Tor-enabled shutdown, and 2 means
1936) clear for both Tor and Non-Tor shutdown. When set to 1 or 2, Torbutton listens
1937) for the <ulink
1938) url="http://developer.mozilla.org/en/docs/Observer_Notifications#Application_shutdown">quit-application-granted</ulink> event in
1939) <link linkend="crashobserver">crash-observer.js</link> and use <ulink
1940) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/cookie-jar-selector.js">@torproject.org/cookie-jar-selector;2</ulink>
1941) to clear out all cookies and all cookie jars upon shutdown.
1942) </para>
1943) <para>
1944) This setting helps to satisfy the <link
1945) linkend="state">State Separation</link> requirement.
1946) </para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1947) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

1948) 
1949) </sect3>
1950)  </sect2>
1951)  <sect2>
1952)   <title>Header Settings</title>
1953) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

1954) 
1955)   <title>Set user agent during Tor usage (crucial)</title>
1956)   <para>Options:
1957)    <simplelist>
1958)     <member><command>extensions.torbutton.set_uagent</command></member>
1959)     <member><command>extensions.torbutton.platform_override</command></member>
1960)     <member><command>extensions.torbutton.oscpu_override</command></member>
1961)     <member><command>extensions.torbutton.buildID_override</command></member>
1962)     <member><command>extensions.torbutton.productsub_override</command></member>
1963)     <member><command>extensions.torbutton.appname_override</command></member>
1964)     <member><command>extensions.torbutton.appversion_override</command></member>
1965)     <member><command>extensions.torbutton.useragent_override</command></member>
1966)     <member><command>extensions.torbutton.useragent_vendor</command></member>
1967)     <member><command>extensions.torbutton.useragent_vendorSub</command></member>
1968)   </simplelist>
1969)    </para>
1970) 
1971) <para>On face, user agent switching appears to be straight-forward in Firefox.
1972) It provides several options for controlling the browser user agent string:
1973) <command>general.appname.override</command>,
1974) <command>general.appversion.override</command>,
1975) <command>general.platform.override</command>,
1976) <command>general.oscpu.override</command>,
1977) <command>general.productSub.override</command>,
1978) <command>general.buildID.override</command>,
1979) <command>general.useragent.override</command>,
1980) <command>general.useragent.vendor</command>, and
1981) <command>general.useragent.vendorSub</command>. If
1982) the Torbutton preference <command>extensions.torbutton.set_uagent</command> is
1983) true, Torbutton copies all of the other above prefs into their corresponding
1984) browser preferences during Tor usage.</para>
1985) 
1986) 
1987) <para>
1988) 
1989) It also turns out that it is possible to detect the original Firefox version
1990) by <ulink url="http://ha.ckers.org/blog/20070516/read-firefox-settings-poc/">inspecting
1991) certain resource:// files</ulink>. These cases are handled by Torbutton's
1992) <link linkend="contentpolicy">content policy</link>.
1993) 
1994) </para>
1995) 
1996) <para>
1997) This setting helps to satisfy the <link
1998) linkend="setpreservation">Anonymity Set Preservation</link> requirement.
1999) </para>
2000) 
2001) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2002) </sect3>
2003) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2004) 
2005)   <title>Spoof US English Browser</title>
2006) <para>Options:
2007) <simplelist>
2008)  <member><command>extensions.torbutton.spoof_english</command></member>
2009)  <member><command>extensions.torbutton.spoof_charset</command></member>
2010)  <member><command>extensions.torbutton.spoof_language</command></member>
2011) </simplelist>
2012) </para>
2013) 
2014) <para> This option causes Torbutton to set
2015) <command>general.useragent.locale</command>
2016) <command>intl.accept_languages</command> to the value specified in
2017) <command>extensions.torbutton.spoof_locale</command>,
2018) <command>extensions.torbutton.spoof_charset</command> and
2019) <command>extensions.torbutton.spoof_language</command> during Tor usage, as
2020) well as hooking <command>navigator.language</command> via its <link
2021) linkend="jshooks">javascript hooks</link>.
2022)  </para>
2023) <para>
2024) This setting helps to satisfy the <link
2025) linkend="setpreservation">Anonymity Set Preservation</link> and <link
2026) linkend="location">Location Neutrality</link> requirements.
2027) </para>
2028) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2029) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2030) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2031) <sect3>
2032)   <title>Referer Spoofing Options</title>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2033) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2034) <para>Option: <command>extensions.torbutton.refererspoof</command>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2035) </para>
2036) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2037) <para>
2038) This option variable has three values. If it is 0, "smart" referer spoofing is
2039) enabled. If it is 1, the referer behaves as normal. If it is 2, no referer is
2040) sent. The default value is 1. The smart referer spoofing is implemented by the
2041) <link linkend="refspoofer">torRefSpoofer</link> component.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2042) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2043) </para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2044) <para>
2045) This setting also does not directly satisfy any Torbutton requirement, but
2046) some may desire to mask their referrer for general privacy concerns.
2047) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2048) </sect3>
2049) 
2050) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2051)   <title>Strip platform and language off of Google Search Box queries</title>
2052) 
2053) <para>Option: <command>extensions.torbutton.fix_google_srch</command>
2054) </para>
2055) 
2056) <para> 
2057) 
2058) This option causes Torbutton to use the <ulink
2059) url="https://wiki.mozilla.org/Search_Service:API">@mozilla.org/browser/search-service;1</ulink>
2060) component to wrap the Google search plugin. On many platforms, notably Debian
2061) and Ubuntu, the Google search plugin is set to reveal a lot of language and
2062) platform information. This setting strips off that info while Tor is enabled.
2063) 
2064) </para>
2065) <para>
2066) This setting helps Torbutton to fulfill its <link
2067) linkend="setpreservation">Anonymity Set Preservation</link> requirement.
2068) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2069) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2070) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2071) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2072)   <title>Automatically use an alternate search engine when presented with a
2073) Google Captcha</title>
2074) 
2075) <para>Options:
2076) <simplelist>
2077)  <member><command>extensions.torbutton.asked_google_captcha</command></member>
2078)  <member><command>extensions.torbutton.dodge_google_captcha</command></member>
2079)  <member><command>extensions.torbutton.google_redir_url</command></member>
2080) </simplelist>
2081) </para>
2082) 
2083) <para>
2084) 
2085) Google's search engine has rate limiting features that cause it to
2086) <ulink
2087) url="http://googleonlinesecurity.blogspot.com/2007/07/reason-behind-were-sorry-message.html">present
2088) captchas</ulink> and sometimes even outright ban IPs that issue large numbers
2089) of search queries, especially if a lot of these queries appear to be searching
2090) for software vulnerabilities or unprotected comment areas.
2091) 
2092) </para>
2093) <para>
2094) 
2095) Despite multiple discussions with Google, we were unable to come to a solution
2096) or any form of compromise that would reduce the number of captchas and
2097) outright bans seen by Tor users issuing regular queries.
2098) 
2099) </para>
2100) <para>
2101) As a result, we've implemented this option as an <ulink
2102) url="https://developer.mozilla.org/en/XUL_School/Intercepting_Page_Loads#HTTP_Observers">'http-on-modify-request'</ulink>
2103) http observer to optionally redirect banned or captcha-triggering Google
2104) queries to search engines that do not rate limit Tor users. The current
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2105) options are duckduckgo.com, ixquick.com, bing.com, yahoo.com and scroogle.org. These are
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2106) encoded in the preferences
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2107) <command>extensions.torbutton.redir_url.[1-5]</command>.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2108) 
2109) </para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2110) </sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2111) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2112) <sect3>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2113) 
2114)   <title>Store SSL/CA Certs in separate jars for Tor/Non-Tor (recommended)</title>
2115) 
2116) <para>Options:
2117) <simplelist>
2118)  <member><command>extensions.torbutton.jar_certs</command></member>
2119)  <member><command>extensions.torbutton.jar_ca_certs</command></member>
2120) </simplelist>
2121) </para>
2122) <para>
2123) 
2124) These settings govern if Torbutton attempts to isolate the user's SSL
2125) certificates into separate jars for each Tor state. This isolation is
2126) implemented in <function>torbutton_jar_certs()</function> in <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2127) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/chrome/content/torbutton.js">chrome/content/torbutton.js</ulink>,
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2128) which calls <function>torbutton_jar_cert_type()</function> and
2129) <function>torbutton_unjar_cert_type()</function> for each certificate type in
2130) the <ulink
2131) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/security/nsscertcache;1">@mozilla.org/security/nsscertcache;1</ulink>.
2132) Certificates are deleted from and imported to the <ulink
2133) url="http://www.oxymoronical.com/experiments/xpcomref/applications/Firefox/3.5/components/%40mozilla.org/security/x509certdb;1">@mozilla.org/security/x509certdb;1</ulink>.
2134) </para>
2135) 
2136) <para>
2137) The first time this pref is used, a backup of the user's certificates is
2138) created in their profile directory under the name
2139) <filename>cert8.db.bak</filename>. This file can be copied back to
2140) <filename>cert8.db</filename> to fully restore the original state of the
2141) user's certificates in the event of any error.
2142) </para>
2143) 
2144) <para>
2145) Since exit nodes and malicious sites can insert content elements sourced to
2146) specific SSL sites to query if a user has a certain certificate,
2147) this setting helps to satisfy the <link linkend="state">State
2148) Separation</link> requirement of Torbutton. Unfortunately, <ulink
2149) url="https://bugzilla.mozilla.org/show_bug.cgi?id=435159">Firefox Bug
2150) 435159</ulink> prevents it from functioning correctly in the event of rapid Tor toggle, so it
2151) is currently not exposed via the preferences UI.
2152) 
2153) </para>
2154) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2155) </sect3>
2156) 
2157) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2158) </sect2>
2159) </sect1>
2160) 
2161) <sect1 id="FirefoxBugs">
2162)   <title>Relevant Firefox Bugs</title>
2163)   <para>
2164) 
2165)   </para>
2166)   <sect2 id="FirefoxSecurity">
2167)    <title>Bugs impacting security</title>
2168)    <para>
2169) 
2170) Torbutton has to work around a number of Firefox bugs that impact its
2171) security. Most of these are mentioned elsewhere in this document, but they
2172) have also been gathered here for reference. In order of decreasing severity,
2173) they are:
2174) 
2175)    </para>
2176)    <orderedlist>
2177)     <listitem><ulink
2178) url="https://bugzilla.mozilla.org/show_bug.cgi?id=429070">Bug 429070 - exposing
2179) Components.interfaces to untrusted content leaks information about installed
2180) extensions</ulink>
2181)      <para>
2182) <ulink url="http://pseudo-flaw.net/">Gregory Fleischer</ulink> demonstrated at Defcon 17 that these interfaces can
2183) also be used to <ulink
2184) url="http://pseudo-flaw.net/tor/torbutton/fingerprint-firefox.html">fingerprint
2185) Firefox down the to the minor version</ulink>. Note that his test has not been
2186) updated since 3.5.3, hence it reports 3.5.3 for more recent Firefoxes. This
2187) bug interferes with Torbutton's ability to satisfy its <link
2188) linkend="setpreservation">Anonymity Set Preservation</link> requirement.
2189)      </para>
2190)     </listitem>
2191) 
2192)    <listitem><ulink
2193) url="https://bugzilla.mozilla.org/show_bug.cgi?id=280661">Bug 280661 - SOCKS proxy server
2194) connection timeout hard-coded</ulink>
2195)     <para>
2196) 
2197) This bug prevents us from using the Firefox SOCKS layer directly, and
2198) currently requires us to ship an auxiliary HTTP proxy called <ulink
2199) url="http://www.pps.jussieu.fr/~jch/software/polipo/">Polipo</ulink>. If this
2200) patch were landed, we would no longer need to ship Polipo, which has a number
2201) of privacy and security issues of its own (in addition to being unmaintained).
2202) 
2203)     </para>
2204)    </listitem>
2205)    <listitem><ulink
2206) url="https://bugzilla.mozilla.org/show_bug.cgi?id=418986">Bug 418986 - window.screen
2207) provides a large amount of identifiable information</ulink>
2208)    <para>
2209) 
2210) As <link linkend="fingerprinting">mentioned above</link>, a large amount of
2211) information is available from <ulink
2212) url="http://developer.mozilla.org/en/docs/DOM:window.screen">window.screen</ulink>.
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2213) The most sensitive data to anonymity is actually that which is not used in
2214) rendering - such as desktop resolution, and window decoration size.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2215) Currently, there is no way to obscure this information without Javascript
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2216) hooking. In addition, many of this same desktop and window decoration
2217) resolution information is available via <ulink
2218) url="https://developer.mozilla.org/En/CSS/Media_queries">CSS Media
2219) Queries</ulink>, so perhaps some more lower-level rendering controls or
2220) preferences need to be provided. These issues interfere with Torbutton's
2221) ability to fulfill its <link linkend="setpreservation">Anonymity Set
2222) Preservation</link> requirement.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2223) 
2224)    </para>
2225)    </listitem>
2226)    <listitem><ulink
2227) url="https://bugzilla.mozilla.org/show_bug.cgi?id=435159">Bug 435159 -
2228) nsNSSCertificateDB::DeleteCertificate has race conditions</ulink>
2229)       <para>
2230) 
2231) In Torbutton 1.2.0rc1, code was added to attempt to isolate SSL certificates
2232) the user has installed. Unfortunately, the method call to delete a certificate
2233) from the current certificate database acts lazily: it only sets a variable
2234) that marks a cert for deletion later, and it is not cleared if that
2235) certificate is re-added. This means that if the Tor state is toggled quickly,
2236) that certificate could remain present until it is re-inserted (causing an
2237) error dialog), and worse, it would still be deleted after that.  The lack of
2238) this functionality is considered a Torbutton security bug because cert
2239) isolation is considered a <link linkend="state">State Separation</link>
2240) feature.
2241) 
2242)       </para>
2243)      </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2244)      <listitem>Give more visibility into and control over TLS
2245) negotiation
2246)      <para>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2247) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2248) There are several <ulink
2249) url="https://trac.torproject.org/projects/tor/ticket/2482">TLS issues
2250) impacting Torbutton security</ulink>. It is not clear if these should be one
2251) Firefox bug or several, but in particular we need better control over various
2252) aspects of TLS connections. Firefox currently provides no observer capable of
2253) extracting TLS parameters or certificates early enough to cancel a TLS
2254) request. We would like to be able to provide <ulink
2255) url="https://www.eff.org/https-everywhere">HTTPS-Everywhere</ulink> users with
2256) the ability to <ulink
2257) url="https://trac.torproject.org/projects/tor/wiki/HTTPSEverywhere/SSLObservatorySubmission">have
2258) their certificates audited</ulink> by a <ulink
2259) url="http://www.networknotary.org/">Perspectives</ulink>-style set of
2260) notaries. The problem with this is that the API observer points do not exist
2261) for any Firefox addon to actually block authentication token submission over a
2262) TLS channel, so every addon to date (including Perspectives) is actually
2263) providing users with notification *after* their authentication tokens have
2264) already been compromised. This obviously needs to be fixed.
2265)      </para>
2266)      </listitem>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2267)      <listitem><ulink
2268) url="https://bugzilla.mozilla.org/show_bug.cgi?id=575230">Bug 575230 - Provide option to
2269) reduce precision of Date()</ulink>
2270)       <para>
2271) 
2272) Currently it is possible to <ulink
2273) url="http://arstechnica.com/tech-policy/news/2010/02/firm-uses-typing-cadence-to-finger-unauthorized-users.ars">fingerprint
2274) users based on their typing cadence</ulink> using the high precision timer
2275) available to javascript. Using this same precision, it is possible to compute
2276) an identifier based upon the clock drift of the client from some nominal
2277) source. The latter is not much of a concern for Tor users, as the variable
2278) delay to load and run a page is measured on the order of seconds, but the high
2279) precision timer can still be used to fingerprint aspects of a browser's
2280) javascript engine and processor, and apparently also a user's typing cadence.
2281) This bug hinders Torbutton's ability to satisfy its <link
2282) linkend="setpreservation">Anonymity Set Preservation</link> requirement.
2283) 
2284)       </para>
2285)      </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2286)     <listitem><ulink
2287) url="https://bugzilla.mozilla.org/show_bug.cgi?id=122752">SOCKS
2288) Username/Password Support</ulink>
2289)     <para>
2290) We need <ulink url="https://developer.mozilla.org/en/nsIProxyInfo">Firefox
2291) APIs</ulink> or about:config settings to control the SOCKS Username and
2292) Password fields. The reason why we need this support is to utilize an (as yet
2293) unimplemented) scheme to separate Tor traffic based <ulink
2294) url="https://gitweb.torproject.org/torspec.git/blob_plain/HEAD:/proposals/171-separate-streams.txt">on
2295) SOCKS username/password</ulink>.
2296)     </para>
2297)     </listitem>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2298) 
2299)      <listitem><ulink
2300) url="https://bugzilla.mozilla.org/show_bug.cgi?id=409737">Bug 409737 -
2301) javascript.enabled and docShell.allowJavascript do not disable all event
2302) handlers</ulink>
2303)      <para>
2304) 
2305) This bug allows pages to execute javascript via addEventListener and perhaps
2306) other callbacks. In order to prevent this bug from enabling an attacker to
2307) break the <link linkend="isolation">Network Isolation</link> requirement,
2308) Torbutton 1.1.13 began blocking popups and history manipulation from different
2309) Tor states.  So long as there are no ways to open popups or redirect the user
2310) to a new page, the <link linkend="contentpolicy">Torbutton content
2311) policy</link> should block Javascript network access. However, if there are
2312) ways to open popups or perform redirects such that Torbutton cannot block
2313) them, pages may still have free reign to break that requirement and reveal a
2314) user's original IP address.
2315) 
2316)      </para>
2317)      </listitem>
2318)      <listitem><ulink
2319) url="https://bugzilla.mozilla.org/show_bug.cgi?id=448743">Bug 448743 -
2320) Decouple general.useragent.locale from spoofing of navigator.language</ulink>
2321)      <para>
2322) 
2323) Currently, Torbutton spoofs the <command>navigator.language</command>
2324) attribute via <link linkend="jshooks">Javascript hooks</link>. Unfortunately,
2325) these do not work on Firefox 3. It would be ideal to have
2326) a pref to set this value (something like a
2327) <command>general.useragent.override.locale</command>),
2328) to avoid fragmenting the anonymity set of users of foreign locales. This issue
2329) impedes Torbutton from fully meeting its <link
2330) linkend="setpreservation">Anonymity Set Preservation</link>
2331) requirement on Firefox 3.
2332) 
2333)      </para>
2334)      </listitem>
2335)     </orderedlist>
2336)   </sect2>
2337)   <sect2 id="FirefoxWishlist">
2338)    <title>Bugs blocking functionality</title>
2339)    <para>
2340) The following bugs impact Torbutton and similar extensions' functionality.
2341)    </para>
2342) 
2343)     <orderedlist>
2344) 
2345) 
2346)    <listitem><ulink
2347) url="https://bugzilla.mozilla.org/show_bug.cgi?id=445696">Bug 445696 -
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2348) Extensions cannot determine if Firefox is full screen</ulink>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2349)    <para>
2350) 
2351) The windowState property of <ulink
2352) url="https://developer.mozilla.org/en/XUL/window">ChromeWindows</ulink> does not accurately reflect the true
2353) state of the window in some cases on Linux. This causes Torbutton to attempt
2354) to resize maximized and minimized windows when it should not.
2355) 
2356)    </para>
2357)    </listitem>
2358)    <listitem><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2359) url="https://bugzilla.mozilla.org/show_bug.cgi?id=629820">nsIContentPolicy::shouldLoad not
2360) called for web request in Firefox Mobile</ulink>
2361)     <para>
2362) 
2363) The new <ulink
2364) url="https://wiki.mozilla.org/Mobile/Fennec/Extensions/Electrolysis">Electrolysis</ulink>
2365) multiprocess system appears to have some pretty rough edge cases with respect
2366) to registering XPCOM category managers such as the nsIContentPolicy, which
2367) make it difficult to do a straight-forward port of Torbutton or
2368) HTTPS-Everywhere to Firefox Mobile.  It probably also has similar issues with
2369) wrapping existing <link linkend="hookedxpcom">Firefox XPCOM components</link>,
2370) which will also cause more problems for porting Torbutton.
2371) 
2372)     </para>
2373)    </listitem>
2374)    <listitem><ulink
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2375) url="https://bugzilla.mozilla.org/show_bug.cgi?id=290456">Bug 290456 -
2376) Block/clear Flash MX "cookies" as well</ulink>
2377)    <para>
2378) 
2379) Today, it is possible to allow plugins if you have a transparent proxy such as
2380) <ulink url="http://anonymityanywhere.com/incognito/">Incognito</ulink> to prevent proxy bypass. However, flash cookies can still be used to
2381) link your Tor and Non-Tor activity, and this reveal your IP to an adversary
2382) that does so. This can be solved by manually removing your flash cookies (like
2383) <ulink
2384) url="https://addons.mozilla.org/en-US/firefox/addon/6623">BetterPrivacy</ulink> does), but
2385) it would be nice if there was a standard way to do this from a Firefox API.
2386) 
2387)    </para>
2388)    </listitem>
2389)    <listitem><ulink
2390) url="https://bugzilla.mozilla.org/show_bug.cgi?id=417869">Bug 417869 -
2391) Browser context is difficult to obtain from many XPCOM callbacks</ulink>
2392)    <para>
2393) 
2394) It is difficult to determine which tabbrowser many XPCOM callbacks originate
2395) from, and in some cases absolutely no context information is provided at all.
2396) While this doesn't have much of an effect on Torbutton, it does make writing
2397) extensions that would like to do per-tab settings and content filters (such as
2398) FoxyProxy) difficult to impossible to implement securely.
2399) 
2400)    </para>
2401)    </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2402) <!--
2403) FIXME: This doesn't really apply anymore.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2404)    <listitem><ulink
2405) url="https://bugzilla.mozilla.org/show_bug.cgi?id=418321">Bug 418321 -
2406) Components do not expose disk interfaces</ulink>
2407)    <para>
2408) 
2409) Several components currently provide no way of reimplementing their disk
2410) access to easily satisfy Torbutton's <link linkend="disk">Disk
2411) Avoidance</link> requirements. Workarounds exist, but they are <link
2412) linkend="sessionstore">clunky</link>, and
2413) some of them involve disabling functionality during Tor usage.
2414) 
2415)    </para>
2416)    </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2417) -->