480ad41c9b6f145a66443330ba48bff9342600f4
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 4 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="state"><command>State Separation</command>
336)  <para>Browser state (cookies, cache, history, 'DOM storage'), accumulated in
337)  one Tor state MUST NOT be accessible via the network in
338)  another Tor state.</para></listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

339)  <listitem id="isolation"><command>Network Isolation</command>
340)  <para>Pages MUST NOT perform any network activity in a Tor state different
341)  from the state they were originally loaded in.</para></listitem>
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

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
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

352) Preservation</command><para>The browser SHOULD NOT leak any other anonymity
353) set reducing or fingerprinting information
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

354)  (such as user agent, extension presence, and resolution information)
355) automatically via Tor. The assessment of the attacks above should make it clear
356) that anonymity set reduction is a very powerful method of tracking and
357) eventually identifying anonymous users.
358) </para></listitem>
359)  <listitem id="updates"><command>Update Safety</command><para>The browser
360) SHOULD NOT perform unauthenticated updates or upgrades via Tor.</para></listitem>
361)  <listitem id="interoperate"><command>Interoperability</command><para>Torbutton SHOULD interoperate with third-party proxy switchers that
362)  enable the user to switch between a number of different proxies. It MUST
363)  provide full Tor protection in the event a third-party proxy switcher has
364)  enabled the Tor proxy settings.</para></listitem>
365) </orderedlist>
366)   </sect2>
367)   <sect2 id="layout">
368)    <title>Extension Layout</title>
369) 
370) <para>Firefox extensions consist of two main categories of code: 'Components' and
371) 'Chrome'. Components are a fancy name for classes that implement a given
372) interface or interfaces. In Firefox, components <ulink
373) url="https://developer.mozilla.org/en/XPCOM">can be
374) written</ulink> in C++,
375) Javascript, or a mixture of both. Components have two identifiers: their
376) '<ulink
377) url="http://www.mozilla.org/projects/xpcom/book/cxc/html/quicktour2.html#1005005">Contract
378) ID</ulink>' (a human readable path-like string), and their '<ulink
379) url="http://www.mozilla.org/projects/xpcom/book/cxc/html/quicktour2.html#1005329">Class
380) ID</ulink>' (a GUID hex-string). In addition, the interfaces they implement each have a hex
381) 'Interface ID'. It is possible to 'hook' system components - to reimplement
382) their interface members with your own wrappers - but only if the rest of the
383) browser refers to the component by its Contract ID. If the browser refers to
384) the component by Class ID, it bypasses your hooks in that use case.
385) Technically, it may be possible to hook Class IDs by unregistering the
386) original component, and then re-registering your own, but this relies on
387) obsolete and deprecated interfaces and has proved to be less than
388) stable.</para>
389) 
390) <para>'Chrome' is a combination of XML and Javascript used to describe a window.
391) Extensions are allowed to create 'overlays' that are 'bound' to existing XML
392) window definitions, or they can create their own windows. The DTD for this XML
393) is called <ulink
394) url="http://developer.mozilla.org/en/docs/XUL_Reference">XUL</ulink>.</para>
395)   </sect2>
396) </sect1>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

421)   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

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

Mike Perry authored 13 years ago

437)   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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

458) </para>
459) </sect3>
460) <sect3 id="livemarks">
461) <title><ulink
462) 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>
463) - <ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

464)   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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

491) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

511) 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

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

Mike Perry authored 13 years ago

526) 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

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

Mike Perry authored 13 years ago

