DOM-Based XSS in OAuth Login via Unvalidated baseUrl Parameter Le
A DOM-based XSS vulnerability existed on an OAuth login page because the baseUrl parameter was used without validation to load an external JavaScript file. An attacker could craft a link that loads a malicious script from their server, executing arbitrary JavaScript on the authentication domain and potentially stealing credentials or OAuth tokens.
There’s a big difference between finding XSS on a marketing page and finding it on an authentication domain. One gets you a low severity.
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
The application read the baseUrl parameter from the URL and used it directly to set the src of a dynamically created script tag, without any validation, allowlist, or Content Security Policy.
Impact
Because the script runs on the authentication domain, an attacker could intercept credentials and OTPs, manipulate the OAuth flow, hijack sessions, and conduct convincing phishing, potentially leading to full account compromise.
What the attacker needed
Victim clicks a crafted link; attacker hosts a malicious script
The fix
The baseUrl parameter should be validated against a strict allowlist of trusted origins, a Content Security Policy should be enforced to restrict script sources, and the parameter should be removed entirely if not needed.
How it was found
- Set up a malicious server hosting a file at the expected path with a JavaScript payload.
- Craft a URL to the OAuth login page with the baseUrl parameter pointing to the attacker's server.
- Open the crafted URL in a browser.
- The page loads the script from the attacker's server and executes it in the context of the authentication domain.
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.
This is a type of cross-site scripting (XSS) where the malicious code runs because of how the page's own JavaScript handles a URL parameter. The login page took a value from the web address and used it to load a script from any server, so an attacker could make the victim's browser run the attacker's code on the real login site. That could let the attacker steal passwords, one-time codes, or login tokens.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.