Skip to content
Business logic Write-up Beginner

XX to XXX in one day

The email verification link contained both an email address and a token, but the server did not check that the token belonged to the email address. An attacker could verify any email address by changing the email parameter while keeping a valid token from their own account.

Baibhav Anand Follow

Published on medium.com

#### Baibhav Anand

Baibhav Anand, 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.

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

This is a short account of an email verification flow that trusted a parameter it should not have. The researcher, Baibhav Anand Jha, found the same weakness twice in one day: first on a private HackerOne program he had just been invited to, then on a second, popular website whose name he withheld until it was fixed. The feature involved is the standard sign-up confirmation: after registering, the site sends an email containing a link that verifies that the address belongs to the person who signed up.

The write-up does not name the first program or the second website, and it does not give the exact URL structure beyond a generic example. The narrative itself only refers to a private HackerOne program and a censored popular website.

Setup

The researcher had no special access. He had just attended a web security workshop run by BountyBash, with Shashank Kumar as the tutor for the day. One piece of practical advice from that workshop is the whole basis of the finding:

Whenever you see a link with two parameters try changing one of the parameters and check if the value gets accepted.

On his way home he received an email from HackerOne about a private program invitation. He decided to sign up to the program, which is what triggered the confirmation email. No tools, versions or special configuration are mentioned.

Finding it

After signing up, the confirmation email arrived with a verification link. The link had the following shape:

Text
https://www.website.com/register/verify/(my email)/(token)

Two values are carried in the path: the email address being verified and a token. The workshop advice applied directly, so instead of opening the link he decided to dig in a little more.

Image for post
Image for post From the original on medium.com

Exploitation

Step 1: create a second account with an address you do not control

He did not open the original link. Instead he created a new account using a random email address. Because he had no access to that mailbox, he could not read the confirmation email sent to it.

Step 2: swap the email parameter, keep the token

He took his own confirmation link, from the first account, and changed only the email parameter to the random address of the second account. The token was left untouched.

The important parts: the path segment holding the email address is the value under the attacker's control, and the token segment is the value he kept from his own legitimate email.

Step 3: open the modified link

Opening the modified link verified the second account.

Image for post
Image for post From the original on medium.com

He reported it to the program straight away and received a three-digit bounty.

Step 4: repeat on a public program

He then looked through some public programs on HackerOne and found a popular website, censored until fixed, with the same behaviour. The same technique worked there and earned another bounty, which he describes as another $XXX.

Image for post
Image for post From the original on medium.com

Root cause

The behaviour suggests the email address and the token are not bound together, so a token from one account can be paired with another address. A token from one account was paired with a different address. The report does not show the server-side code, so this is likely rather than confirmed.

The design flaw is that the identity being verified is taken from a user-controlled parameter instead of from the record the token belongs to. The token alone should identify the pending registration; the email in the URL should either be ignored or compared against the stored value.

Impact

An attacker who can register an account can confirm an email address they do not own, provided they hold any valid token from their own registration. That breaks the assurance that a confirmed address belongs to the person who registered it, which matters wherever verification gates access, notifications or account recovery.

Fix

The fix implied by the behaviour is to bind the token to the pending registration and verify the address from that stored record, rejecting any request where the supplied email does not match the one the token was issued for.

Variants to test

  1. Swap the email in a verification link while keeping your own token, as here. A positive result is the new address showing as verified without access to its mailbox.
  2. Swap the token while keeping the email, using a token from a different account. A positive result is verification succeeding with a token that was never issued for that address.
  3. Reuse a token after it has already been consumed. A positive result is a second successful verification.
  4. Change the case or add aliasing to the email (for example plus-addressing) while keeping the token. A positive result is verification of an address that differs from the one the token was issued for.
  5. Apply the same parameter-swap idea to other two-parameter links, such as password reset or invitation acceptance. A positive result is the action completing for an identity you do not control.

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.

What happened, in plain words

A security researcher, Baibhav Anand Jha, discovered a flaw in the email verification process used by websites when you sign up. After registering, a site typically sends you an email with a link to click to prove the email address is yours. That link often contains two pieces of information: your email address and a secret code (called a token). The flaw was that a token from one account could be used with a different email address in the link. By changing only the email address in the link to a random address he did not control and keeping his own token, he verified that address without access to its inbox. He found this on a private bug bounty program and then on another popular website, earning bounties both times.

Setup

The researcher had no special access. He had just attended a web security workshop run by BountyBash, with Shashank Kumar as the tutor for the day. One piece of practical advice from that workshop is the whole basis of the finding:

Whenever you see a link with two parameters try changing one of the parameters and check if the value gets accepted.

On his way home he received an email from HackerOne about a private program invitation. He decided to sign up to the program, which is what triggered the confirmation email. No tools, versions or special configuration are mentioned.

