Weird Email Verification Bypass
The email verification link used a confirm_key that only had two possible values, and the user_id was leaked in the response to account creation. An attacker could verify any email address, including one on the target's own domain, without access to that inbox.
Published on medium.com
I’m Vaibhav Atkale, sharing the writeup explaining how i managed to bypass the email verification implementation. So here we go..!!!
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.
Context
The target is an eCommerce-style website, referred to throughout as target.com because the researcher chose not to name it. Users sign up with an email address, and the account cannot be used until the address is verified through a link sent by email. That verification link is the feature under test here.
Setup
No special tooling is described. The researcher worked with ordinary sign-ups and inspected the verification emails and the responses returned when accounts are created. The precondition is simply the ability to register accounts on the site.
Finding it
The researcher starts with authentication issues, which is the first area checked on a new program. Two accounts are created, [redacted] and [redacted], and the verification links sent to each are compared. The links look like this:
https://target.com/o/blah/blah?user_id=1028356&confirm_key=Token1
Two parameters matter for cracking the link: user_id and confirm_key. Looking carefully at the response to the user creation request, the researcher finds that user_id is leaked in a response header. That leaves only confirm_key to deal with.
Several approaches are tried on the key: whether it is crackable if it is MD5 encrypted, whether it is guessable, and whether it has something to do with a timestamp. Token1 and Token2 are compared directly, on the theory that accounts created with almost identical addresses ([redacted] and [redacted]) might produce tokens that differ only in part. They were completely different, with no chance of guessing.
After a break, the researcher returns and creates five or six accounts, copying every verification link into a notepad. The result is the turning point:
https://target.com/o/blah/blah?user_id=1028361&confirm_key=Token1
https://target.com/o/blah/blah?user_id=1028362&confirm_key=Token2
https://target.com/o/blah/blah?user_id=1028363&confirm_key=Token1
https://target.com/o/blah/blah?user_id=1028364&confirm_key=Token2
https://target.com/o/blah/blah?user_id=1028365&confirm_key=Token1
https://target.com/o/blah/blah?user_id=1028366&confirm_key=Token2
In this sample the application generated only two confirm_key values, alternating between Token1 and Token2. Combined with the user_id leaked at creation time, the researcher now has everything needed to construct a working verification link.
Exploitation
To confirm the bypass, the researcher creates an account using an address on the program's own domain, [redacted], and checks whether verification can be completed without access to that mailbox, and whether the resulting session exposes additional internal tabs.
Step 1: create the account
Register with the address [redacted].
Step 2: capture the user id
Note the user_id parameter from the creation response. In the example it is 102838.
Step 3: try the first key
Request the verification URL with the captured id and the first of the two observed keys:
Step 4: try the second key
If the first does not work, request the same URL with the other key:
Step 5: result
Either of the two URLs will work. Email verification completes and the researcher is logged into the application as [redacted], despite having no access to that mailbox.
Step 6: what was reachable
No additional functionality was accessible to users who logged in with the program domain address. The bypass worked, but it did not unlock extra internal tabs in this case.
Root cause
The confirm_key is not unique per account. The observed links show only two confirm_key values, so the key space appears to be effectively two, and the accompanying user_id is disclosed in a response header during account creation. Verification therefore depends on two values that an attacker can obtain or enumerate trivially. The report does not describe the server-side implementation, so the reason the key repeats is not stated; likely the key is generated from a small pool or a weak source rather than from per-user randomness.
Impact
The researcher reported the issue as an email verification bypass. The team categorised it as account takeover and triaged it as high severity. In practice, an attacker who can register an account can verify an address they do not control, including one on the target's own domain, and log in as that address. The report notes that in this instance no additional functionality was exposed to such accounts, which limits the practical reach of the takeover on this target.
Fix
The report records that the issue was retested and fixed on 16th November 2020, the same day it was triaged. It does not describe the change made.
Variants to test
- Create six or seven accounts in a row and compare the verification links. A positive result is a small, repeating set of
confirm_keyvalues, as seen here. - Inspect every response header on the account creation request for identifiers such as
user_id. A positive result is an identifier that matches the one in the verification link. - Compare tokens from accounts with near-identical addresses to see whether only part of the token changes. A positive result is a shared prefix or suffix that narrows guessing.
- Test whether the key correlates with a timestamp or a sequential value. A positive result is a token that can be predicted from the account creation time or id.
- Try both observed keys against a freshly created account on a domain address you do not control. A positive result is a completed verification and a logged-in session without mailbox access.
Disclosure timeline
| Date | Event |
|---|---|
| 14th November 2020 | Vulnerability reported |
| 16th November 2020 | Triaged and marked as high |
| 16th November 2020 | Retested and fixed |
The lesson the researcher draws is that observation is key: review all responses and create multiple accounts, at least six or seven, whenever testing email verification, because the implementation is never obvious.
What happened, in plain words
A website let people sign up with an email address, and it sent a link to that address to prove the address was real. Until you clicked that link, your account was not usable. The link contained two pieces of information: a number identifying your account (user_id) and a secret code (confirm_key).
The researcher found two problems. First, the user_id was handed back openly in a response header when the account was created, so it was not secret at all. Second, the confirm_key was not random per person: the site only ever produced two different codes, alternating between them. So anyone who signed up could work out the verification link for another account, including an address on the company's own domain that they did not own, and finish verification without ever reading that mailbox.
The researcher reported it as an email verification bypass. The company treated it as an account takeover and rated it high severity. It was fixed two days after being reported.

