Skip to content
Open redirect Disclosed report Intermediate CVE-2017-5450

Address bar spoofing on Android

A crafted page could make Firefox on Android show a fake top-level domain in the address bar, so the displayed site identity did not match the real domain. An attacker could use this to make a phishing page look like a trusted site.

Haosheng Wang Follow

Originally disclosed on Mozilla

  • Fixed in 3 months
  • Paid in 3 months
  • Disclosed after 3 months
Text
Created attachment 8822051
Screenshot_20161227-221200.png

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

Steps to reproduce:

User Agent: "Mozilla/5.0 (Android 6.0.1; Mobile; rv:50.1.0) Gecko/50.1.0 Firefox/50.1.0"

POC:

http://192.243.113.21/spoof/firefox/url1.html



Actual results:

The fake top level domain has been highlighted and the site attribute is wrong(see screenshot).


Expected results:

The site attribute should display the correct domain.

The original report as published on Mozilla's Bugzilla, by gnehsoah. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 5 min read.

What the report shows

The target is Firefox for Android, filed under the Mozilla program's Firefox for Android Graveyard asset. The researcher, gnehsoah, reported an address bar spoofing issue and rated it medium severity. The report was disclosed on 23 March 2017. No bounty amount or CVSS score is given.

The researcher supplied a proof of concept page hosted at the following URL:

Text
http://[redacted]/spoof/firefox/url1.html

The steps to reproduce are minimal. The report gives the Firefox for Android User Agent string as:

Text
Mozilla/5.0 (Android 6.0.1; Mobile; rv:50.1.0) Gecko/50.1.0 Firefox/50.1.0

The report also includes a desktop User Agent string:

Text
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

A screenshot was attached to the bug as Screenshot_20161227-221200.png.

The observed result, in the researcher's words, is that the fake top level domain was highlighted and the site attribute was wrong. The expected result is that the site attribute displays the correct domain. In other words, the browser's own security indicator, the part of the address bar that tells the user which site they are on, was showing a domain that did not match the page actually loaded. The report does not describe the HTML or JavaScript behind the proof of concept, so the exact technique used to produce the mismatch is not documented here.

Root cause

