Skip to content
Account takeover Write-up Intermediate

How a Single Parameter Led to Two ATO Cases

The password reset and OpenID authentication flows accepted a user-controlled callback URL, so an attacker could redirect the reset token or authentication response to their own domain. A victim who clicked the crafted link could have their account taken over.

Fahad Faisal Follow

Published on cametom006.medium.com

Hey guys, Today, I’m excited to share an intriguing story about how asingle parameter in an application led to two account takeover cases and earned me a four-digit bounty. The program is a private one on HackerOne, and I was among the first few hackers to get invited.

Fahad Faisal, on cametom006.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. 6 min read.

Context

The target was a private program on HackerOne, and the researcher was among the first few hackers invited to it. The write-up covers two account takeover (ATO) cases found in the same application, both of which are one-click exploits: the victim only needed to perform a single interaction for the attack to succeed. The common thread between the two bugs is a single parameter, CallbackUrl (also written callbackUrl), which the application accepted from the client in two different flows.

The first flow is the password reset functionality. Normally, a user submits their email address, the server generates a reset token and emails a link containing that token back to the user, and the user clicks the link to set a new password. The second flow is the application's OAuth/OpenID authentication, where the application delegates login to identity providers such as Google and receives the authentication response on a callback URL.

From the original on cametom006.medium.com

Setup

No special accounts, roles, tools or versions are described. The testing was done against the application's password reset endpoint and its OpenID endpoint, using ordinary HTTP requests. The precondition for either attack is that a victim interacts once: clicking the reset link in the first case, and initiating the provider login in the second.

Finding it

While testing the password reset functionality, the researcher noticed an interesting parameter called CallbackUrl in the password reset request. The request looked like this:

HTTP
POST /auth/resetpassword HTTP/2Host: api.example.comUser-Agent: Mozilla/5.0Accept: application/jsonContent-Type: application/jsonOrigin: https://app.example.comReferer: https://app.example.com{"Email":"[redacted]","CallbackUrl":"https://evil.com/auth/reset-password"}

The request is a JSON POST to the reset endpoint on the API host, sent from the application origin, and it carries two fields: the victim's Email and a CallbackUrl pointing at an attacker-controlled domain. The presence of a client-supplied callback in a password reset request is what looked wrong: the destination of the reset link should be fixed by the application, not chosen by whoever submits the form.

Exploitation

Step 1: Redirect the password reset link

The researcher changed the CallbackUrl parameter to a domain they controlled. When a user requests a password reset link, the server sends an email with a password reset link that contains a token. With the modified parameter, the link in that email is built on the attacker's domain instead, of the form `attacker.domain.com/auth/reset-password?[redacted]

From the original on cametom006.medium.com

Step 2: Capture the token and take over the account

When the victim clicks the link in the email, the request (and therefore the token in the query string) goes to the attacker's domain. The attacker obtains the password reset token and uses it to take over the user's account. This is the one-click condition: the victim has to click the emailed link, and nothing else.

The researcher reported the issue, and the team marked the report as high severity and rewarded a four-digit bounty.

From the original on cametom006.medium.com

Step 3: Look for the same parameter elsewhere

The first finding prompted the researcher to dig deeper into the platform. Searching the application JavaScript for corresponding parameters revealed that the same parameter is used in the application's OAuth flow.

Step 4: Abuse the OpenID callback

Testing the OAuth mechanism produced a second flaw that could potentially lead to one-click account takeover. It stems from a misconfiguration in the OpenID implementation, specifically in the callbackUrl parameter used in the authentication flow with various identity providers. By manipulating callbackUrl and redirecting it to an attacker-controlled domain, an attacker could intercept the authentication process and potentially gain unauthorised access to user accounts.

The example given is Google as the identity provider:

Text
https://api.example.net/openid/google?callbackUrl=https://attacker.com/auth/register

Initiating the authentication process with the respective provider results in the authentication response being redirected to the attacker's domain. Exploiting the vulnerability allows attackers to intercept authentication responses, potentially obtaining access tokens, because the response is redirected to the attacker-controlled domain specified in the modified callbackUrl parameter.

Step 5: Get the second bug accepted

After the report, the team responded that they considered the reported vulnerability part of the previous callbackUrl fix. They emphasised that their policy allows only one bounty payment per bug and considered duplicates unacceptable. The researcher reiterated the findings, stressing that the vulnerability persisted specifically in the callbackUrl of the Auth0 endpoint, acknowledged the team's efforts in resolving the previous bug, and urged them to treat this as a separate issue because of its potential risk of account takeover.

From the original on cametom006.medium.com

Following internal discussions, the team recognised the severity of the vulnerability and awarded another four-digit bounty along with an exclusive swag pack.

From the original on cametom006.medium.com

