Skip to content
Open redirect Write-up Beginner

How i was able to bypass Open Redirect 3 times on same program.

A signup page accepted a hidden redirect_after parameter that caused the verification link to send users to an attacker-controlled site. The same open redirect was bypassed twice after fixes, first by using the verification link and later by adding the parameter to a GraphQL POST request.

himanshu pdy Follow

Published on hunter-55.medium.com

Bounty$300 View original

So The Story started 6 months ago when i got private invite to hackerone program. Its has very less scope.

himanshu pdy, on hunter-55.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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 4 min read.

Context

The target was a private HackerOne program the author was invited to six months before writing. The scope was described as very small, and the site had already been tested heavily: more than 100 reports had been resolved and more than 65,000 USD in bounties had been awarded. The feature in question is account signup and the email verification link that a new user receives to verify their account.

The author's point is that a simple issue was still findable within about ten minutes on a heavily tested program, and that the same issue paid three times.

Setup

The author had a private invitation to the program and tested the signup flow with a normal account. No special tooling is described beyond intercepting requests, decoding a shortened verification URL, and using https://evil.com as the external destination. The precondition for every attempt is simply the ability to sign up and receive the verification email.

Finding it

While going through the verification link, the author noticed that it contained a redirect_after parameter which was empty by default. The odd part was that the verification request itself did not contain any redirect_after field. That mismatch, a parameter present in the link but absent from the request that produces it, is what made the author keep looking.

Entering redirect_after in the places one would expect produced an error saying the request was malformed.

Exploitation

Step 1: the parameter on the signup URL

The author moved the parameter to the signup URL itself, for example:

Text
https://private-site.com/singup?redirect_after=https://evil.com

The redirect to evil.com succeeded. The report was submitted, and after one month the program patched it and marked it as closed without asking the author to retest.

From the original on hunter-55.medium.com

Step 2: the verification click still redirected

The author repeated the same steps to see whether the fix held. After signup the application no longer sent the user to evil.com; it simply stopped. That looked like filtering introduced by the patch.

However, when the verification link was clicked, it redirected to evil.com again. The attack still worked when the verification link was clicked. The author reported it a second time; the report was triaged, patched again and marked as resolved.

From the original on hunter-55.medium.com

Step 3: the GraphQL signup request

Testing again later, the author found that signup now used a POST request and that it was a GraphQL request. The verification link was now encoded and shortened through a third party. Decoding it revealed the same hidden parameter in the verification link.

This time the parameter was added to the intercepted signup POST request:

HTTP
POST /graphql?redirect_after=https://evil.com

The verification link then redirected the user to evil.com, and the author reported it a third time.

From the original on hunter-55.medium.com

For one low-severity issue the author received three times the reward.

Root cause

The parameter was not part of the visible signup request, and entering it in the expected places produced a malformed-request error.

After the first patch, signup no longer redirected, but the verification link still did. On a later retest the parameter was still present in the verification link, now behind encoding and a third-party shortener, and the GraphQL signup endpoint honoured it when supplied in the URL. The report does not show the server-side code, so the exact validation logic is not known;

Impact

An attacker who can get a victim to start signup through a crafted link, or to click a verification link produced from a crafted signup request, can have the victim redirected to an arbitrary external site after the legitimate flow. The report does not describe any further consequence beyond the redirect itself, and the program treated it as a low-severity issue.

Fix

What the sequence of patches shows is that fixing only the first redirect point is not enough: every place that consumes redirect_after, including the verification link and any GraphQL signup endpoint, has to validate the destination, for example against an allowlist of permitted paths or hosts, and the parameter should not survive into links that are shortened or encoded.

Variants to test

  1. Put the redirect parameter on the signup URL rather than in the request body, and check whether the post-signup redirect follows it.
  2. Complete signup and then click the verification link, checking whether the redirect happens at that later step even when the first redirect is blocked.
  3. Decode any shortened or encoded verification link and look for the same parameter, then test whether it is still honoured.
  4. Intercept the signup request when the application uses GraphQL and add the parameter to the endpoint URL, as in POST /graphql?redirect_after=..., rather than to the GraphQL variables.
  5. Try the parameter in each request of the flow separately (signup, verification) to find which step still consumes it after a partial fix.

A positive result in any of these is a redirect to the external destination you supplied, either immediately after signup or when the verification link is clicked.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 7 min read.

What happened, in plain words

A security researcher was invited to a private bug bounty program on HackerOne, a platform where companies pay people to find problems in their websites. The program had a very small scope, meaning only a few parts of the site were allowed to be tested, and the site had already been tested a lot: more than 100 reports had been resolved and more than 65,000 USD in rewards had been paid out. The feature involved was account signup and the verification email a new user gets to confirm their account.

The researcher found a simple problem in about ten minutes and got three times the reward for the same issue. The problem is called an open redirect: the site takes a web address from the user and sends the user there, without checking whether that address belongs to the site or to someone else.

The setup

The researcher had a private invitation to the program and tested the signup flow with a normal account. No special tools are described beyond intercepting requests (catching the traffic between the browser and the server so you can read and change it), decoding a shortened verification URL, and using https://evil.com as the external destination. The only precondition for every attempt is being able to sign up and receive the verification email.

Finding it

While going through the verification link, the researcher noticed it contained a redirect_after parameter which was empty by default. A parameter is a named value attached to a web address, like a label on a parcel: the part after the ? in a URL. The odd part was that the verification request itself did not contain any redirect_after field. That mismatch, a parameter present in the link but absent from the request that produces it, is what made the researcher keep looking.

