Skip to content
Open redirect Disclosed report Beginner

Address bar shows userinfo field of URI

The Firefox Focus browser on iOS displayed the userinfo portion of a URI in its address bar instead of stripping it. An attacker could craft a link whose address bar appears to show a trusted host while the actual destination is different, enabling address-bar spoofing.

Muneaki Nishimura Follow

Originally disclosed on Mozilla

  • Fixed in 3 days
  • Paid in 9 days
  • Disclosed after 3 days
Text
Created attachment 8812508
spoofing.png

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/602.1.50 (KHTML, like Gecko) Version/10.0 Safari/602.1.50

Steps to reproduce:

Open PoC of Bug 1224906 (below) and tap the first link in the page.
https://mallory.csrf.jp/ios/spoofing.html
Focus tries to open "https://[address removed]:8020" that the link specifies.


Actual results:

Focus's address bar shows https://[address removed]:8020 directly (see the attached).
Userinfo field of URI is not stripped.


Expected results:

Userinfo field should be stripped on the address bar same as Firefox for iOS.

The original report as published on Mozilla's Bugzilla, by Muneaki Nishimura. 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. 4 min read.

What the report shows

This is a spoofing report against Focus for iOS, filed in Mozilla's bug tracker. The report tests how the browser renders the address bar when a page navigates to a URL that carries a userinfo component.

The reproduction is short. The researcher opened a proof of concept page and tapped the first link on it:

Text
https://mallory.csrf.jp/ios/spoofing.html

That link points Focus at a URL of the form https://[address removed]:8020, and the browser opens it. The page itself is described as a proof of concept carried over from an earlier bug, Bug 1224906.

The observed behaviour is the core of the finding: Focus's address bar displays the full URL, including the userinfo field, exactly as supplied:

Text
https://[address removed]:8020

The userinfo field is not stripped from the address bar. The researcher attached a screenshot named spoofing.png showing the address bar in this state.

The expected behaviour, as stated in the report, is that the userinfo field should be stripped from the address bar, the same way Firefox for iOS handles it.

Root cause

The report does not state a cause; it only records that the userinfo field was not stripped from the address bar. A URL such as https://something:8020 is syntactically valid: everything before the @ is userinfo, and the host follows it. A browser that shows the raw string lets the userinfo portion sit where a reader expects to see the origin, so the visible text can be crafted to look like a different destination. The report says the userinfo field should be stripped, the same as Firefox for iOS.

Impact

The report demonstrates a visual spoof: the address bar shows a URL containing a userinfo field rather than the bare origin. The address bar shows a URL containing a userinfo field rather than the bare origin. The report does not go further than this, and does not describe a concrete phishing scenario or any interaction with page content.

How this kind of bug works

The URL syntax defined by RFC 3986 allows an authority component of the form userinfo@host:port. Browsers rarely need userinfo for ordinary web navigation, but parsers accept it, and many will happily connect to the host after the @. The danger is purely in presentation: if the address bar renders the raw URL, the userinfo text appears first and can be made to resemble a trusted hostname, while the actual host is whatever follows the @. Users read address bars left to right and treat the leading portion as the origin, so the mismatch is easy to exploit socially.

The defence is normalisation at display time: strip or clearly separate the userinfo component, and show the real host prominently. Browsers that do this correctly either drop userinfo entirely from the visible URL or render it in a way that cannot be confused with the host. The same class of problem appears wherever an application echoes a URL back to a user, such as link previews, redirect confirmation pages and mobile in-app browsers.

How to test for it

  1. Identify every place a URL supplied by an attacker is displayed to a user: address bars, link previews, redirect interstitials, share sheets and chat clients that unfurl links.
  2. Craft a URL with a userinfo component whose text mimics a trusted origin, for example a userinfo string that looks like a well-known domain followed by an @ and then a host you control.
  3. Deliver it through the same path a victim would use: a link in a page, a redirect, a message.
  4. Observe what is rendered. A positive result is the userinfo text appearing in the position where users expect the host, with no visual separation from the real destination.
  5. Compare against a reference browser known to handle the case correctly, as the researcher did here with Firefox for iOS.

Common false positives: the URL being truncated with an ellipsis in a way that hides the real host (still worth reporting, but a different issue), the userinfo being shown but clearly demarcated, or the display being a debug view not shown to ordinary users. Confirm the behaviour in the shipping build and on the platform the report targets.

How it is fixed

Strip the userinfo component before rendering a URL in any user-facing surface, or render the host as the primary element with the rest of the URL visually subordinate. Apply the same normalisation consistently across every place URLs are displayed, and add regression tests that feed userinfo-bearing URLs through the display path.

Hunting notes

This class tends to hide in mobile browsers, embedded webviews, link-preview generators and any product that shows a URL to a user for a trust decision. Recon signals include custom URL handling, in-app browsers, redirect warning pages and share or unfurl features. To make a report land, show the exact URL, the rendered result and a side-by-side with a browser that handles it correctly, and explain the trust decision the user is being asked to make. Keep the claim to what you can demonstrate: a misleading display, not a compromise.

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 happened, in plain words

This report is about Focus for iOS. The report shows that Focus could show a misleading web address in its address bar, the strip at the top of the browser where the current site's address appears. That strip is what people glance at to decide whether a site is trustworthy, so what it shows matters.

