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.
- 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.
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
- A page sets a click handler that opens a new window pointing at a Google URL.
- After a short delay, the script writes its own HTML into the new window.
- 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.