XSS on redirection page( Bypassed)
The redirect page on semrush.com accepted a URL parameter that could be set to a javascript: URI, allowing script execution in the context of the site. An attacker could craft a link that, when clicked, runs arbitrary JavaScript and can also redirect the user to other sites.
- Triaged in 4 days
- Fixed in 28 days
- Paid in 13 days
- Disclosed after 4 months
Hello Semrush Team,
In this report id 311330, I was filled duplicate and redirection url is fixed which made me feel happy as deserving bounty hunter gets a reward.
However, after fixing from last night, I finally bypassed the redirection method which not only Triggered Xss, but also it redirects to somewhere else.
https://www.semrush.com/redirect?url=https://(websitelink)
#To reproduce
So,I tried to craft a XSS like javascript://%0aalert(document.cookie) at the end of redirection Url,so it doesn't work.
Afterwards,I encoded %0a to %250a, then modified the payload and injected at the end of url and it works like a charm.
Here are the XSS payloads https://www.semrush.com/redirect?url=javascript://%250Aalert(document.cookie) https://www.semrush.com/redirect?url=javascript://%250Aalert(document.domain)
When a particular user clicks the button,it's going to triggered an XSS.
Now,Here comes the tricky part regarding Unvalidated redirection-
Now if you inject javascript://%250Aalert(document.location="https://google.com",document.location="https://www.facebook.com") at the end of url like this
https://www.semrush.com/redirect?url=javascript://%250Aalert(document.location="https://google.com",document.location="https://www.facebook.com")
and a particular user click go to site,first page will popup google.com and then it's going to redirect to facebook.com.
Please Consider it and let me know.
With Regards Kunal
(Attaching with Single POC ) F263582
Impact
An attacker can perform dangerous attacks using XSS.
Attachments

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
Impact
An attacker could execute JavaScript in a victim's browser when they click a crafted link, and redirect them to other sites.
What the attacker needed
Victim clicks a crafted link
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.
What is XSS?
Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.