To understand the problem you need one piece of web address anatomy. A web address (a URL) can contain an optional part called the userinfo field, which sits before an @ sign and before the real host name. A simplified example of the shape is userinfo@host. The userinfo part is almost never needed for ordinary browsing, but the rules for web addresses allow it, and browsers will still connect to the host that comes after the @.

The danger is not in the connection, it is in the display. If a browser shows the whole address exactly as typed, the userinfo text appears first, on the left, which is exactly where people expect to see the site they are visiting. Someone could craft that text to look like a trusted site while the real destination is whatever follows the @.

The reproduction

The researcher opened a proof of concept page and tapped the first link on it:

Text
https://mallory.csrf.jp/ios/spoofing.html

A proof of concept (PoC) is a small, deliberately built demonstration that shows a bug is real. The page is described as carried over from an earlier bug, Bug 1224906. Tapping the link made Focus try to open a URL of the form https://[address removed]:8020, which the link specified. The address has been removed from the public report.

What Focus showed

Instead of cleaning the address up, Focus's address bar displayed the full URL, userinfo field included, exactly as supplied:

Text
https://[address removed]:8020

The userinfo field was not stripped from the address bar. The researcher attached a screenshot named spoofing.png showing the address bar in this state.

What should have happened

The report states the expected behaviour plainly: the userinfo field should be stripped from the address bar, the same way Firefox for iOS handles it. Firefox for iOS is used in the report as the reference for correct behaviour: it strips the userinfo field before display.

In general, how this kind of bug works

The rules that define web address syntax, RFC 3986, allow an authority component of the form userinfo@host:port. Browsers rarely need userinfo for ordinary navigation, but parsers accept it, and many will connect to the host after the @ without complaint. The problem here is purely one of presentation: if the address bar renders the raw address, the userinfo text appears first and can be made to resemble a trusted host name, while the actual host is whatever follows the @. People read address bars left to right and treat the leading portion as the origin, so the mismatch is easy to exploit socially.

The defence is normalisation at display time: strip or clearly separate the userinfo component, and show the real host prominently. Browsers that do this correctly either drop userinfo entirely from the visible address or render it in a way that cannot be confused with the host. The same class of problem appears wherever an application echoes an address back to a user, such as link previews, redirect confirmation pages and mobile in-app browsers.

How to test for it

  1. Identify every place an address supplied by an attacker is displayed to a user: address bars, link previews, redirect interstitials, share sheets and chat clients that unfurl links.
  2. Craft an address with a userinfo component whose text mimics a trusted origin, for example a userinfo string that looks like a well-known domain followed by an @ and then a host you control.
  3. Deliver it through the same path a victim would use: a link in a page, a redirect, a message.
  4. Observe what is rendered. A positive result is the userinfo text appearing in the position where users expect the host, with no visual separation from the real destination.
  5. Compare against a reference browser known to handle the case correctly, as the researcher did here with Firefox for iOS.

Common false positives: the address being truncated with an ellipsis in a way that hides the real host (still worth reporting, but a different issue), the userinfo being shown but clearly demarcated, or the display being a debug view not shown to ordinary users. Confirm the behaviour in the shipping build and on the platform the report targets.

How it is fixed

Strip the userinfo component before rendering an address in any user-facing surface, or render the host as the primary element with the rest of the address visually subordinate. Apply the same normalisation consistently across every place addresses are displayed, and add regression tests that feed userinfo-bearing addresses through the display path.

Hunting notes

This class tends to hide in mobile browsers, embedded webviews, link-preview generators and any product that shows an address to a user for a trust decision. Recon signals include custom URL handling, in-app browsers, redirect warning pages and share or unfurl features. To make a report land, show the exact address, the rendered result and a side-by-side with a browser that handles it correctly, and explain the trust decision the user is being asked to make. Keep the claim to what you can demonstrate: a misleading display, not a compromise.

Glossary

  • Address bar: the field at the top of a browser that shows the address of the current page.
  • Browser: the program you use to open websites.
  • Bug 1224906: an earlier bug whose proof of concept page was opened for this test.
  • CVSS: a standard scoring system for rating the severity of security issues.
  • Focus: Mozilla's privacy-focused browser for iPhone and iPad.
  • Firefox for iOS: Mozilla's other browser for iPhone and iPad, used here as the reference for correct behaviour.
  • Host: the part of a web address that names the server you are connecting to.
  • Normalisation: rewriting a value into a standard, cleaned-up form before showing or using it.
  • Origin: the combination of scheme, host and port that identifies where a page came from.
  • Port: a number that identifies a specific service on a server, such as 8020 in the address above.
  • Proof of concept (PoC): a small demonstration that proves a bug is real.
  • RFC 3986: the document that defines the syntax of web addresses.
  • Spoofing: making something appear to be something else, here making a displayed address look like a different destination.
  • Stripping: removing a part of a value before displaying it.
  • URL: a web address, such as https://example.com/page.
  • Userinfo field: the optional part of a web address before the @ sign, which can hold a user name and password.
  • Webview: a browser engine embedded inside another app to show web content.

More by Muneaki Nishimura

View all

74 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.