We should check to see if Google Chrome's content scripts are robust enough for us to hook the javascript components we need to hook to mitigate fingerprinting and other Torbutton-related issues. The Chrome people offered to fix shortcomings if we can provide them with test cases sooner rather than later.
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items 0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items 0
Link issues together to show that they're related.
Learn more.
Damn. Just a few minutes into this and it quickly becomes apparent that we cannot use Content Scripts to do what we want. My plan was to use content scripts in Google chrome to implement Torbutton's fingerprinting protection mechanisms, and to also work on a prototype general anti-fingerprinting addon to counter many of these issues and to light a fire under Mozilla to give us the APIs we need: https://wiki.mozilla.org/Fingerprinting
The problem is that it appears pretty clear that at least currently, there is no way for content scripts to do anything other than DOM manipulation, which does not include objects that can be found off of window, such as window.Date, window.plugins, window.navigator, and window.screen - all of which are crucial to wrap to provide fingerprint resistance.
This may mean that it is not possible to use content scripts to provide either Torbutton for Chrome protections, or to provide an anti-fingerprinting addon for Chrome, at least for the short term, or until new APIs are provided.
Alright! Thanks to some more help from my brother, I've got this working. We can't use a script.src url directly, because then Chrome delays the load until it starts loading other page elements. However, we can stuff the thing into a function closure and then use .toString() to shove that into script.innerHTML.
The prototype I have cloaks timezone, resolution, and javascript-available user agent and plugin information. It has a few issues:
It's not clear if the script.innerHTML trick is just allowing us to win a race, or if we are actually assured to run before all page script because we use "run_at": "document_start" in our manifest.
It's not clear if we've covered enough protocols in our permissions section of the manifest, especially if Javascript can register custom protocol handlers like it can in Firefox.
We cannot actually yet actively request that the addon be run in Incognito mode. The user has to manually tick a checkbox before it does anything at all (because it only works in Incognito mode).
It's not clear if we successfully defeat all the anti-js-rootkit stuff that Greg Fleischer did against Torbutton a few years back. All his tests do fail out of the box, though.
There are still other issues that remain with a proper Tor mode, most notably:
A. Incognito specific proxy settings that are DNS-leak safe.
B. Preventing plugins from loading, or otherwise muzzling/sandboxing them
C. Blocking versions of the WebRequest APIs.
D. Preventing external apps from being launched without a proper warning
E. Odd bits of SSL state and other things that may still persist in Incognito mode
To install this prototype in Chrome from this bugtracker, click on the attachment, go to download, and then allow Chrome to install it. Once it is installed, go to your Extensions pane in Chrome and click "Allow this extension to run in incognito".
Eek, it turns out that it is possible to fingerprint that certain addons are installed by sourcing their chrome-extensions urls from page script. If the addon is installed, the page will source. If it is not installed, the page won't source and you can detect this by either catching an exception or registering a listener for onerror.
However, I'm guessing a lot of addons inject tags that source things from their own addons dir into pages they have permissions over.. Bleh. Maybe this is something we can use Web Request to handle.
Ok, I just got back from my meeting with Adam Barth and Pam Greene at Google. Adam is familiar with Firefox js rootkit/closure busting techniques, and he tried out a few common ones but couldn't directly undo our hooks.
However, he was able to bypass them by doing anything that induced chrome to load an about:blank window, because the content scripts do not get applied. This includes:
But also, more subtly:
<button onclick=3D"haxor()">Try to haxor
More directly, encoding anything into a data url and throwing it in the url bar or elsewhere is also not covered by their content script injection:
So we've got to convince chrome to allow us to inject content scripts into about:blank windows and data urls.
The good news is that race conditions do not seem possible with our approach. I put a pretty fat delay loop into the content script before doing the injection, and page script did not load first.
Also, my brother pointed out that the chrome.google.com extension gallery is exempt from content script injection, for abuse concerns. Similar exemptions apply to other about: urls.
This means that we will have to ensure that Web Request will allow us to block all requests to this page, and to special about: urls, so that we can display a confirmation dialog to the user before they are (forcibly) navigated to them to be fingerprinted.
We may be able to wrap every variable we declare inside an additional anonymous lambda to protect against this use of "with", though, so long as chrome doesn't also add a way to walk a javascript scope chain.