Root cause

The application took the destination of a security-sensitive redirect from the request itself. In the password reset flow, the CallbackUrl field of the JSON body decided where the emailed reset link pointed, so the token was delivered to whatever host the requester named. In the OpenID flow, the callbackUrl query parameter decided where the authentication response was sent, so the response carrying the authentication result (and, per the report, potentially access tokens) went to the attacker's domain.

In both cases the server trusted a client-supplied value for a redirect target without restricting it to the application's own origins. The report does not describe any validation, allowlist or token binding that was present and bypassed. The team's first reaction was to treat the OpenID issue as covered by the earlier fix.

Impact

Both issues are one-click account takeovers. In the password reset case, an attacker who submits a reset request for a victim's email with an attacker-controlled CallbackUrl receives the reset token as soon as the victim clicks the emailed link, and can then take over the account. In the OpenID case, an attacker who gets a victim to start the provider login through a crafted link has the authentication response redirected to the attacker's domain, allowing interception of the authentication process and potentially access tokens. The report hedges the second case with "potentially", and the impact depends on the victim completing the login flow with the respective provider.

Fix

The report does not describe the specific code change made. What it does show is the sequence: the first callbackUrl issue was marked high severity and rewarded, and the second report was initially treated as part of that fix until the team, after internal discussions, accepted the Auth0 endpoint's callbackUrl as a separate issue. The appropriate fix, in both flows, is to stop taking the redirect destination from the request: build the reset link and the OpenID callback from a fixed, server-side value, or validate the supplied value strictly against an allowlist of the application's own origins before using it.

Variants to test

  1. Password reset requests: look for any field that influences the link in the email (CallbackUrl, returnUrl, redirect, domain, host). A positive result is an email whose link points at a host you control, with the token in the query string.
  2. OAuth/OpenID start endpoints: append or modify a callbackUrl/redirect_uri parameter to point at your domain. A positive result is the provider's authentication response arriving at your host, ideally with a code or token.
  3. JavaScript review: search the application's bundles for callback and redirect parameter names, as the researcher did, to find flows that reuse the same parameter outside the one you already found. A positive result is a second endpoint that honours the parameter.
  4. Remediation scope: after a callback parameter is fixed in one flow, retest the same parameter name in every other flow (password reset, social login, email verification, invitation links). A positive result is any flow where the old behaviour still works, which is exactly the situation the second report describes.

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. 12 min read.

What happened, in plain words

A security researcher was invited to a private bug bounty program on HackerOne. A bug bounty program is a scheme where a company pays people to find security problems in its systems and report them privately, instead of the problems being sold or used for harm. This one was private, meaning only invited researchers could take part, and the researcher was among the first few hackers invited.

While testing the application, the researcher found two separate ways to take over someone else's account. Account takeover, usually shortened to ATO, means exactly what it sounds like: an attacker ends up in control of a victim's account, able to read their data and act as them. Both of the attacks here are "one-click" exploits. That means the victim does not have to type a password into a fake page or install anything; they only have to do one ordinary thing, such as clicking a link in an email.

The thread connecting the two bugs is a single parameter. A parameter is a named piece of information that a browser or an app sends to a server, like a label on a form field. This particular parameter was called CallbackUrl (sometimes written callbackUrl), and it tells the server "send the user back to this address when you are done". The application used that address in two different places, and that is what made both attacks possible.

From the original on cametom006.medium.com

The two features involved

Before the details, it helps to know what the two features do, because both are things you have probably used yourself.

Password reset. You have forgotten your password, so you click "forgot password", type your email address, and the site emails you a link. That link contains a long random string called a token. A token is like a temporary key: whoever holds it can prove they are allowed to do the thing it was issued for, here setting a new password. You click the link, the site checks the token, and you choose a new password. The important part is that the token must only ever reach the real account owner, because anyone who has it can reset the password.

OAuth and OpenID. These are the standards behind "Log in with Google" style buttons. Instead of the application checking your password itself, it sends you to an identity provider (Google, for example), you log in there, and the provider sends you back to the application with proof of who you are. The address the provider sends you back to is the callback URL. If an attacker can choose that address, the proof of identity, and possibly access tokens, can be delivered to the attacker instead of the application.

An API is the part of a service that other software talks to, as opposed to the web pages a person looks at. When your browser uses a website, it is often quietly sending requests to an API behind the scenes, and those requests are what the researcher was inspecting and changing.

Finding the first bug: the password reset parameter

The researcher was testing the password reset feature and noticed something interesting in the request the application sends when you ask for a reset. The request contained a parameter called CallbackUrl. Here is the request as it appears in the report:

