Skip to content
Open redirect Write-up Beginner

How a JavaScript File Led Me to an Open Redirect Vulnerability

An endpoint that redirects to a user-supplied URL was found in a JavaScript file and only worked after login. An authenticated attacker could send a victim to an external site, such as a fake login page, to phish credentials.

medium.com

Published on medium.com

Bug bounty hunting is like digital treasure hunting. Sometimes you spend hours digging through HTTP headers, fuzzing parameters, or following automated scanners.

Shafayat Ahmed Alif, on medium.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 servlet accepted any external URL in the url parameter without checking it against an allowlist.

Impact

An attacker could phish authenticated users by sending them from the trusted domain to a fake login page, which could lead to credential theft or malware distribution.

What the attacker needed

Victim has an account and is logged in; victim clicks a crafted link

The fix

The redirect should be fixed by allowing only approved domains and warning users before sending them to an external site.

How it was found

  1. Find the redirect endpoint in a JavaScript file during manual review.
  2. Build a redirect URL that points to an external site.
  3. Log in to the target site with valid credentials.
  4. Visit the crafted URL and observe the redirect to the external site.
  5. Show a fake re-authentication page at the external site to demonstrate phishing.

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.

An open redirect is when a website takes a link parameter and sends you to whatever address is in it, even if that address is on another site. Here the redirect only happened after you logged in, so the attacker first needs the victim to have an account and be signed in. The danger is that the link starts on the real, trusted site, which makes a fake login page feel more believable.

What is Open redirect?

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.

Similar reports

View all

Same bug class and techniques, clearest first.

Open redirect

The lesson behind this report.

A trusted site forwards users to any address an attacker picks; rarely paid alone, often the missing link in a chain.