Finding it

After signing up, the confirmation email arrived with a verification link. The link had the following shape:

Text
https://www.website.com/register/verify/(my email)/(token)

This is a URL (web address). The part https://www.website.com is the site's domain. The path /register/verify/(my email)/(token) contains two pieces of information: first the email address being verified, then a token. A token is like a temporary password or a claim ticket: it is a long random string that the server generates and associates with your sign-up attempt. When you click the link, the server uses the token and the email address to mark the address as verified.

Two values are carried in the path: the email address being verified and a token. The workshop advice applied directly, so instead of opening the link he decided to dig in a little more.

Image for post
Image for post From the original on medium.com

Exploitation

Step 1: create a second account with an address you do not control

He did not open the original link. Instead he created a new account using a random email address. Because he had no access to that mailbox, he could not read the confirmation email sent to it. This step is important because it simulates an attacker who wants to verify an email they do not own. By using a random address, he ensures that any verification of that address would be unauthorised.

Step 2: swap the email parameter, keep the token

He took his own confirmation link, from the first account, and changed only the email parameter to the random address of the second account. The token was left untouched.

Here, (random email) is the email address of the second account, which he does not control. (token) is the valid token from his first account's confirmation email. The important parts: the path segment holding the email address is the value under the attacker's control, and the token segment is the value he kept from his own legitimate email. The token from the first account was accepted alongside the second account's address.

Step 3: open the modified link

Opening the modified link verified the second account. In other words, the website marked the random email as verified even though the researcher had no access to that mailbox and the token was not created for that address.

Image for post
Image for post From the original on medium.com

He reported it to the program straight away and received a three-digit bounty.

Step 4: repeat on a public program

He then looked through some public programs on HackerOne and found a popular website, censored until fixed, with the same behaviour. The same technique worked there and earned another bounty, which he describes as another $XXX.

Image for post
Image for post From the original on medium.com

Root cause

The behaviour suggests the email address and the token are not bound together, so a token from one account can be paired with another address. A token from one account was paired with a different address. The report does not show the server-side code, so this is likely rather than confirmed.

The design flaw is that the identity being verified is taken from a user-controlled parameter instead of from the record the token belongs to. The token alone should identify the pending registration; the email in the URL should either be ignored or compared against the stored value.

Impact

An attacker who can register an account can confirm an email address they do not own, provided they hold any valid token from their own registration. That breaks the assurance that a confirmed address belongs to the person who registered it, which matters wherever verification gates access, notifications or account recovery. The report does not describe any further exploitation beyond the verification itself, and the second site's name was censored until fixed.

Fix

The fix implied by the behaviour is to bind the token to the pending registration and verify the address from that stored record, rejecting any request where the supplied email does not match the one the token was issued for.

Variants to test

  1. Swap the email in a verification link while keeping your own token, as here. A positive result is the new address showing as verified without access to its mailbox.
  2. Swap the token while keeping the email, using a token from a different account. A positive result is verification succeeding with a token that was never issued for that address.
  3. Reuse a token after it has already been consumed. A positive result is a second successful verification.
  4. Change the case or add aliasing to the email (for example plus-addressing) while keeping the token. A positive result is verification of an address that differs from the one the token was issued for.
  5. Apply the same parameter-swap idea to other two-parameter links, such as password reset or invitation acceptance. A positive result is the action completing for an identity you do not control.

Glossary

  • API: Application Programming Interface; a set of rules that lets one piece of software talk to another. In web terms, it is how your browser requests data from a server.
  • Bounty: A reward, often money, paid by a company to a security researcher who finds and reports a bug in their system.
  • Bug bounty program: A program run by an organisation that invites researchers to find and report security vulnerabilities in exchange for rewards.
  • Cookie: A small piece of data stored by your browser that a website can use to remember you between visits, such as keeping you logged in.
  • Endpoint: A specific URL or address on a server that performs a particular function, like verifying an email.
  • HackerOne: A platform that connects companies with security researchers and manages bug bounty programs.
  • Parameter: A piece of information passed in a URL, often after a ? or as part of the path, that tells the server what to do or which data to use.
  • Token: A unique string of characters, often random, used to authenticate or authorise an action. In this context, it is a secret code sent in a verification link to prove the link is legitimate.
  • URL: Uniform Resource Locator; the address of a web page or resource on the internet, like https://www.example.com/page.
  • Verification: The process of confirming that something is true, such as that an email address belongs to the person who signed up.
  • Vulnerability: A weakness in a system that can be exploited to cause harm or bypass security controls.

More by Baibhav Anand

View all

12 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Business logic flaws

The lesson behind this report.

The application works as coded but not as intended: a negative price, a skipped payment step, a limit that can be crossed.