545) <sect3 id="crashobserver">
546)  <title><ulink
547) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/crash-observer.js">@torproject.org/crash-observer;1</ulink></title>
548)   <para>
549) 
550) This component detects when Firefox crashes by altering Firefox prefs during
551) runtime and checking for the same values at startup. It <ulink
552) url="https://developer.mozilla.org/en/XPCOM_Interface_Reference/nsIPrefService#savePrefFile()">synchronizes
553) the preference service</ulink> to ensure the altered prefs are written to disk
554) immediately.
555) 
556)   </para>
557) </sect3>
558) <sect3 id="tbsessionstore">
559)  <title><ulink
560) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/tbSessionStore.js">@torproject.org/torbutton-ss-blocker;1</ulink></title>
561)   <para>
562) 
563) This component subscribes to the Firefox <ulink
564) url="https://developer.mozilla.org/en/Observer_Notifications#Session_Store">sessionstore-state-write</ulink>
565) observer event to filter out URLs from tabs loaded during Tor, to prevent them
566) from being written to disk. To do this, it checks the
567) <command>__tb_tor_fetched</command> tag of tab objects before writing them out. If
568) the tag is from a blocked Tor state, the tab is not written to disk.  This is
569) a rather expensive operation that involves potentially very large JSON
570) evaluations and object tree traversals, but it preferable to replacing the
571) Firefox session store with our own implementation, which is what was done in
572) years past.
573) 
574)   </para>
575) </sect3>
576) 
577) <sect3 id="refspoofer">
578)  <title><ulink
579) url="https://gitweb.torproject.org/torbutton.git/blob_plain/HEAD:/src/components/torRefSpoofer.js">@torproject.org/torRefSpoofer;1</ulink></title>
580)  <para>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

581) This component handles optional referer spoofing for Torbutton. It implements a
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

582) form of "smart" referer spoofing using <ulink
583) url="https://developer.mozilla.org/en/Setting_HTTP_request_headers">http-on-modify-request</ulink>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

584) to modify the Referer header. The code sends the default browser referer
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

585) header only if the destination domain is a suffix of the source, or if the
586) source is a suffix of the destination. Otherwise, it sends no referer. This
587) strange suffix logic is used as a heuristic: some rare sites on the web block
588) requests without proper referer headers, and this logic is an attempt to cater
589) to them. Unfortunately, it may not be enough. For example, google.fr will not
590) send a referer to google.com using this logic. Hence, it is off by default.
591)  </para>
592) </sect3>
593) 
594) <!-- FIXME: tor-protocol, tors-protocol need documenting, but
595) they are disabled by default for now, so no reason to add the
596) clutter+confusion. -->
597) 
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

600) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

634) 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

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

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

709) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

712) 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

713) 
714) <para>The browser overlay, torbutton.xul, defines the toolbar button, the status
715) 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

716) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

841) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1020)   <listitem><command>security.enable_ssl2</command> or <ulink
1021) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1035) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1156) 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

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

Mike Perry authored 13 years ago

1158) 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

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

Mike Perry authored 13 years ago

1161) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1197) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1259) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1309) 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

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

1336) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1448) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1589) 
1590) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1603) <para>On Firefox 3.x, these four settings govern the behavior of the <ulink
1604) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1758) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1788) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1799) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1802) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1812) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1858) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

1874) </sect3>
1875)  </sect2>
1876)  <sect2>
1877)   <title>Startup Settings</title>
1878) <sect3>
1879)   <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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1899) 
1900) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

1948) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2031) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2034) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2043) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2045) <para>
2046) This setting also does not directly satisfy any Torbutton requirement, but
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2047) some may desire to mask their referer for general privacy concerns.
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2071) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

2106) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2112) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

