Address bar spoofing using firefox://open-url in Firefox iOS
Firefox iOS allows the firefox://open-url scheme to open javascript: URLs, and the address bar displays only the part after '://', enabling an attacker to spoof the address bar and execute JavaScript. An attacker could trick a user into believing they are on a legitimate site while running malicious code.
Originally disclosed on Mozilla
- Fixed in 5 months
- Paid in 5 months
- Disclosed after 5 months
Created attachment 9350291
address-bar-spoofing-using-open-url.gif
Firefox iOS supports a custom URL scheme called "firefox://open-url" for opening specified URL by Firefox from other apps. Normally, Firefox prohibits opening URLs with javascript: scheme, but when using "open-url", it becomes possible to open them. Additionally, if the URL contains "://" immediately after the URL scheme, the address bar of Firefox iOS shows only the rest of the URL.
These two behaviors make spoofing the address bar.
As an example, consider the following URL:
When the following URL is opened in iOS Safari:
firefox://open-url?url=javascript://google.com%2Fsearch?q=foo%26source=%2F%250adocument.body.innerHTML='%253ch1%2520style=color:red%253eHacked!'
the JavaScript code specified through the URL is executed in Firefox, so the text "Hacked!" is displayed on the screen. And then, the address bar shows "google.com/search?q=foo...".
A reproduction URL is below. Open the page in Safari on an iOS device, and tap the link on the page.
https://csrf.jp/2023/fxios-url-spoof.php
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
What the attacker needed
Victim uses Firefox iOS; victim clicks a crafted link
How it was found
- Open the reproduction page in Safari on an iOS device.
- Tap the link on the page that uses the firefox://open-url scheme with a javascript: URL.
- Observe that JavaScript executes and the address bar shows a spoofed URL.
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.
A custom link type in Firefox for iOS can run JavaScript code and make the address bar show a fake website address. This means an attacker can make a harmful link look like it goes to a trusted site, and when clicked, it runs code that changes the page.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.