HTTP
POST /auth/resetpassword HTTP/2Host: api.example.comUser-Agent: Mozilla/5.0Accept: application/jsonContent-Type: application/jsonOrigin: https://app.example.comReferer: https://app.example.com{"Email":"[redacted]","CallbackUrl":"https://evil.com/auth/reset-password"}

Line by line, in plain words:

  • POST /auth/resetpassword HTTP/2Host: api.example.com is the start of the request: it is asking the server at api.example.com to run the password reset action. POST is the method used when you are sending data to the server rather than just asking for a page. (In the report the request is printed without line breaks between the headers, so the host appears glued to the path; in a real request each header sits on its own line.)
  • User-Agent: Mozilla/5.0 identifies the browser or tool making the request.
  • Accept: application/json says the sender expects the answer in JSON, a common text format for data.
  • Content-Type: application/json says the body of the request is in that same JSON format.
  • Origin: https://app.example.com and Referer: https://app.example.com tell the server which site the request came from. Browsers add these automatically.
  • The last part is the body: {"Email":"[redacted]","CallbackUrl":"https://evil.com/auth/reset-password"}. It contains two fields. Email is the address of the account being reset. CallbackUrl is an address the requester wants the reset link to point at, and here it points at evil.com, a domain the attacker controls.

Why did this look wrong? Because the destination of a password reset link should be decided by the application, not by whoever fills in the form. The person asking for a reset should be able to say which email to reset, but not where the resulting link sends the victim. The presence of a client-supplied callback in this request was the clue.

Exploiting it: redirect the link, then steal the token

Step 1: Point the reset link at the attacker

The researcher changed CallbackUrl to a domain they controlled. Normally, when a user requests a password reset link, the server emails a link containing a token. With the modified parameter, the link in that email is built on the attacker's domain instead, in the form `attacker.domain.com/auth/reset-password?[redacted]

From the original on cametom006.medium.com

Step 2: Capture the token and take over the account

When the victim clicks the link in the email, their browser goes to the attacker's domain, and the token travels along in the address. The attacker now has the password reset token and can use it to take over the user's account. This is why it is called one-click: the victim only has to click the emailed link, and nothing else.

The researcher reported the issue. The team marked the report as high severity and paid a four-digit bounty.

From the original on cametom006.medium.com

Finding the second bug: the same parameter in the login flow

The first finding made the researcher curious to dig deeper into the platform. They searched the application's JavaScript, the code that runs in your browser and makes the site interactive, for the same parameter name. That search showed that the same parameter is also used in the application's OAuth flow, the "log in with a provider" mechanism described earlier. This is a common and sensible move after finding a bug: if one feature mishandles a value, other features that use the same value may mishandle it too.

Exploiting it: redirect the login response

Testing the OAuth mechanism produced a second flaw that could potentially lead to one-click account takeover. It comes from a misconfiguration in the OpenID implementation, specifically in the callbackUrl parameter used in the authentication flow with various identity providers. By manipulating callbackUrl and redirecting it to an attacker-controlled domain, an attacker could intercept the authentication process and potentially gain unauthorised access to user accounts.

The example given in the report uses Google as the identity provider:

Text
https://api.example.net/openid/google?callbackUrl=https://attacker.com/auth/register

Reading this address in plain words:

  • https://api.example.net/openid/google is the application's endpoint for starting a login with Google. An endpoint is simply a specific address on a server that performs a particular action.
  • ? marks the start of the parameters, the extra information sent along with the address.
  • callbackUrl=https://attacker.com/auth/register tells the server where to send the user once Google has finished logging them in. Here it points at attacker.com, a domain the attacker controls.

Initiating the authentication process with the respective provider results in the authentication response being redirected to the attacker's domain. Exploiting the vulnerability allows attackers to intercept authentication responses, potentially obtaining access tokens, because the response is redirected to the attacker-controlled domain specified in the modified callbackUrl parameter. An access token is a credential that lets software act on your behalf, so if one lands in the wrong hands, the account can be accessed without a password.

Getting the second bug accepted

After the report, the team responded that they considered the reported vulnerability part of the previous callbackUrl fix. They emphasised that their policy allows only one bounty payment per bug and considered duplicates unacceptable. A duplicate is a report for a problem the team already knows about and has already paid for.

The researcher pushed back. They reiterated the findings, stressing that the vulnerability persisted specifically in the callbackUrl of the Auth0 endpoint. Auth0 is a service that handles login and identity for applications. They acknowledged the team's efforts in resolving the previous bug, but urged them to treat this as a separate issue because of its potential risk of account takeover.

From the original on cametom006.medium.com

Following internal discussions, the team recognised the severity of the vulnerability and awarded another four-digit bounty along with an exclusive swag pack.

From the original on cametom006.medium.com

Why it worked