2128) 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

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2159) </sect2>
2160) </sect1>
2161) 
2162) <sect1 id="FirefoxBugs">
2163)   <title>Relevant Firefox Bugs</title>
2164)   <para>
2165) 
2166)   </para>
2167)   <sect2 id="FirefoxSecurity">
2168)    <title>Bugs impacting security</title>
2169)    <para>
2170) 
2171) Torbutton has to work around a number of Firefox bugs that impact its
2172) security. Most of these are mentioned elsewhere in this document, but they
2173) have also been gathered here for reference. In order of decreasing severity,
2174) they are:
2175) 
2176)    </para>
2177)    <orderedlist>
2178)     <listitem><ulink
2179) url="https://bugzilla.mozilla.org/show_bug.cgi?id=429070">Bug 429070 - exposing
2180) Components.interfaces to untrusted content leaks information about installed
2181) extensions</ulink>
2182)      <para>
2183) <ulink url="http://pseudo-flaw.net/">Gregory Fleischer</ulink> demonstrated at Defcon 17 that these interfaces can
2184) also be used to <ulink
2185) url="http://pseudo-flaw.net/tor/torbutton/fingerprint-firefox.html">fingerprint
2186) Firefox down the to the minor version</ulink>. Note that his test has not been
2187) updated since 3.5.3, hence it reports 3.5.3 for more recent Firefoxes. This
2188) bug interferes with Torbutton's ability to satisfy its <link
2189) linkend="setpreservation">Anonymity Set Preservation</link> requirement.
2190)      </para>
2191)     </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2192) <!--
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2193)    <listitem><ulink
2194) url="https://bugzilla.mozilla.org/show_bug.cgi?id=280661">Bug 280661 - SOCKS proxy server
2195) connection timeout hard-coded</ulink>
2196)     <para>
2197) 
2198) This bug prevents us from using the Firefox SOCKS layer directly, and
2199) currently requires us to ship an auxiliary HTTP proxy called <ulink
2200) url="http://www.pps.jussieu.fr/~jch/software/polipo/">Polipo</ulink>. If this
2201) patch were landed, we would no longer need to ship Polipo, which has a number
2202) of privacy and security issues of its own (in addition to being unmaintained).
2203) 
2204)     </para>
2205)    </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2207)    <listitem><ulink
2208) url="https://bugzilla.mozilla.org/show_bug.cgi?id=418986">Bug 418986 - window.screen
2209) provides a large amount of identifiable information</ulink>
2210)    <para>
2211) 
2212) As <link linkend="fingerprinting">mentioned above</link>, a large amount of
2213) information is available from <ulink
2214) 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

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2249) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

2288)     <listitem><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2289) url="https://bugzilla.mozilla.org/show_bug.cgi?id=122752">Bug 122752 - SOCKS
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

2339) <!-- XXX: Need to create a bug for DOM storage APIs at some point -->
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2340)   <sect2 id="FirefoxWishlist">
2341)    <title>Bugs blocking functionality</title>
2342)    <para>
2343) The following bugs impact Torbutton and similar extensions' functionality.
2344)    </para>
2345) 
2346)     <orderedlist>
2347) 
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2348) <!--
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2349)    <listitem><ulink
2350) url="https://bugzilla.mozilla.org/show_bug.cgi?id=445696">Bug 445696 -
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2362)    <listitem><ulink
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2363) url="https://bugzilla.mozilla.org/show_bug.cgi?id=629820">Bug 629820 - nsIContentPolicy::shouldLoad not
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2364) called for web request in Firefox Mobile</ulink>
2365)     <para>
2366) 
2367) The new <ulink
2368) url="https://wiki.mozilla.org/Mobile/Fennec/Extensions/Electrolysis">Electrolysis</ulink>
2369) multiprocess system appears to have some pretty rough edge cases with respect
2370) to registering XPCOM category managers such as the nsIContentPolicy, which
2371) make it difficult to do a straight-forward port of Torbutton or
2372) HTTPS-Everywhere to Firefox Mobile.  It probably also has similar issues with
2373) wrapping existing <link linkend="hookedxpcom">Firefox XPCOM components</link>,
2374) which will also cause more problems for porting Torbutton.
2375) 
2376)     </para>
2377)    </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2378) <!--
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2379)    <listitem><ulink
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2380) url="https://bugzilla.mozilla.org/show_bug.cgi?id=290456">Bug 290456 -
2381) Block/clear Flash MX "cookies" as well</ulink>
2382)    <para>
2383) 
2384) Today, it is possible to allow plugins if you have a transparent proxy such as
2385) <ulink url="http://anonymityanywhere.com/incognito/">Incognito</ulink> to prevent proxy bypass. However, flash cookies can still be used to
2386) link your Tor and Non-Tor activity, and this reveal your IP to an adversary
2387) that does so. This can be solved by manually removing your flash cookies (like
2388) <ulink
2389) url="https://addons.mozilla.org/en-US/firefox/addon/6623">BetterPrivacy</ulink> does), but
2390) it would be nice if there was a standard way to do this from a Firefox API.
2391) 
2392)    </para>
2393)    </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2395)    <listitem><ulink
2396) url="https://bugzilla.mozilla.org/show_bug.cgi?id=417869">Bug 417869 -
2397) Browser context is difficult to obtain from many XPCOM callbacks</ulink>
2398)    <para>
2399) 
2400) It is difficult to determine which tabbrowser many XPCOM callbacks originate
2401) from, and in some cases absolutely no context information is provided at all.
2402) While this doesn't have much of an effect on Torbutton, it does make writing
2403) extensions that would like to do per-tab settings and content filters (such as
2404) FoxyProxy) difficult to impossible to implement securely.
2405) 
2406)    </para>
2407)    </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

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