The target and the feature
The site is an online shop, called target.com throughout because the researcher chose not to name it. People register with an email address. The account stays locked until the person proves they own the address by opening a link that the site emails to them.
That link is the feature being tested. If you can build a working link for an address you do not own, you can finish verification for that address and then log in as it. That is what "email verification bypass" means: getting past the ownership check without owning the mailbox.
A quick comparison: think of a hotel that emails you a booking confirmation with a reference number. If the reference number were always either 1111 or 2222, and your room number were printed on the receipt, anyone could ring reception and check in as you. The link is the reference number, the user_id is the room number, and the mailbox is the proof of identity that is supposed to be required.
Background ideas you need first
- Request and response: your browser asks a server for something (a request) and the server answers (a response). Every page you load is one of these exchanges.
- Response header: extra information attached to the answer, a bit like the label on a parcel rather than its contents. Headers carry things like the type of content and, sometimes, identifiers. They are not normally shown on the page, but you can see them with your browser's developer tools (press F12, then open the Network tab).
- Parameter: a named value in a web address, after a
?, written asname=value. In?user_id=1028356&confirm_key=Token1there are two parameters, joined by&. - Token: a short string of characters used as a secret or as proof that you are allowed to do something. A good token is long, random and different for every user, so nobody can guess it. A bad token is short, predictable or shared.
- MD5: an old way of turning text into a fixed-length fingerprint. It is not encryption (it cannot be reversed), and it is not safe for secrets because it is fast to compute and easy to attack.
- Timestamp: the date and time something happened, recorded as a number. If a token is built from a timestamp, and you know roughly when the account was made, you can predict the token.
- Account takeover: logging in as somebody else's account. Here it means verifying and using an address you do not control.
- Severity: how serious a bug is judged to be, usually low, medium, high or critical. It guides how quickly the company fixes it.
How the researcher started
No special tools are mentioned. The researcher used ordinary sign-ups, read the verification emails, and looked at the responses returned when accounts are created. The only precondition is being able to register accounts on the site, including with addresses you do not own.
Authentication, meaning how the site decides who you are, is the first area checked on a new program, because mistakes there tend to have the biggest consequences.
Finding it
Step 1: two accounts, two links
Two accounts were created, [redacted] and [redacted], and the verification links sent to each were compared. The links looked like this:
https://target.com/o/blah/blah?user_id=1028356&confirm_key=Token1
Line by line:
https://target.comis the site./o/blah/blahis the path, the part that tells the site which page or action to run. It is written asblahhere to hide the real path.?user_id=1028356says which account the link belongs to. The two accounts got consecutive numbers, 1028356 and 1028357.&confirm_key=Token1is the secret part, written asToken1andToken2to hide the real values.
Why this step: to see what a valid link is made of. You cannot attack a check until you know what it checks.
Step 2: the id is not secret
Two parameters matter for building the link: user_id and confirm_key. Looking carefully at the response to the request that creates an account, the researcher found that user_id was leaked in a response header. That leaves only confirm_key to work out.
Why this matters: a value that appears in a response header is visible to anyone who makes the request, so it cannot act as a secret. Half of the puzzle was being given away for free.
Step 3: trying to crack the key
Several ideas were tried on the key:
- Whether it could be cracked if it were MD5 encrypted.
- Whether it was simply guessable.
- Whether it had something to do with a timestamp.
- Whether
Token1andToken2shared parts, on the theory that accounts made with almost identical addresses ([redacted]and[redacted]) might produce tokens that differ only in part.
They were completely different, with no chance of guessing. So the key was not obviously weak in any of those ways.
Why this step: before assuming a design flaw, you rule out the usual weak-generation mistakes. Each idea is a hypothesis, and each was tested and rejected.
Step 4: a break, then more accounts
After a break, the researcher came back and created five or six accounts, copying every verification link into a notepad. That gave the turning point:
https://target.com/o/blah/blah?user_id=1028361&confirm_key=Token1
https://target.com/o/blah/blah?user_id=1028362&confirm_key=Token2
https://target.com/o/blah/blah?user_id=1028363&confirm_key=Token1
https://target.com/o/blah/blah?user_id=1028364&confirm_key=Token2
https://target.com/o/blah/blah?user_id=1028365&confirm_key=Token1
https://target.com/o/blah/blah?user_id=1028366&confirm_key=Token2
Line by line:
- The
user_idvalues climb in order: 1028361, 1028362, and so on. They are sequential. - The
confirm_keyvalues alternate:Token1,Token2,Token1,Token2,Token1,Token2. Only two values exist in the whole set.
Why this step: one or two accounts can hide a pattern. With six accounts in a row, a repeating pattern becomes obvious. The site was not generating a unique code per person; it was picking from a set of two.
Combined with the user_id leaked at creation time, the researcher now had everything needed to build a working verification link for any account.
Exploitation
To prove it, the researcher created an account using an address on the program's own domain, [redacted], and checked two things: whether verification could be completed without access to that mailbox, and whether the resulting session exposed extra internal tabs.
Why use the company's own domain: it is the clearest demonstration. If you can verify an address at the company itself, the bypass is real and not an artefact of a free email provider.
Step 1: create the account
Register with the address [redacted].
Step 2: capture the user id
Note the user_id from the creation response. In the example it is 102838.
Why: this is the first half of the link, and it is handed to you in the response header.
Step 3: try the first key
Request the verification URL with the captured id and the first of the two observed keys:
Line by line:
user_id=102838is the account just created.confirm_key=Token1is the first of the only two codes the site ever issues.
Why: with only two possible codes, you try one, then the other. There is no guessing involved, just two attempts.
Step 4: try the second key
If the first does not work, request the same URL with the other key:
Line by line:
- Same account, same path.
confirm_key=Token2is the second possible code.
Why: one of the two must be right, because the site only ever produces these two.
Step 5: the result
Either of the two URLs works. Email verification completes and the researcher is logged in as [redacted], despite having no access to that mailbox.
Why this is serious: the whole point of the emailed link is to prove you own the address. Here the proof could be produced without the mailbox, so the check did nothing.
Step 6: what was reachable
No additional functionality was accessible to users who logged in with the program domain address. The bypass worked, but it did not unlock extra internal tabs in this case.
Why this is recorded: it limits the practical reach. The takeover was real, but on this target it did not lead to more sensitive areas.
Why it worked
The confirm_key is not unique per account. The observed links show only two values, so there appear to be effectively two possible keys. The user_id that goes with it is disclosed in a response header when the account is created. Verification therefore depends on two values that anyone can obtain or try in a couple of attempts.
The report does not describe how the server generates the key, so the reason it repeats is not stated. The likely explanation is that the key comes from a small pool or a weak source rather than from proper per-user randomness.
Impact
The team categorised it as account takeover and triaged it as high severity. In practice, anyone who can register an account can verify an address they do not control, including one on the target's own domain, and log in as that address. In this instance no additional functionality was exposed to such accounts, which limits how far the takeover reached on this target.
The fix
The report records that the issue was retested and fixed on 16th November 2020, the same day it was triaged. It does not describe the change made.
Variants to test
- Create six or seven accounts in a row and compare the verification links. A positive result is a small, repeating set of
confirm_keyvalues, as seen here. - Inspect every response header on the account creation request for identifiers such as
user_id. A positive result is an identifier that matches the one in the verification link. - Compare tokens from accounts with near-identical addresses to see whether only part of the token changes. A positive result is a shared prefix or suffix that narrows guessing.
- Test whether the key correlates with a timestamp or a sequential value. A positive result is a token that can be predicted from the account creation time or id.
- Try both observed keys against a freshly created account on a domain address you do not control. A positive result is a completed verification and a logged-in session without mailbox access.
Disclosure timeline
| Date | Event |
|---|---|
| 14th November 2020 | Vulnerability reported |
| 16th November 2020 | Triaged and marked as high |
| 16th November 2020 | Retested and fixed |
The lesson the researcher draws is that observation is key: review all responses and create multiple accounts, at least six or seven, whenever testing email verification, because the implementation is never obvious.
Glossary
- Account takeover: logging in as somebody else's account, here by verifying an address you do not own.
- Authentication: how a site decides who you are, for example by checking a password or a verification link.
- Bypass: getting past a check without satisfying it properly.
- Confirm key: the secret code in a verification link, meant to be unique and unguessable per account.
- Developer tools: the panel built into browsers (F12) that shows requests, responses and headers.
- Email verification: proving you own an email address by opening a link sent to it.
- Header: extra information attached to a request or response, separate from the page content.
- MD5: an old fingerprinting function, fast and unsuitable for secrets.
- Parameter: a named value in a web address, written as
name=valueafter a?. - Path: the part of a web address after the site name that selects a page or action.
- Request: what your browser sends to a server to ask for something.
- Response: what the server sends back.
- Token: a string of characters used as a secret or as proof of permission.
- Triaged: reviewed by the company and accepted as a real issue, usually with a severity.
- User id: the number identifying an account, used in the verification link alongside the key.