Scrollbar Width permits detecting browser platform
The Tor Browser inherits Firefox's platform-specific scrollbar widths, which JavaScript can measure to identify the underlying operating system. This allows a hostile website to distinguish Tor users on Windows, Mac, or different Linux desktops, enabling tracking and fingerprinting.
Originally disclosed on HackerOne
- Fixed in 39 hours
- Paid in 39 hours
- Disclosed after 3 months
In April 2017 (shortly before this bug bounty program went live), I repeatedly attempted to report this information disclosure vulnerability. However, my emails to the Tor Project's official vulnerability disclosure address went unanswered. It was not until I posted a public blog entry -- with a working exploit -- that someone at the Tor Project opened a bug about this issue. Shortly after that bug, the Tor Project opened this bug bounty system to the public.
The blog entry about the bug: http://www.hackerfactor.com/blog/index.php?/archives/761-Exploiting-the-TOR-Browser.html
The bug that was submitted to the Tor Project by Georg Koppen: https://trac.torproject.org/projects/tor/ticket/22137
I believe the Tor Project opened this bug bounty system to the public BECAUSE of my bug and my identification of no method to report vulnerabilities to the Tor Project. As such, I'm hoping that this bug can be accepted into the now-public bug bounty system.
The bug: The Tor Browser is based on Firefox. Firefox defaults to different scrollbar widths depending on the platform (Windows, Mac, and various Linux desktops). Javascript can easily calculate the scrollbar width, permitting the web page to identify the platform.
Even though the Tor Browser is designed to look the same on all platforms, this bug allows a hostile web site to distinguish "Tor on Windows" from "Tor on Mac" from "Tor on Ubuntu with Unity desktop" from "Tor on Debian with Gnome desktop" etc. Even two people using the same Tor Browser version on two different Linux systems may appear distinct.
For a low-volume web site, this distinction is enough to track users uniquely. For a high-volume web site, it permits tracking users uniquely over a short timeframe -- at least until other people with similar profiles show up.
This one attribute can be combined with other browser attributes in order to develop a unique-enough profile for tracking users over Tor.
Context
The target is the Tor Browser, a browser built on Firefox and designed to present the same fingerprint to every site regardless of the platform it runs on. One of the properties a page can read from JavaScript is the width of the scrollbar. Firefox does not use a single scrollbar width across platforms: the default differs between Windows, Mac and the various Linux desktops. Because the Tor Browser inherits that platform-dependent default, a hostile page can measure the scrollbar width and infer which platform the visitor is on, which undercuts the uniformity the browser is meant to provide.
The report is an information disclosure issue, rated low severity, filed against the Tor program on HackerOne and disclosed on 20 October 2017.
Setup
No accounts, roles or special tooling are described. The precondition is simply a page running JavaScript in the Tor Browser, able to measure the scrollbar width of an element. The report states that the Tor Browser is based on Firefox and that Firefox defaults to different scrollbar widths depending on the platform.
Finding it
The researcher frames the discovery around the reporting history. In April 2017, shortly before the bug bounty program went live, he repeatedly attempted to report the information disclosure through the Tor Project's official vulnerability disclosure address, and his emails went unanswered. Only after he published a public blog entry containing a working exploit did someone at the Tor Project open a bug about the issue. The bug was submitted to the Tor Project by Georg Koppen as ticket 22137. Shortly after that, the Tor Project opened the bug bounty system to the public. The researcher states his belief that the program was opened to the public because of his bug and because he had identified that there was no method to report vulnerabilities to the Tor Project, and he hopes the bug can be accepted into the now-public system.
The technical observation itself is straightforward: the Tor Browser is based on Firefox, and Firefox defaults to different scrollbar widths depending on the platform (Windows, Mac and various Linux desktops). JavaScript can easily calculate the scrollbar width, which lets the page identify the platform.
Exploitation
Step 1: Load a page in the Tor Browser
The attacker controls a web page that the victim visits using the Tor Browser. No special position or privilege is needed beyond getting the page rendered in the browser.
Step 2: Measure the scrollbar width from JavaScript
The page calculates the scrollbar width. The report states that JavaScript can easily calculate the scrollbar width but does not include the measuring code, so the exact technique is not part of the write-up. The result is a width value that follows the platform default inherited from Firefox.
Step 3: Map the width to a platform
Because the default width differs between Windows, Mac and the various Linux desktops, the measured value tells the page which platform the visitor is running. The report gives the resulting distinctions as "Tor on Windows" versus "Tor on Mac" versus "Tor on Ubuntu with Unity desktop" versus "Tor on Debian with Gnome desktop", and so on. Even two people using the same Tor Browser version on two different Linux systems may appear distinct.
Step 4: Combine with other attributes
The single scrollbar-width value is not used in isolation. The report says this one attribute can be combined with other browser attributes in order to develop a unique-enough profile for tracking users over Tor.
Root cause
The Tor Browser is designed to look the same on all platforms, but it inherits Firefox's platform-dependent default scrollbar width. The value is exposed to page JavaScript, so a property that varies by operating system and desktop environment becomes readable by any site the user visits. The uniformity goal is therefore not met for this attribute: the scrollbar width still follows the platform default.
Impact
The impact is tracking and fingerprinting, not code execution or data theft. The report is explicit about the conditions. For a low-volume web site, the platform distinction alone is enough to track users uniquely. For a high-volume web site, it permits tracking users uniquely over a short timeframe, at least until other people with similar profiles show up. Combined with other browser attributes, the scrollbar width helps build a profile unique enough to track users over Tor. The severity assigned to the report is low.
Fix
The report does not describe a fix or a change made in response. What it implies is that the scrollbar width would need to be made uniform across platforms in the Tor Browser, so that the measured value no longer reveals the underlying operating system or desktop environment.
Variants to test
- Other platform-dependent default metrics exposed to JavaScript, such as the dimensions of built-in widgets and form controls. A positive result is a value that differs between platforms while the browser claims a uniform fingerprint.
- The same scrollbar-width measurement in stock Firefox on different platforms, to confirm the underlying defaults the Tor Browser inherits. A positive result is a width that tracks the platform.
- Combining the measured width with other browser attributes to see whether the combination separates users who share a Tor Browser version. A positive result is a profile that stays stable for one user and differs between users.
Hunting notes
This kind of bug hides in the gap between a privacy product's stated uniformity and the platform defaults it inherits from its upstream browser. During recon, the signal is any property a page can read from JavaScript whose value is set by the operating system or desktop environment rather than by the browser's own configuration. The researcher described concrete platform distinctions and the tracking consequences at low and high traffic volumes. The report does not describe any further evidence submitted to the program.
What happened, in plain words
A security researcher found that the Tor Browser, a browser built to make everyone look the same to websites, actually leaks which operating system you are using. The leak is small: it is the width of the scrollbar, the grey bar on the right of a window that you drag to move up and down a page. Different operating systems draw that bar at different widths by default, and a website can measure it with a few lines of JavaScript. That measurement is enough to tell "Tor on Windows" apart from "Tor on Mac" apart from "Tor on Ubuntu with Unity desktop" and so on. For a website with few visitors, that alone can single a person out. For a busy website, it can single a person out for a short while, until other visitors with the same profile turn up. The report is rated low severity and is about information disclosure: the browser gives away a fact about the visitor that it was supposed to hide.
Context
The product here is the Tor Browser. Tor is a network that routes your internet traffic through several relays so that the sites you visit cannot easily see where you are connecting from. The Tor Browser is the matching browser: it is built on top of Firefox, the same browser many people use every day, with extra settings that aim to make every Tor Browser user look identical to websites. That idea is called a uniform fingerprint: the collection of small details a site can read about your browser (screen size, fonts, language, and so on) should be the same for everyone, so that no one stands out.
One of those small details is the scrollbar width. Firefox does not use one single scrollbar width everywhere: its default differs between Windows, Mac and the various Linux desktops. The Tor Browser inherits that default from Firefox, so the width it shows still depends on the operating system underneath. A hostile page can measure the width and work out which platform the visitor is on, which defeats the uniformity the browser is meant to provide.
The report is an information disclosure issue. Information disclosure means the software reveals something it should keep to itself; here, the fact revealed is the visitor's operating system. It was rated low severity, filed against the Tor program on HackerOne (a platform where researchers report bugs to companies and sometimes receive a reward), and disclosed on 20 October 2017.
Setup
No accounts, roles or special tools are described. The only precondition is a page running JavaScript inside the Tor Browser that is able to measure the width of an element's scrollbar. JavaScript is the programming language that web pages run inside your browser; it is what makes pages interactive, and it can also read measurements about how the page is drawn on screen.
The report states that the Tor Browser is based on Firefox, and that Firefox defaults to different scrollbar widths depending on the platform.
Finding it
The researcher frames the discovery around the reporting history. In April 2017, shortly before the bug bounty program went live, he repeatedly tried to report the information disclosure through the Tor Project's official vulnerability disclosure address, and his emails went unanswered. A vulnerability disclosure address is a contact point a project publishes so that people can report security problems privately. Only after he published a public blog entry containing a working exploit did someone at the Tor Project open a bug about the issue. An exploit here simply means a small demonstration that actually triggers the problem.
The bug was submitted to the Tor Project by Georg Koppen as ticket 22137. A ticket is an entry in a project's issue tracker, the system where bugs and tasks are recorded and discussed. Shortly after that, the Tor Project opened the bug bounty system to the public. The researcher states his belief that the program was opened to the public because of his bug and because he had identified that there was no method to report vulnerabilities to the Tor Project, and he hopes the bug can be accepted into the now-public system.
The technical observation itself is straightforward: the Tor Browser is based on Firefox, and Firefox defaults to different scrollbar widths depending on the platform (Windows, Mac and various Linux desktops). JavaScript can easily calculate the scrollbar width, which lets the page identify the platform.
Exploitation
Step 1: Load a page in the Tor Browser
The attacker controls a web page that the victim visits using the Tor Browser. No special position or privilege is needed beyond getting the page rendered in the browser. In other words, anyone who can put a page on the internet, or take over an existing one, can try this against whoever visits it.
Step 2: Measure the scrollbar width from JavaScript
The page calculates the scrollbar width. The report states that JavaScript can easily calculate the scrollbar width but does not include the measuring code, so the exact technique is not part of the write-up. The result is a width value that follows the platform default inherited from Firefox.
Step 3: Map the width to a platform
Because the default width differs between Windows, Mac and the various Linux desktops, the measured value tells the page which platform the visitor is running. The report gives the resulting distinctions as "Tor on Windows" versus "Tor on Mac" versus "Tor on Ubuntu with Unity desktop" versus "Tor on Debian with Gnome desktop", and so on. Even two people using the same Tor Browser version on two different Linux systems may appear distinct.
Step 4: Combine with other attributes
The single scrollbar-width value is not used in isolation. The report says this one attribute can be combined with other browser attributes in order to develop a unique-enough profile for tracking users over Tor. Think of it like describing a person by one feature (tall) versus several (tall, red hair, left-handed): each detail narrows the crowd, and together they can point to one individual.
Root cause
The Tor Browser is designed to look the same on all platforms, but it inherits Firefox's platform-dependent default scrollbar width. The value is exposed to page JavaScript, so a property that varies by operating system and desktop environment becomes readable by any site the user visits. The uniformity goal is therefore not met for this attribute: the scrollbar width still follows the platform default. Normalise here means forcing the value to be the same everywhere, the way a school uniform removes the differences in what pupils wear.
Impact
The impact is tracking and fingerprinting, not code execution or data theft. Fingerprinting is the practice of collecting small details about a browser and device to recognise the same visitor again later. The report is explicit about the conditions. For a low-volume web site, the platform distinction alone is enough to track users uniquely. For a high-volume web site, it permits tracking users uniquely over a short timeframe, at least until other people with similar profiles show up. Combined with other browser attributes, the scrollbar width helps build a profile unique enough to track users over Tor. The severity assigned to the report is low.
Fix
The report does not describe a fix or a change made in response. What it implies is that the scrollbar width would need to be made uniform across platforms in the Tor Browser, so that the measured value no longer reveals the underlying operating system or desktop environment.
Variants to test
- Other platform-dependent default metrics exposed to JavaScript, such as the dimensions of built-in widgets and form controls. A positive result is a value that differs between platforms while the browser claims a uniform fingerprint. Widgets and form controls are the standard buttons, drop-down menus and text boxes the browser draws for you.
- The same scrollbar-width measurement in stock Firefox on different platforms, to confirm the underlying defaults the Tor Browser inherits. Stock Firefox means the ordinary browser as downloaded from Mozilla, without Tor's changes. A positive result is a width that tracks the platform.
- Combining the measured width with other browser attributes to see whether the combination separates users who share a Tor Browser version. A positive result is a profile that stays stable for one user and differs between users.
Hunting notes
This kind of bug hides in the gap between a privacy product's stated uniformity and the platform defaults it inherits from its upstream browser. Upstream here means the original project a product is built on, in this case Firefox. During recon, the signal is any property a page can read from JavaScript whose value is set by the operating system or desktop environment rather than by the browser's own configuration. Recon, short for reconnaissance, is the early stage of looking around a target to see what it exposes. The researcher described concrete platform distinctions and the tracking consequences at low and high traffic volumes. The report does not describe any further evidence submitted to the program.
Glossary
- Tor: A network that routes internet traffic through several relays so that sites cannot easily see where a visitor connects from.
- Tor Browser: A browser built on Firefox with settings that aim to make every user look identical to websites.
- Firefox: The open-source browser by Mozilla that the Tor Browser is built on.
- Fingerprint: The collection of small details a site can read about a browser and device, used to recognise a visitor.
- Fingerprinting: Collecting those details to build a profile and track a visitor across visits.
- Uniform fingerprint: A fingerprint that is the same for every user, so no one stands out.
- Scrollbar: The bar at the side of a window that you drag to move up and down a page.
- Scrollbar width: How wide that bar is drawn, which differs by operating system by default.
- JavaScript: The programming language web pages run inside the browser; it can read measurements about the page.
- Platform: The operating system and desktop environment a computer runs, such as Windows, Mac or a Linux desktop.
- Desktop environment: The graphical layer on a Linux system, such as Unity or Gnome, that draws windows and controls.
- Information disclosure: A weakness where software reveals something it should keep private.
- Severity: A rating of how serious a bug is; this one is low.
- HackerOne: A platform where researchers report bugs to companies and sometimes receive a reward.
- Bug bounty program: A scheme where a company pays or credits people for reporting security bugs.
- Vulnerability disclosure address: A published contact point for reporting security problems privately.
- Exploit: A demonstration that actually triggers a weakness.
- Ticket: An entry in a project's issue tracker recording a bug or task.
- Issue tracker: The system a project uses to record and discuss bugs and tasks.
- Normalise: Force a value to be the same everywhere, removing differences between systems.
- Upstream: The original project a product is built on.
- Stock Firefox: The ordinary Firefox browser without Tor's changes.
- Widget: A standard control the browser draws, such as a button or drop-down menu.
- Form control: An input element on a page, such as a text box or checkbox.
- Recon: The early stage of examining a target to see what it exposes.
- Attribute: A single measurable property of a browser, such as its scrollbar width.
- Profile: A set of attributes that together describe and identify a visitor.
- Tracking: Recognising the same visitor across visits or across sites.
- Code execution: A far more serious class of bug where an attacker can run their own code on a victim's machine; not what happens here.