The report describes the observed result: the fake top level domain was highlighted and the site attribute was wrong. The browser highlights the registrable domain (the "top level domain" in the researcher's phrasing) so users can spot the real origin at a glance. Here the highlighting landed on the fake top level domain, and the site attribute displayed the wrong domain. The report does not identify the cause. The report does not identify the specific code path.

Impact

A page like the proof of concept can make the browser's site attribute show the wrong domain. That undermines the main signal users rely on to decide whether a page is trustworthy, and it is a natural component of phishing: a victim who checks the address bar, sees an expected domain highlighted, and proceeds to enter credentials or other data. The report frames the issue as a spoofing of the site indicator and does not claim any further consequence such as script execution or data theft.

How this kind of bug works

Address bar spoofing is a UI integrity bug. The browser shows the user an origin, and the security model assumes that origin is accurate. Bugs appear when the displayed value and the real document origin diverge. Common mechanisms include:

  1. Parsing differences between the URL parser used for the indicator and the one used to load the document, so a crafted string resolves to different hosts in each.
  2. Rendering tricks, such as very long URLs, unusual Unicode, right-to-left override characters, or embedded credentials, that push the real host out of view or make a decoy look like the host.
  3. Stale or attacker-influenced state, where the indicator is updated from a value the page can set, or is not refreshed after a navigation.
  4. Full-screen or popup behaviour that hides the real chrome and draws a fake one.

The defence is to derive the displayed origin from the same canonical origin the browser enforces for the document, to render it in a way that cannot be visually confused (truncation that keeps the registrable domain visible, no bidi overrides in the host, clear separation of credentials), and to keep the indicator in sync with every navigation.

How to test for it

Testing is mostly manual and visual, on real devices and real browser builds.

  1. Identify the browser's security indicator and how it renders the host: which part is highlighted, how long URLs are truncated, how it handles userinfo, ports, punycode and Unicode.
  2. Build candidate URLs that stress the parser: embedded credentials, mixed case, trailing dots, percent-encoding in the host, unusual Unicode and bidi characters, very long subdomains, and redirects that change the host mid-flow.
  3. Load each candidate and compare what the address bar shows against the actual document origin, which you can read from the page itself.
  4. Try navigation sequences: load a benign page, then navigate or redirect to the crafted one, and check whether the indicator updates correctly.
  5. Test popups, full-screen and other modes that change how much chrome is visible.

A positive result is a clear, reproducible mismatch: the indicator shows a domain that is not the document's origin, ideally with a screenshot or short video and the exact URL. Common false positives are cases where the real host is still visible elsewhere in the bar, where the mismatch only exists for a fraction of a second during load, or where the page simply draws its own fake bar inside the content area, which is not a browser bug. Confirm the browser's own chrome is the thing being spoofed.

How it is fixed

Fixes usually sit in the front-end code that builds the indicator. The displayed origin should be computed from the canonical, already-validated document origin, never from raw page-supplied strings. Host rendering should strip or neutralise bidi control characters, handle punycode consistently, and truncate in a way that always keeps the registrable domain visible. The indicator must be refreshed on every navigation and on history changes. Where the parser is the problem, aligning the indicator's URL parsing with the loader's parser removes the divergence.

Hunting notes

This class hides in the seams between components: URL parsers, internationalisation handling, and UI rendering. Mobile browsers, in-app browsers and embedded webviews are productive because their chrome is smaller and their rendering paths differ from desktop. Recon signals include recent changes to address bar or origin-display code, bug reports about URL parsing or Unicode handling, and browsers that recently reworked their security indicator. To get a report accepted, show the mismatch unambiguously with the exact URL, the browser version, and a screenshot or video of the real chrome, and explain the user-facing consequence in terms of phishing rather than claiming more than you demonstrated.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 8 min read.

What happened, in plain words

Firefox for Android is the mobile version of the Firefox web browser. Like every browser, it has an address bar, and inside that address bar it shows a security indicator: a small piece of text that tells you which website you are actually on. That indicator exists so you can glance at it and decide whether to trust the page before typing a password or a card number. The researcher, gnehsoah, reported that this indicator could be made to show the wrong domain. The issue was rated medium severity and disclosed on 23 March 2017 under the Mozilla program, on the Firefox for Android Graveyard asset. No bounty amount or CVSS score is given.

To show the problem, the researcher hosted a proof of concept page. A proof of concept (often shortened to PoC) is a small, deliberately built example that demonstrates a bug really exists, rather than just describing it in theory. The page lived at this address:

Text
http://[redacted]/spoof/firefox/url1.html

Reading that URL from left to right: http is the protocol, the rules the browser uses to fetch the page; [redacted] is the address of the server hosting it; /spoof/firefox/url1.html is the path of the file on that server. The word spoof in the path is just the folder name the researcher chose.

The reproduction steps are short. The report gives the Firefox for Android User Agent string as:

Text
Mozilla/5.0 (Android 6.0.1; Mobile; rv:50.1.0) Gecko/50.1.0 Firefox/50.1.0

That string is the User Agent. Every browser sends one with each request, and it is simply a self-description: here it says the browser is Firefox 50.1.0 running on Android 6.0.1 on a mobile device. Websites use it to adapt what they send back. The report also includes a desktop User Agent string:

Text
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36

That is Chrome 55 on 64-bit Linux.

A screenshot was attached to the bug as Screenshot_20161227-221200.png.

The researcher's observed result was that the fake top level domain was highlighted and the site attribute was wrong. The expected result was that the site attribute should display the correct domain. In everyday terms: the browser's own trust label was pointing at a domain that did not belong to the page that was actually loaded. The report does not describe the HTML or JavaScript behind the proof of concept, so the exact trick used to produce the mismatch is not documented.

Why it happens

The report describes the observed result: the fake top level domain was highlighted and the site attribute was wrong. Browsers highlight the registrable domain, the part of a hostname that someone has to register and that identifies the site, so you can spot the real origin at a glance. Think of it like the return address on an envelope: you trust the letter because the address is the one you expect, not because of anything written inside. Here the highlighting landed on the fake top level domain, and the site attribute showed the wrong domain. The report does not identify the cause. The report does not identify the specific code path.

What it means for users

A page like the proof of concept can make the browser's site attribute show the wrong domain. That removes the main signal people use to judge whether a page is trustworthy, and it fits naturally into phishing: a victim checks the address bar, sees the expected domain highlighted, and goes on to enter credentials or other data. The report frames the issue as spoofing of the site indicator and does not claim any further consequence such as script execution or data theft.

In general, how this kind of bug works

Address bar spoofing is a user interface integrity bug. The browser shows you an origin, and the whole security model assumes that origin is accurate. Bugs appear when what is displayed and the real document origin drift apart. Common mechanisms include:

  1. Parsing differences: the URL parser used for the indicator and the one used to load the page disagree, so a crafted string resolves to different hosts in each.
  2. Rendering tricks: very long URLs, unusual Unicode, right-to-left override characters or embedded credentials push the real host out of view or make a decoy look like the host.
  3. Stale or attacker-influenced state: the indicator is updated from a value the page can set, or is not refreshed after a navigation.
  4. Full-screen or popup behaviour that hides the real browser chrome and draws a fake one.

The defence is to derive the displayed origin from the same canonical origin the browser enforces for the document, to render it so it cannot be visually confused (truncation that keeps the registrable domain visible, no bidi overrides in the host, clear separation of credentials), and to keep the indicator in sync with every navigation.

In general, how to test for it

Testing is mostly manual and visual, on real devices and real browser builds.

  1. Identify the browser's security indicator and how it renders the host: which part is highlighted, how long URLs are truncated, how it handles userinfo, ports, punycode and Unicode.
  2. Build candidate URLs that stress the parser: embedded credentials, mixed case, trailing dots, percent-encoding in the host, unusual Unicode and bidi characters, very long subdomains, and redirects that change the host mid-flow.
  3. Load each candidate and compare what the address bar shows against the actual document origin, which you can read from the page itself.
  4. Try navigation sequences: load a benign page, then navigate or redirect to the crafted one, and check whether the indicator updates correctly.
  5. Test popups, full-screen and other modes that change how much chrome is visible.

A positive result is a clear, reproducible mismatch: the indicator shows a domain that is not the document's origin, ideally with a screenshot or short video and the exact URL. Common false positives are cases where the real host is still visible elsewhere in the bar, where the mismatch only exists for a fraction of a second during load, or where the page simply draws its own fake bar inside the content area, which is not a browser bug. Confirm the browser's own chrome is the thing being spoofed.

In general, how it is fixed

Fixes usually sit in the front-end code that builds the indicator. The displayed origin should be computed from the canonical, already-validated document origin, never from raw page-supplied strings. Host rendering should strip or neutralise bidi control characters, handle punycode consistently, and truncate in a way that always keeps the registrable domain visible. The indicator must be refreshed on every navigation and on history changes. Where the parser is the problem, aligning the indicator's URL parsing with the loader's parser removes the divergence.

In general, where to look

This class hides in the seams between components: URL parsers, internationalisation handling and UI rendering. Mobile browsers, in-app browsers and embedded webviews are productive because their chrome is smaller and their rendering paths differ from desktop. Recon signals include recent changes to address bar or origin-display code, bug reports about URL parsing or Unicode handling, and browsers that recently reworked their security indicator. To get a report accepted, show the mismatch unambiguously with the exact URL, the browser version, and a screenshot or video of the real chrome, and explain the user-facing consequence in terms of phishing rather than claiming more than you demonstrated.

Glossary

  • Address bar: the field in a browser where the URL is shown and typed, and where the security indicator appears.
  • Security indicator / site attribute: the browser-drawn label in the address bar that states which site you are on.
  • Origin: the combination of protocol, host and port that identifies where a page came from.
  • Domain / hostname: the human-readable name of a server, such as example.com.
  • Registrable domain: the part of a hostname that someone must register, the part browsers highlight as the site identity.
  • Top level domain: the last label of a domain, such as .com; the researcher used the phrase loosely for the highlighted domain.
  • URL: the address of a resource, made of protocol, host, path and optional parts.
  • Protocol: the rules used to fetch a resource, such as http.
  • Request: the message a browser sends to a server asking for a page or file.
  • User Agent: the string a browser sends describing itself, its version and its platform.
  • Proof of concept (PoC): a small working example that demonstrates a bug.
  • Spoofing: making something appear to be something it is not.
  • Phishing: tricking someone into entering data on a page that imitates a trusted site.
  • UI integrity bug: a flaw where what the interface shows does not match reality.
  • URL parser: the code that breaks a URL into its parts.
  • Canonical origin: the single, normalised origin the browser treats as authoritative for a document.
  • Punycode: the encoding that lets internationalised domain names be written with plain ASCII characters.
  • Bidi / right-to-left override: Unicode control characters that change the visual direction of text and can disguise a hostname.
  • Userinfo / embedded credentials: a username and password placed before the host in a URL, which can be used to mislead.
  • Percent-encoding: writing characters in a URL as % followed by a code.
  • Redirect: a server response that sends the browser to a different URL.
  • Webview: an embedded browser component inside another app.
  • Chrome (browser chrome): the browser's own interface around the page, such as the address bar, as opposed to the page content.
  • CVSS: a standard scoring system for the severity of a vulnerability.
  • Severity: a rating of how serious a bug is, here medium.

More by Haosheng Wang

View all

2 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.