Skip to content
Info disclosure Disclosed report Beginner

Simple CSS line-height identifies platform

The Tor Browser does not normalise the default CSS line-height, which varies by platform. An attacker can use JavaScript to measure line-height and determine the underlying operating system of a Tor Browser user.

Dr. Neal Krawetz Follow

Originally disclosed on HackerOne

  • Fixed in 21 hours
  • Paid in 21 hours
  • Disclosed after 3 months

There are lots of ways to identify the Tor Browser. (User-Agent string, limited time resolution, no media, etc.) Assume you know it is the Tor Browser. Can you tell what platform?

NOTE: This assumption is well within the scope of the Tor Browser. The Tor Browser does not hide the fact that it is the Tor Browser. Instead, the Tor Browser tries to make all instances of the browser look the same.

CSS line-height: Different browsers on different platforms have different default line heights. (You can tell this if you have two different browsers set to the same height and showing the same long web page. Paging down will scroll at different rates.) The default value of the CSS line-height identifies the browser and platform. Sample default values:

normal: IE, Edge, Chrome, Chromium, Opera, or Konqueror
18px: Safari on MacOSX
19px: Firefox on Linux or Tor Browser on Linux
19.2px: Tor Browser on Windows
19.5167px: Firefox on MacOSX or Tor Browser on MacOSX
20px: Firefox on Windows or Tor Browser on Windows

For profiling: If the TOR-Browser is identified, then the CSS line-height will specify the platform.

To fix: The TOR-Browser should specify the default line-height. Since the user-agent string claims to be Windows, specifying a line-height of '20px' will appear to be Windows.

This profiling issue permits very simple JavaScript to identify the TOR-Browser platform (MacOS, Windows, Linux).

Working demonstration: https://hackerfactor.com/private/torture-test21.html

The original report as published on HackerOne, by hackerfactor. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The Tor Browser does not override the default CSS line-height, which differs across platforms, allowing platform detection.

Impact

This profiling issue permits very simple JavaScript to identify the TOR-Browser platform (MacOS, Windows, Linux).

What the attacker needed

Victim uses Tor Browser; attacker can run JavaScript

How it was found

  1. Identify that the browser is Tor Browser (e.g., via user-agent or other means).
  2. Use JavaScript to measure the default CSS line-height.
  3. Compare the measured value to known platform-specific values to determine the platform.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Web pages can measure small differences in how text is displayed, such as the default line spacing. These differences vary between operating systems. By checking this spacing, a website can guess if you are using Windows, Mac, or Linux, even if you are using the Tor Browser, which is supposed to make everyone look the same.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More by Dr. Neal Krawetz

View all

3 more disclosed reports, best first.

More from Tor

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.