Skip to content
Open redirect Write-up Beginner

1st Bug Bounty Write-Up — Open Redirect Vulnerability on Login Page

The login page's redirect validation used a prefix check on the origin, so a domain like redacted.com.attacker.com passed the whitelist. An attacker could craft a login link that redirected the victim to an attacker-controlled site after successful login.

Phuriphat Boontanon Follow

Published on medium.com

Bounty$250 View original

One of good things in bug hunter community is knowledge sharing. Many great minds of hacking share their findings/discoveries all the time.

Nnez, 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

The validation used a string prefix check (indexOf === 0) on the origin instead of comparing the full hostname, so any domain beginning with the allowed origin was accepted.

Impact

A victim who logs in through a crafted link could be redirected to an attacker-controlled site, which may be used for phishing or token theft.

What the attacker needed

Victim clicks a crafted login link; victim completes login

The fix

The validation should compare the full hostname exactly against the whitelist rather than checking whether the origin string starts with an allowed value; the report notes a fix was deployed.

How it was found

  1. Find the login page and note the next GET parameter that decides the post-login destination.
  2. Try common open redirect payloads, which fail.
  3. Read the front-end source and locate the validation function for the next parameter.
  4. Observe that the whitelist check uses a prefix match on the origin.
  5. Craft a next value whose hostname begins with the allowed origin but belongs to an attacker domain.
  6. Send the crafted login link to a victim; after login they are redirected to the attacker site.

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, a website often sends you to another page using a link parameter. This site checked only that the link started with its own domain name, so a lookalike domain that begins with the real name also passed. That let an attacker send users to their own site after login.

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.

More by Phuriphat Boontanon

View all

1 more disclosed report, best first.

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.