Skip to content
XSS Write-up Beginner

Just a DOM-Based XSS

A login page read a URL parameter and passed its value to a redirect function without any filtering. An attacker could supply a javascript: value so that, after a successful login, the browser ran script instead of navigating to a normal page.

Mohamed Sayed Follow

Published on flex0geek.blogspot.com

while searching on my target I found a subdomain with a login form and it depends on a JS code to log in and redirect the user after the a valid login.

Mohamed Sayed (Flex), on flex0geek.blogspot.com

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 redirect function used the raw value of the continue parameter as a navigation target without validating that it was a safe http or https URL.

Impact

An attacker could run script in the context of the login page after a victim logs in, which could steal session data or act as the user; the text shows only an alert proof of concept.

What the attacker needed

Victim logs in via a crafted link; attacker can send the link to the victim

How it was found

  1. Open the login subdomain and inspect the JavaScript that handles login.
  2. Follow the flow from submitCredentials to fetchJwt to redirectOnSuccess.
  3. Note that redirectOnSuccess reads the continue parameter via getUrlParameter into redirectParam.
  4. Observe that a regular expression splits the URL but does not filter the parameter value.
  5. Supply a javascript: value in the continue parameter and log in to see it accepted.

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.

After you log in, the page sends you to whatever address is in a 'continue' part of the link. The site never checked that address, so someone could put a script instruction there instead of a web address. When the login finished, the browser would run that script as if the site itself had written it.

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 Mohamed Sayed

View all

9 more disclosed reports, best first.

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.