The application took the destination of a security-sensitive redirect from the request itself. In the password reset flow, the CallbackUrl field of the JSON body decided where the emailed reset link pointed, so the token was delivered to whatever host the requester named. In the OpenID flow, the callbackUrl query parameter decided where the authentication response was sent, so the response carrying the authentication result, and per the report potentially access tokens, went to the attacker's domain.

In both cases the server used a value supplied by the client as a redirect target. The report does not describe any validation or allowlist that was present and bypassed. An allowlist is a fixed list of permitted values; here it would mean only allowing callback addresses on the application's own domains.

The team's first reaction was to treat the OpenID issue as covered by the earlier fix. Fixing one place where a value is used does not automatically fix the others.

What the impact was

Both issues are one-click account takeovers. In the password reset case, an attacker who submits a reset request for a victim's email with an attacker-controlled CallbackUrl receives the reset token as soon as the victim clicks the emailed link, and can then take over the account. In the OpenID case, an attacker who gets a victim to start the provider login through a crafted link has the authentication response redirected to the attacker's domain, allowing interception of the authentication process and potentially access tokens. The report hedges the second case with "potentially", and the impact depends on the victim completing the login flow with the respective provider.

How it should be fixed

The report does not describe the specific code change made. What it does show is the sequence: the first callbackUrl issue was marked high severity and rewarded, and the second report was initially treated as part of that fix until the team, after internal discussions, accepted the Auth0 endpoint's callbackUrl as a separate issue. The appropriate fix, in both flows, is to stop taking the redirect destination from the request: build the reset link and the OpenID callback from a fixed, server-side value, or validate the supplied value strictly against an allowlist of the application's own origins before using it.

Things worth trying yourself

  1. Password reset requests: look for any field that influences the link in the email (CallbackUrl, returnUrl, redirect, domain, host). A positive result is an email whose link points at a host you control, with the token in the query string.
  2. OAuth/OpenID start endpoints: append or modify a callbackUrl/redirect_uri parameter to point at your domain. A positive result is the provider's authentication response arriving at your host, ideally with a code or token.
  3. JavaScript review: search the application's bundles for callback and redirect parameter names, as the researcher did, to find flows that reuse the same parameter outside the one you already found. A positive result is a second endpoint that honours the parameter.
  4. Remediation scope: after a callback parameter is fixed in one flow, retest the same parameter name in every other flow (password reset, social login, email verification, invitation links). A positive result is any flow where the old behaviour still works, which is exactly the situation the second report describes.

Glossary

  • Account takeover (ATO): an attack in which someone gains control of another person's account and can act as them.
  • Allowlist: a fixed list of values that are permitted; anything not on the list is rejected.
  • API: the part of a service that software talks to, as opposed to the pages a person sees in a browser.
  • Auth0: a service that handles login and identity for applications.
  • Authentication: the process of proving who you are, usually by logging in.
  • Bug bounty program: a scheme where a company pays researchers to find and privately report security problems.
  • Callback URL: the address a service sends the user back to after an action, such as finishing a login.
  • Client: the software making a request, usually your browser or an app.
  • Duplicate: a report for a problem the team already knows about and has already paid for.
  • Endpoint: a specific address on a server that performs a particular action.
  • Exploit: the concrete steps that turn a weakness into a working attack.
  • High severity: a rating meaning the problem is serious and should be fixed quickly.
  • Identity provider: a service such as Google that confirms who you are on behalf of another application.
  • JavaScript: the code that runs in your browser and makes a website interactive.
  • JSON: a common text format for sending structured data between software.
  • OAuth: a standard that lets an application log you in through another service without seeing your password there.
  • One-click exploit: an attack where the victim only has to perform a single action, such as clicking a link.
  • OpenID: a standard built on OAuth for confirming a user's identity through an identity provider.
  • Origin: the combination of scheme, host and port that identifies where a request came from, for example https://app.example.com.
  • Parameter: a named piece of information sent along with a request, like a label on a form field.
  • Password reset token: a long random string in a reset link that proves the holder is allowed to set a new password.
  • POST: the request method used when sending data to a server rather than just asking for a page.
  • Query string: the part of an address after the ?, carrying parameters and their values.
  • Redirect: sending the browser or a response to a different address than the one originally requested.
  • Remediation: the fix a team applies to close a vulnerability.
  • Request: a message your browser or software sends to a server asking it to do something.
  • Root cause: the underlying reason a vulnerability exists, as opposed to its visible symptoms.
  • Server: the computer that stores a service's data and answers requests.
  • Swag pack: branded merchandise given as a thank-you gift.
  • Token: a temporary credential, like a key, that proves the holder is allowed to do something.
  • Vulnerability: a weakness in software that an attacker can use to do something harmful.

More by Fahad Faisal

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.