Detect Tor Browser's language
Tor Browser's built-in plaintext error page uses a localised title on a stylesheet link, and a parent page can read that title through an iframe. An attacker could therefore learn the browser's language even when the user has enabled English spoofing.
- Triaged in 4 days
- Fixed in 5 days
- Disclosed after 6 days
#Summary Some error pages uses Tor Browser's language based text, and iframe can steal it.
#Details Since the language of Tor Browser is used for the title of the link tag on 404 error page, an attacker can obtain the language of Tor Browser even if the user has set privacy.spoof_english to 2. I attached a PoC and a video for this.
If the server returns empty response, Tor Browser will show this page in iframe:
<html class="mozwebext">
<head>
<link rel="alternate stylesheet" type="text/css" href="resource://content-accessible/plaintext.css" title="Wrap Long Lines">
</head>
<body>
<pre></pre>
</body>
</html>
but if user uses Japanese (This is example, it can be used in other languages) version of Tor Browser, it'll show this page:
<html class="mozwebext">
<head>
<link rel="alternate stylesheet" type="text/css" href="resource://content-accessible/plaintext.css" title="長い行を折り返す">
</head>
<body>
<pre></pre>
</body>
</html>
so parent window can steal it:
title="長い行を折り返す"
Maybe there are similar vulnerability in other error page.
Impact
Attacker can steal language of Tor Browser even if the user has set privacy.spoof_english to 2.
Attachments
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
Likely the internal plaintext error page uses a localised string as the title of a stylesheet link, and that title is readable by the embedding page across the frame boundary.
Impact
An attacker could learn the user's browser language despite English spoofing being enabled; the report does not show whether other error pages behave the same way.
What the attacker needed
Victim visits attacker page; attacker controls an empty-response URL
How it was found
- Load a page that embeds an iframe pointing at a server that returns an empty response.
- Tor Browser renders its built-in plaintext page inside the iframe.
- Read the title of the stylesheet link from the parent window.
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.
Tor Browser has a setting that is meant to make websites think you speak English, so your real language stays private. When a page loads an empty response inside a frame, the browser shows a built-in page whose link title is translated into your language. The surrounding page can read that title, which reveals your language.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.