Entering redirect_after in the places one would expect produced an error saying the request was malformed.

Exploitation

Step 1: the parameter on the signup URL

The researcher moved the parameter to the signup URL itself, for example:

Text
https://private-site.com/singup?redirect_after=https://evil.com

Line by line: https://private-site.com/singup is the signup page on the real site. The ? starts the list of parameters. redirect_after=https://evil.com says "after signup, send me to evil.com". The site accepted this and the redirect to evil.com succeeded. The report was submitted, and after one month the program patched it and marked it as closed without asking the researcher to retest.

From the original on hunter-55.medium.com

Step 2: the verification click still redirected

The researcher repeated the same steps to see whether the fix held. After signup the application no longer sent the user to evil.com; it simply stopped. That looked like filtering introduced by the patch.

However, when the verification link was clicked, it redirected to evil.com again. The attack still worked when the verification link was clicked. The researcher reported it a second time; the report was triaged (accepted as a real issue), patched again and marked as resolved.

From the original on hunter-55.medium.com

Step 3: the GraphQL signup request

Testing again later, the researcher found that signup now used a POST request and that it was a GraphQL request. A POST request is one way a browser sends data to a server, usually when submitting a form. GraphQL is a way for a website to ask a server for exactly the data it needs, through a single endpoint, rather than many separate addresses. The verification link was now encoded (turned into a form that is hard to read by eye) and shortened through a third party, a service that takes a long link and gives back a short one. Decoding it revealed the same hidden parameter in the verification link.

This time the parameter was added to the intercepted signup POST request:

HTTP
POST /graphql?redirect_after=https://evil.com

Line by line: POST is the method, meaning "send data". /graphql is the address on the server that handles the signup. The ? starts the parameters, and redirect_after=https://evil.com again says "after signup, send me to evil.com". The verification link then redirected the user to evil.com, and the researcher reported it a third time.

From the original on hunter-55.medium.com

For one low-severity issue the researcher received three times the reward.

Why it worked

The parameter was not part of the visible signup request, and entering it in the expected places produced a malformed-request error.

After the first patch, signup no longer redirected, but the verification link still did. On a later retest the parameter was still present in the verification link, now behind encoding and a third-party shortener, and the GraphQL signup endpoint honoured it when supplied in the URL. The report does not show the server-side code, so the exact validation logic is not known;

What an attacker could do with it

An attacker who can get a victim to start signup through a crafted link, or to click a verification link produced from a crafted signup request, can have the victim redirected to an arbitrary external site after the legitimate flow. The report does not describe any further consequence beyond the redirect itself, and the program treated it as a low-severity issue.

How to fix it

What the sequence of patches shows is that fixing only the first redirect point is not enough: every place that consumes redirect_after, including the verification link and any GraphQL signup endpoint, has to validate the destination, for example against an allowlist of permitted paths or hosts, and the parameter should not survive into links that are shortened or encoded.

Things to try on other sites

  1. Put the redirect parameter on the signup URL rather than in the request body, and check whether the post-signup redirect follows it.
  2. Complete signup and then click the verification link, checking whether the redirect happens at that later step even when the first redirect is blocked.
  3. Decode any shortened or encoded verification link and look for the same parameter, then test whether it is still honoured.
  4. Intercept the signup request when the application uses GraphQL and add the parameter to the endpoint URL, as in POST /graphql?redirect_after=..., rather than to the GraphQL variables.
  5. Try the parameter in each request of the flow separately (signup, verification) to find which step still consumes it after a partial fix.

A positive result in any of these is a redirect to the external destination you supplied, either immediately after signup or when the verification link is clicked.

Glossary

  • Bug bounty program: a scheme where a company pays people to find and report security problems in its systems.
  • HackerOne: a platform that hosts bug bounty programs and handles reports between researchers and companies.
  • Scope: the parts of a system a researcher is allowed to test.
  • Open redirect: a flaw where a site takes a web address from the user and sends the user there without checking that the address is safe.
  • Parameter: a named value attached to a web address after a ?, like redirect_after=https://evil.com.
  • Request: a message a browser sends to a server, for example asking for a page or submitting a form.
  • Response: the message a server sends back to the browser.
  • Intercept: to catch a request or response between the browser and the server so you can read or change it.
  • POST request: a request that sends data to the server, usually when submitting a form.
  • GraphQL: a way for a website to ask a server for exactly the data it needs through a single endpoint.
  • Endpoint: a specific address on a server that handles a particular kind of request.
  • URL: the address of a page or resource on the web.
  • Encoding: turning text into a different form, often so it can travel safely through links or systems.
  • URL shortener: a service that takes a long link and gives back a short one that redirects to it.
  • Malformed request: a request the server cannot understand because it is missing something or has something in the wrong place.
  • Triaged: reviewed and accepted as a real issue by the program.
  • Patch: a fix applied to a system.
  • Allowlist: a list of values that are explicitly permitted, such as the only addresses a site may redirect to.
  • Phishing: tricking someone into giving away information or clicking something by pretending to be a trusted site or person.
  • Social engineering: manipulating people into doing something, rather than attacking technology directly.
  • Low severity: a rating meaning the issue has limited impact compared with more serious flaws.

More by himanshu pdy

View all

5 more disclosed reports, 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.