132-browser-check-tor-service.txt 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. Filename: 132-browser-check-tor-service.txt
  2. Title: A Tor Web Service For Verifying Correct Browser Configuration
  3. Author: Robert Hogan
  4. Created: 2008-03-08
  5. Status: Draft
  6. Overview:
  7. Tor should operate a primitive web service on the loopback network device
  8. that tests the operation of user's browser, privacy proxy and Tor client.
  9. The tests are performed by serving unique, randomly generated elements in
  10. image URLs embedded in static HTML. The images are only displayed if the DNS
  11. and HTTP requests for them are routed through Tor, otherwise the 'alt' text
  12. may be displayed. The proposal assumes that 'alt' text is not displayed on
  13. all browsers so suggests that text and links should accompany each image
  14. advising the user on next steps in case the test fails.
  15. The service is primarily for the use of controllers, since presumably users
  16. aren't going to want to edit text files and then type something exotic like
  17. 127.0.0.1:9999 into their address bar. In the main use case the controller
  18. will have configured the actual port for the webservice so will know where
  19. to direct the request. It would also be the responsibility of the controller
  20. to ensure the webservice is available, and tor is running, before allowing
  21. the user to access the page through their browser.
  22. Motivation:
  23. This is a complementary approach to proposal 131. It overcomes some of the
  24. limitations of the approach described in proposal 131: reliance
  25. on a permanent, real IP address and compatibility with older versions of
  26. Tor. Unlike 131, it is not as useful to Tor users who are not running a
  27. controller.
  28. Objective:
  29. Provide a reliable means of helping users to determine if their Tor
  30. installation, privacy proxy and browser are properly configured for
  31. anonymous browsing.
  32. Proposal:
  33. When configured to do so, Tor should run a basic web service available
  34. on a configured port on 127.0.0.1. The purpose of this web service is to
  35. serve a number of basic test images that will allow the user to determine
  36. if their browser is properly configured and that Tor is working normally.
  37. The service can consist of a single web page with two columns. The left
  38. column contains images, the right column contains advice on what the
  39. display/non-display of the column means.
  40. The rest of this proposal assumes that the service is running on port
  41. 9999. The port should be configurable, and configuring the port enables the
  42. service. The service must run on 127.0.0.1.
  43. In all the examples below [uniquesessionid] refers to a random, base64
  44. encoded string that is unique to the URL it is contained in. Tor only ever
  45. stores the most recently generated [uniquesessionid] for each URL, storing 3
  46. in total. Tor should generate a [uniquesessionid] for each of the test URLs
  47. below every time a HTTP GET is received at 127.0.0.1:9999 for index.htm.
  48. The most suitable image for each test case is an implementation decision.
  49. Tor will need to store and serve images for the first and second test
  50. images, and possibly the third (see 'Open Issues').
  51. 1. DNS Request Test Image
  52. This is a HTML element embedded in the page served by Tor at
  53. http://127.0.0.1:9999:
  54. <IMG src="http://[uniquesessionid]:9999/torlogo.jpg" alt="If you can see
  55. this text, your browser's DNS requests are not being routed through Tor."
  56. width="200" height="200" align="middle" border="2">
  57. If the browser's DNS request for [uniquesessionid] is routed through Tor,
  58. Tor will intercept the request and return 127.0.0.1 as the resolved IP
  59. address. This will shortly be followed by a HTTP request from the browser
  60. for http://127.0.0.1:9999/torlogo.jpg. This request should be served with
  61. the appropriate image.
  62. If the browser's DNS request for [uniquesessionid] is not routed through Tor
  63. the browser may display the 'alt' text specified in the html element. The
  64. HTML served by Tor should also contain text accompanying the image to advise
  65. users what it means if they do not see an image. It should also provide a
  66. link to click that provides information on how to remedy the problem. This
  67. behaviour also applies to the images described in 2. and 3. below, so should
  68. be assumed there as well.
  69. 2. Proxy Configuration Test Image
  70. This is a HTML element embedded in the page served by Tor at
  71. http://127.0.0.1:9999:
  72. <IMG src="http://torproject.org/[uniquesessionid].jpg" alt="If you can see
  73. this text, your browser is not configured to work with Tor." width="200"
  74. height="200" align="middle" border="2">
  75. If the HTTP request for the resource [uniquesessionid].jpg is received by
  76. Tor it will serve the appropriate image in response. It should serve this
  77. image itself, without attempting to retrieve anything from the Internet.
  78. If Tor can identify the name of the proxy application requesting the
  79. resource then it could store and serve an image identifying the proxy to the
  80. user.
  81. 3. Tor Connectivity Test Image
  82. This is a HTML element embedded in the page served by Tor at
  83. http://127.0.0.1:9999:
  84. <IMG src="http://torproject.org/[uniquesessionid]-torlogo.jpg" alt="If you
  85. can see this text, your Tor installation cannot connect to the Internet."
  86. width="200" height="200" align="middle" border="2">
  87. The referenced image should actually exist on the Tor project website. If
  88. Tor receives the request for the above resource it should remove the random
  89. base64 encoded digest from the request (i.e. [uniquesessionid]-) and attempt
  90. to retrieve the real image.
  91. Even on a fully operational Tor client this test may not always succeed. The
  92. user should be advised that one or more attempts to retrieve this image may
  93. be necessary to confirm a genuine problem.
  94. Open Issues:
  95. The final connectivity test relies on an externally maintained resource, if
  96. this resource becomes unavailable the connectivity test will always fail.
  97. Either the text accompanying the test should advise of this possibility or
  98. Tor clients should be advised of the location of the test resource in the
  99. main network directory listings.
  100. Any number of misconfigurations may make the web service unreachable, it is
  101. the responsibility of the user's controller to recognize these and assist
  102. the user in eliminating them. Tor can mitigate against the specific
  103. misconfiguration of routing HTTP traffic to 127.0.0.1 to Tor itself by
  104. serving such requests through the SOCKS port as well as the configured web
  105. service report.
  106. Now Tor is inspecting the URLs requested on its SOCKS port and 'dropping'
  107. them. It already inspects for raw IP addresses (to warn of DNS leaks) but
  108. maybe the behaviour proposed here is qualitatively different. Maybe this is
  109. an unwelcome precedent that can be used to beat the project over the head in
  110. future. Or maybe it's not such a bad thing, Tor is merely attempting to make
  111. normally invalid resource requests valid for a given purpose.