Skip to content
Open redirect Disclosed report Beginner

Middle mouse click on an anchor tag pointing to a javascript URI leaves JS URI in the address bar instead of showing about:blank or controlling origin

A middle-click on an anchor with a javascript URI opened a new tab that kept the javascript URI in the address bar, allowing an attacker to spoof any website. The attacker could control the page content while the address bar showed a misleading URI.

Luan Herrera Follow

Originally disclosed on Mozilla

  • Fixed in 2.8 years
  • Paid in 2.6 years
  • Disclosed after 2.8 years
Text
Created attachment 9297709
index.html

If a javascript:// URI is opened from an anchor tag through the use of a middle mouse click it is possible to spoof any webpage as the new tab keeps the javascript URI in the address bar (and the attacker has control over the content of the page).

I believe the expected behavior should be to open a new tab with the address bar displaying the about:blank address (which is what happens when an anchor tag with a random target is clicked).

I have also attached a video reproducing the attack as well as the files required to host the PoC locally.

VERSION
Version: 105.0 (64-bit).
Operating System: Ubuntu 20.04

REPRODUCTION CASE
1. Access https://lbherrera.github.io/lab/firefox/middle-spoof-9933127/index.html
2. Click on the link displayed in the page with the middle mouse button.
3. A new tab will be opened spoofing the "www.mozilla.org" website.

CREDIT INFORMATION
Reporter credit: Luan Herrera (@lbherrera_)

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

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 browser failed to clear or replace the javascript URI in the address bar when opening it in a new tab via middle-click.

Impact

An attacker could spoof any webpage in a new tab, potentially tricking users into trusting the displayed address.

What the attacker needed

Victim uses middle mouse button; victim clicks a javascript URI link

How it was found

  1. Access the provided test page.
  2. Middle-click the link on the page.
  3. A new tab opens showing a spoofed website.

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 javascript URI is a link that runs code instead of going to a normal web page. Normally, when you open such a link in a new tab, the browser should show a blank page with a safe address. Here, the browser kept the javascript URI in the address bar, so the page could pretend to be another site.

What is Open redirect?

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

More by Luan Herrera

View all

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