Mike Perry authored 13 years ago

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

Andrew Lewman authored 13 years ago

2424) 
2425) <!--
2426) FIXME: Need to use new observer methods if possible
2427)    <listitem><ulink
2428) url="https://bugzilla.mozilla.org/show_bug.cgi?id=448741">Bug 448741 -
2429) nsISessionStore uses private methods and is not extensible</ulink>
2430)    <para>
2431) 
2432) Similar to the above bug, in the specific case of the sessionstore component,
2433) the API is not amenable to Contract ID hooking, and this requires that
2434) Torbutton include modified copies of this component for Firefox 2 and 3, which
2435) has <ulink
2436) url="https://bugs.torproject.org/flyspray/index.php?do=details&amp;id=722">raised
2437) objections</ulink> from some developers.
2438) 
2439)    </para>
2440)    </listitem>
2441)    <listitem><ulink
2442) url="https://bugzilla.mozilla.org/show_bug.cgi?id=439384">Bug 439384 -
2443) "profile-do-change" event does not cause cookie table reload</ulink>
2444)    <para>
2445) 
2446) In Firefox 3, the change to the new SQLlite database for cookie storage has a
2447) bug that prevents Torbutton's cookie jaring from working properly. The
2448) "profile-do-change" observer event no longer properly causes either a sync or
2449) reload of the cookie database from disk after it is copied into place.
2450) Torbutton currently works around this by issuing the SQLLite queries manually
2451) to store and rebuild the cookie database.
2452) 
2453)    </para>
2454)    </listitem>
2455) 
2456)    <listitem><ulink
2457) url="https://bugzilla.mozilla.org/show_bug.cgi?id=248970">Bug 248970 (PrivateBrowsing) - Private Browsing mode (global toggle for
2458) saving/caching everything)</ulink>
2459)    <para>
2460) 
2461) This bug catalogs the discussion of a 'Private Mode' in Firefox that would
2462) perform many, but not all, of the activities of Torbutton. It would be useful
2463) to leverage the resulting setting to simplify Torbutton. This bug is listed so
2464) we can track this progress and ensure that it doesn't end up defining
2465) behaviors contrary to and incompatible with Torbutton's requirements (though a
2466) subset of the <link linkend="requirements">requirements</link> is of course fine).
2467) 
2468)    </para>
2469)    </listitem>
2470) -->
2471) 
2472) 
2473) 
2474)   </orderedlist>
2475)   </sect2>
2476)   <sect2 id="FirefoxMiscBugs">
2477)    <title>Low Priority Bugs</title>
2478)    <para>
2479) The following bugs have an effect upon Torbutton, but are superseded by more
2480) practical and more easily fixable variant bugs above; or have stable, simple
2481) workarounds.
2482)   </para>
2483) 
2484)     <orderedlist>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2485) <!--
Andrew Lewman add in the torbutton design...

Andrew Lewman authored 13 years ago

2486)     <listitem><ulink
2487) url="https://bugzilla.mozilla.org/show_bug.cgi?id=435151">Bug 435151 - XPCSafeJSObjectWrapper breaks evalInSandbox</ulink>
2488)      <para>
2489) 
2490) Under Firefox 3, the XPCSafeJSObjectWrapper breaks when you try to use
2491) constructors of classes defined from within the scope of the sandbox, among
2492) other things. This prevents Torbutton from applying the Timezone hooks under
2493) Firefox 3, but a better solution for Torbutton's specific date hooking needs 
2494) would be a fix for the above mentioned Bug 392274. Of course, many more
2495) extensions may be interested in the sandbox hooking functionality working
2496) properly though.
2497) 
2498)      </para>
2499)      </listitem>
Mike Perry Update Torbutton design doc.

Mike Perry authored 13 years ago

2500) -->