When CTF Meets Bug Bounty: A Critical UXSS in Opera Browser
A cross-site scripting vulnerability in the GX.games domain allowed execution of JavaScript in a privileged Opera browser context, enabling access to the chrome.tabs API and the opr object. This let an attacker leak URLs of other open tabs and the user's email, and by stealing an OAuth redirect URL containing a code, potentially take over the victim's Opera Sync account and other OAuth-based accounts.
medium.com
Published on medium.com
Renwa
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the redirectUrl parameter accepted javascript: URLs without validation, leading to XSS on a privileged Opera domain that had access to browser APIs.
Impact
The vulnerability could allow an attacker to leak cross-origin URLs and user email, and potentially take over the victim's Opera Sync account and other OAuth-based accounts.
What the attacker needed
Victim visits a crafted link; victim is logged into Opera Sync or other OAuth services
The fix
The vulnerability was patched by Opera on October 13, 2023.
How it was found
- Visit the signup page with a redirectUrl parameter set to a javascript: URL.
- Observe that the javascript: URL executes, confirming XSS.
- Use the opr object to leak the logged-in user's full name and email.
- Use chrome.tabs.query to retrieve URLs of all open tabs.
- Chain with OAuth: open the Opera auth confirm-identity URL with an attacker-controlled state, then steal the redirect URL containing the code via chrome.tabs.
- Use the stolen code to log into the victim's account.
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 write-up has not been written yet. The Original tab links to the source.
A website run by Opera had a flaw that let attackers run their own code in the browser. Because that site had special permissions, the code could read the addresses of other open tabs and the user's email, and even steal a login code to break into accounts.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.