Skip to content
Account takeover Write-up Intermediate

Predictable Account-Activation Token: Email-Ownership Verification Bypass

The account-activation token was generated as a deterministic hash of the user's email address, and the registration API returned the membership identifier needed to redeem it. An attacker could therefore calculate the token offline and activate an account for any email address they knew, without access to that inbox.

redhunter01 Follow

Published on medium.com

Bug Bounty

redhunter01, 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. 8 min read.

Context

Email verification is meant to establish one property: the person creating an account controls the email address associated with it. During security research on a live venue-account platform, I found that this property could be bypassed because the account-activation token was completely predictable.

The activation token was not random, not derived from a server secret, and not tied to any server-side secret. It was generated deterministically as:

Text
activation_token = SHA1(lowercase(email_address))

Because the email address is already known to the attacker, the activation token can be calculated entirely offline. The companion identifier needed to redeem the token was also returned directly by the public registration API.

That combination produced a complete email-verification bypass:

Text
Attacker knows email        ↓Register pending account        ↓Receive membership identifier        ↓Calculate activation token locally        ↓Redeem activation URL        ↓Account becomes activated        ↓Authenticated session issued

No access to the email inbox was required at any point.

Setup

The research concerned a live venue-account platform. All validation used tester-controlled accounts: no third-party inbox was accessed and no existing user's active account was modified.

The application exposed a public registration endpoint similar to:

Text
POST /api/account/register

A normal registration request created an account that required activation. The activation functionality accepted two values:

Text
mid = membership identifieract = activation token

Finding it

A normal registration request produced a response containing a membership identifier:

JSON
{  "resultCode": 1,  "membershipGuid": "<membership-guid>",  "communityMemberId": "<member-id>",  "accessToken": null,  "refreshToken": null}

The important observation was accessToken: null: the account was pending activation and no session had been issued. The same response, however, also exposed the identifier required by the activation endpoint. That raised the next question: what makes the activation token secret?

To answer it, I collected multiple server-generated activation tokens using controlled test accounts and compared them against locally calculated SHA-1 values of the corresponding lowercase email addresses. The relationship was exact:

Text
SHA1(lowercase(email))        =server-issued activation token

This was reproduced across independent server-issued examples. For each test email, the lowercase form was hashed with SHA-1, producing a 40-character hexadecimal value that matched the server-issued activation token.

The activation token was therefore not functioning as a secret capability at all. It was a deterministic transformation of a value the attacker already knows.

Exploitation

Step 1: Register a pending account

I created a registration request using a tester-controlled email address and an attacker-selected password.

HTTP
POST /api/account/register HTTP/2Content-Type: application/json

The request included the email address and:

JSON
{  "requiresActivation": true}

The server returned a pending account together with the membership identifier:

JSON
{  "resultCode": 1,  "membershipGuid": "<membership-guid>",  "communityMemberId": "<member-id>",  "accessToken": null,  "refreshToken": null}

At this point no authentication session had been issued, but the membership identifier needed for activation was in hand.

Step 2: Calculate the activation token offline

Using the email address supplied during registration, I calculated:

Text
SHA1(lowercase(email))

The resulting 40-character hexadecimal value exactly matched the activation token generated by the server. The calculation required no inbox access, no verification email, no additional server request and no secret. The token was generated entirely offline.

Step 3: Test an invalid token

Before using the calculated value, I tested an intentionally incorrect activation token. The activation request redirected to the email-verification resend flow rather than activating the account. This established that the activation parameter was actually being validated, so a successful activation would mean something.

Step 4: Redeem the offline-generated token

I then supplied the calculated token together with the membership identifier. The application accepted it and redirected to the activated-account flow. The server issued authentication cookies including:

Text
access_tokenrefresh_token

The resulting access token represented a real authenticated user principal. The decoded claims included identifiers corresponding to the newly created account and community. The end result:

Text
Pending account      ↓Activation token calculated offline      ↓Activation accepted      ↓Authenticated session issued

At no point was the email inbox accessed.

What was actually bypassed

The intended security model was:

Text
Register   ↓Verification email   ↓User receives secret link   ↓User clicks link   ↓Email ownership established   ↓Account activated

The vulnerable implementation effectively became:

Text
Register   ↓Know the email   ↓Calculate SHA-1(email)   ↓Construct activation request   ↓Account activated

The second flow provides no evidence that the registrant controls the mailbox, which defeats the purpose of email verification.

Pre-account-hijacking scenario

The more interesting consequence concerns an email address that belongs to someone who has not yet registered an account. Consider [redacted]. If the address is not yet registered, an attacker could potentially:

Text
1. Register the email        ↓2. Choose the password        ↓3. Receive membershipGuid        ↓4. Calculate SHA1(email)        ↓5. Activate the account        ↓6. Obtain an authenticated session

The resulting account is associated with the target email address while being controlled by the attacker. This is a classic pre-account-hijacking scenario involving predictable verification credentials. The important limitation is that it applies to an email address that has not already been registered.

User enumeration

The registration endpoint also provided an additional security signal. Submitting an already-registered email resulted in a distinct response:

Text
400 Bad Request

with an error equivalent to:

Text
AlreadyRegistered

This creates a reliable registration-status oracle:

Text
Email  ↓POST /api/account/register  ↓AlreadyRegistered?  ├── Yes → account exists  └── No  → registration can proceed

This is separate from the activation-token vulnerability but increases the ability to determine whether an email address is already associated with an account.

A separate registration weakness

During testing I also observed a related but distinct behaviour. When the client omitted requiresActivation from the registration request, the server could automatically activate the account and return an access token immediately. The server did not consistently enforce the email-verification requirement independently of the client-supplied registration state. This should be treated as a separate weakness from the predictable activation token. The fundamental issue is that security-sensitive verification state is controlled or influenced by client input; verification requirements should be enforced server-side rather than relying on a client-provided activation flag.

Root cause

The problem is not merely that SHA-1 is an old hashing algorithm. Replacing SHA-1 with SHA-256 would not fix the underlying design, because SHA256(lowercase(email)) would still be completely reproducible. The problem is that there is no secret entropy involved. An attacker who knows [redacted] can calculate SHA1("[redacted]") without interacting with the server.

A secure verification token should contain unpredictable server-generated entropy:

Text
Email  +Random secret  ↓Verification token

rather than:

Text
Email  ↓Deterministic hash  ↓Verification token

The deeper issue is architectural:

Text
Verification secret        =public identifier        +deterministic transformation

An email address is not a secret, so any activation credential derived exclusively from that email is reproducible. The server needs to introduce unpredictable entropy that an attacker cannot calculate. A secure model looks more like:

Text
Registration     ↓Generate random 128+ bit value     ↓Store token server-side     ↓Send token to email     ↓User presents token     ↓Verify + invalidate     ↓Activate account

Impact

The demonstrated impact is:

  • email-ownership verification bypass
  • pre-account-hijacking of not-yet-registered addresses
  • authenticated account creation without inbox access
  • user enumeration

Several scenarios were specifically excluded to keep the finding precise. This is not direct takeover of an existing active account: re-registering an email address that already belongs to an active account was rejected with an AlreadyRegistered response, so the predictable activation token does not allow an attacker to simply overwrite the password of an existing active account through registration.

The password-reset token is separate. I verified that the password-reset mechanism does not use the same predictable construction: the password-reset token was a random UUIDv4 rather than a value derived from the email address. The predictable-token issue is therefore specific to the account activation mechanism and should not be described as a password-reset-token prediction vulnerability.

Fix

A proper activation mechanism should use a high-entropy, unpredictable, single-use token:

Text
Random token    ↓At least 128 bits of entropy    ↓Stored server-side    ↓Associated with account + purpose    ↓Time limited    ↓Invalidated after successful use

The token must not be derived solely from the email, username, member ID, account ID, timestamp or another predictable identifier. If a keyed construction is used, it should incorporate server-controlled secret material and appropriate lifecycle controls. Most importantly, activation should be treated as a server-side security state transition rather than something the client can downgrade or control through parameters such as requiresActivation.

The recommended remediation, as set out in the report:

  1. Replace the deterministic activation token with a cryptographically secure random token of at least 128 bits of entropy.
  2. Store the activation state server-side, associating the token with the account, email, activation purpose, expiration and single-use state.
  3. Invalidate tokens after use, so an activation token is not reusable once the account has been activated.
  4. Do not derive verification secrets from email addresses; SHA-1, SHA-256 or another unkeyed hash of the email does not solve the problem because the input itself is predictable.
  5. Enforce activation server-side, so the requirement for email verification does not depend on whether the client sends requiresActivation=true.
  6. Review registration-state enumeration, considering consistent responses for registered and unregistered addresses where practical while preserving legitimate registration functionality.

Variants to test

  • Hash-of-email activation tokens. Register a controlled account, capture the server-issued activation token, and compare it with SHA-1 and SHA-256 of the lowercase email. A positive result is an exact match, which means the token can be computed offline for any known address.
  • Other deterministic derivations. Try hashes of the email combined with the membership identifier, username, account ID or a timestamp, since the report warns against deriving tokens from any of these. A positive result is a token you can reproduce locally from values the registration response already gives you.
  • Identifier leakage in registration responses. Inspect the registration response for identifiers the activation endpoint consumes, such as a membership GUID. A positive result is a pending account whose activation can be addressed without any email.
  • Client-controlled activation flags. Omit or alter fields such as requiresActivation in the registration request. A positive result is an account that is activated, or an access token returned, without any verification step.
  • Registration-status oracles. Submit an already-registered address and compare the status code and error body with a fresh address. A positive result is a distinct, reliable signal such as 400 Bad Request with AlreadyRegistered.
  • Token validation sanity checks. Send an intentionally wrong activation token first. A positive result is a rejection or redirect to a resend flow, confirming the parameter is validated and that a later success is meaningful.
  • Password-reset token construction. Capture reset tokens and check whether they are random (for example UUIDv4) or derived from the email.

A strong report does not just demonstrate the attack; it also demonstrates where the attack stops. Testing already-registered emails and the password-reset flow was what established the boundaries of this finding.

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

What happened, in plain words

When you sign up for a website, most sites send you an email with a link you have to click. That link proves one thing: that you really own the email address you typed in. It stops someone from creating an account using your address without your permission.

On a live platform for venue accounts, the researcher found that this proof could be faked. The secret code inside the activation link was not secret at all. It was simply a scrambled version of the email address itself, and anyone who knows an email address can produce that same scrambled value on their own computer. The other piece of information needed to finish activation was handed out openly by the registration system.

So the check collapsed for addresses not yet registered: an attacker could register an account with an email address they do not own, work out the activation code without ever opening that mailbox, and end up logged in. The researcher also found two related issues: the registration system revealed whether an email address already had an account, and it would sometimes skip verification entirely if the browser simply did not ask for it.

This article walks through the finding from the beginning, explaining each idea as it appears. No prior security knowledge is assumed.

Some background ideas first

Before the details, a few everyday concepts that the rest of the article relies on.

What an API is. A website has two faces. One is the page you see in your browser. The other is a set of behind-the-scenes addresses that the page talks to, sending and receiving data. That second face is the API (Application Programming Interface). Think of a restaurant: the menu and the dining room are the website, the kitchen is the server, and the waiter who carries your order back and forth is the API. When you fill in a sign-up form, your browser sends a request to an API address such as /api/account/register, and the server sends back a reply, usually in a format called JSON (plain text structured as labelled values).

What a token is. A token is a short piece of text that stands in for something else, usually proof that you are allowed to do something. A cinema ticket is a token: it is not the film, but showing it gets you in. Websites use tokens in two common ways. An activation token is a one-off code that proves you received a particular email. An access token is a code your browser keeps after you log in, so the server recognises you on later requests without asking for your password again.

What a cookie is. A cookie is a small piece of data a website asks your browser to store and send back with every later request to that site. It is how a website remembers you between page loads. Login sessions usually live in cookies.

What a hash is. A hash is a mathematical recipe that turns any piece of text into a fixed-length jumble of letters and numbers. The same input always gives the same output, but you cannot work backwards from the output to the input. SHA-1 is one such recipe; it always produces 40 characters made of the digits 0 to 9 and the letters a to f (this is called hexadecimal). SHA-256 is a newer, longer recipe. Hashing is useful for checking things, but it is not encryption: there is no key and no way to undo it.

What "deterministic" means. Something is deterministic when the same starting point always produces the same result, with no randomness involved. A recipe is deterministic; a dice roll is not. This distinction is the heart of the whole story.

What the vulnerability class is. The general name for this kind of mistake is a predictable token or insecure verification token. The security rule being broken is simple: a secret used to prove identity must be unguessable. If an attacker can work out the secret from information they already have, it is not a secret.

What the product and feature do. The target was a live venue-account platform. Its sign-up feature worked like most: you register, the site says your account is pending, it emails you a link, and clicking the link activates the account. The link carries two values, a membership identifier and an activation token. The membership identifier says which pending account; the activation token is supposed to prove you received the email.

The claim being tested

Email verification is meant to establish one property: the person creating an account controls the email address associated with it. During security research on a live venue-account platform, the researcher found that this property could be bypassed because the account-activation token was completely predictable.

The activation token was not random, not derived from a server secret, and not tied to any server-side secret. It was generated deterministically as:

Text
activation_token = SHA1(lowercase(email_address))

Line by line: activation_token is the name of the value the site puts in the activation link. SHA1 is the hashing recipe described above. lowercase(email_address) means the email address is first converted to all lowercase letters, so [redacted] becomes [redacted]. The whole line says: take the email address, make it lowercase, run it through SHA-1, and that result is the activation token. Nothing else goes in. No random value, no server secret.

Because the email address is already known to the attacker, the activation token can be calculated entirely offline. The companion identifier needed to redeem the token was also returned directly by the public registration API.

That combination produced a complete email-verification bypass:

Text
Attacker knows email        ↓Register pending account        ↓Receive membership identifier        ↓Calculate activation token locally        ↓Redeem activation URL        ↓Account becomes activated        ↓Authenticated session issued

Read the arrows as "then". The attacker starts with an email address. They register a pending account. The server replies with a membership identifier. The attacker computes the activation token on their own machine. They send the activation request. The account becomes active. The server hands back a logged-in session. No access to the email inbox was required at any point.

Setup

The research was carried out against a live venue-account platform. All validation used tester-controlled accounts: no third-party inbox was accessed and no existing user's active account was modified. This matters for ethics and for accuracy: the researcher only ever attacked accounts they had created themselves, so no real person was harmed.

The application exposed a public registration endpoint similar to:

Text
POST /api/account/register

POST is the type of request used when you are sending data to a server (as opposed to GET, which just asks for a page). /api/account/register is the address of the sign-up function. "Similar to" means the real address has been generalised for the write-up.

A normal registration request created an account that required activation. The activation functionality accepted two values:

Text
mid = membership identifieract = activation token

This is two lines run together by formatting. mid is short for membership identifier: it tells the server which pending account is being activated. act is short for activation token: it is supposed to prove the person received the email. Both appear in the activation link.

Finding it

A normal registration request produced a response containing a membership identifier:

JSON
{  "resultCode": 1,  "membershipGuid": "<membership-guid>",  "communityMemberId": "<member-id>",  "accessToken": null,  "refreshToken": null}

Line by line: the outer braces hold a set of labelled values. resultCode: 1 means the request succeeded. membershipGuid is the membership identifier, the value the activation step needs; the real value is replaced here with a placeholder. communityMemberId is another identifier for the member within the community. accessToken: null means no login token was issued, and refreshToken: null means no token for renewing a login was issued either. In plain terms: the account exists but is not yet usable.

The important observation was accessToken: null: the account was pending activation and no session had been issued. The same response, however, also exposed the identifier required by the activation endpoint. That raised the next question: what makes the activation token secret?

This is the key moment of curiosity. The server had already given away half of what the activation link needs. If the other half could be guessed, the email step would be pointless. So the researcher set out to find out where the token came from.

To answer it, the researcher collected multiple server-generated activation tokens using controlled test accounts and compared them against locally calculated SHA-1 values of the corresponding lowercase email addresses. The relationship was exact:

Text
SHA1(lowercase(email))        =server-issued activation token

In words: the value computed locally from the email address equals, character for character, the value the server had generated. The equals sign is the finding.

This was reproduced across independent server-issued examples. For each test email, the lowercase form was hashed with SHA-1, producing a 40-character hexadecimal value that matched the server-issued activation token. Reproducing it on several separate accounts rules out coincidence: a 40-character match by chance is effectively impossible.

The activation token was therefore not functioning as a secret capability at all. It was a deterministic transformation of a value the attacker already knows. "Capability" here means a thing you possess that grants access, like a key. A key that anyone can cut for themselves is not a key.

Exploitation

Step 1: Register a pending account

The researcher created a registration request using a tester-controlled email address and an attacker-selected password. The password is chosen by the attacker because they are creating the account; the email is the address they want the account tied to.

HTTP
POST /api/account/register HTTP/2Content-Type: application/json

This is the request line and one header, run together by formatting. POST /api/account/register is the sign-up request. HTTP/2 is the version of the web protocol used. Content-Type: application/json tells the server that the body of the request is formatted as JSON, so it knows how to read it.

The request included the email address and:

JSON
{  "requiresActivation": true}

This small JSON body says: this registration requires activation. requiresActivation is a flag, a simple on/off switch, and here it is set to true. Remember this field; it comes back later as a problem of its own.

The server returned a pending account together with the membership identifier:

JSON
{  "resultCode": 1,  "membershipGuid": "<membership-guid>",  "communityMemberId": "<member-id>",  "accessToken": null,  "refreshToken": null}

Same structure as before: success code, membership identifier, community member identifier, and two empty login tokens. At this point no authentication session had been issued, but the membership identifier needed for activation was in hand. The attacker now has one of the two values the activation link needs, and it came straight from the server without any email being involved.

Step 2: Calculate the activation token offline

Using the email address supplied during registration, the researcher calculated:

Text
SHA1(lowercase(email))

This is the same recipe as before, applied by hand on the attacker's own computer. The resulting 40-character hexadecimal value exactly matched the activation token generated by the server. The calculation required no inbox access, no verification email, no additional server request and no secret. The token was generated entirely offline.

Why this step matters: it shows the attacker never has to touch the victim's mailbox or even talk to the server to obtain the token. The server's secret is reproducible from public information, which is the definition of a broken secret.

Step 3: Test an invalid token

Before using the calculated value, the researcher tested an intentionally incorrect activation token. The activation request redirected to the email-verification resend flow rather than activating the account. This established that the activation parameter was actually being validated, so a successful activation would mean something.

This is good experimental method. If the server accepted any token at all, a later success would prove nothing. By first showing that a wrong token is rejected, the researcher proves the check exists and that the calculated token is what passed it.

Step 4: Redeem the offline-generated token

The researcher then supplied the calculated token together with the membership identifier. The application accepted it and redirected to the activated-account flow. The server issued authentication cookies including:

Text
access_tokenrefresh_token

Two cookie names, run together by formatting: access_token is the cookie that proves you are logged in, and refresh_token is the cookie used to obtain a new access token when the old one expires. Receiving these means the server now treats the requester as a logged-in user.

The resulting access token represented a real authenticated user principal. "Principal" is the technical word for the identity a system recognises, here the newly created account. The decoded claims included identifiers corresponding to the newly created account and community. "Claims" are the pieces of information packed inside a token, such as which account it belongs to. The end result:

Text
Pending account      ↓Activation token calculated offline      ↓Activation accepted      ↓Authenticated session issued

At no point was the email inbox accessed. The account went from pending to logged-in purely through values the attacker could compute or had been given.

What was actually bypassed

The intended security model was:

Text
Register   ↓Verification email   ↓User receives secret link   ↓User clicks link   ↓Email ownership established   ↓Account activated

This is how sign-up is supposed to work. The secret link only reaches the real mailbox, so clicking it is evidence that the person controls that mailbox.

The vulnerable implementation effectively became:

Text
Register   ↓Know the email   ↓Calculate SHA-1(email)   ↓Construct activation request   ↓Account activated

Compare the two chains. The email step has vanished. The second flow provides no evidence that the registrant controls the mailbox, which defeats the purpose of email verification. The check still runs, but it checks nothing.

Pre-account-hijacking scenario

The more interesting consequence concerns an email address that belongs to someone who has not yet registered an account. Consider [redacted]. If the address is not yet registered, an attacker could potentially:

Text
1. Register the email        ↓2. Choose the password        ↓3. Receive membershipGuid        ↓4. Calculate SHA1(email)        ↓5. Activate the account        ↓6. Obtain an authenticated session

Step by step: the attacker signs up using the victim's address; the attacker picks the password, so they will know it; the server returns the membership identifier; the attacker computes the token from the email; the account is activated; the attacker is logged in. The resulting account is associated with the target email address while being controlled by the attacker. This is a classic pre-account-hijacking scenario involving predictable verification credentials. "Pre-account" means it happens before the real owner ever signs up: the attacker claims the address first, and the genuine owner later finds an account already exists in their name.

The important limitation is that it applies to an email address that has not already been registered. If the address already has an account, the server refuses the new registration, as the next section shows.

User enumeration

The registration endpoint also provided an additional security signal. Submitting an already-registered email resulted in a distinct response:

Text
400 Bad Request

400 is an HTTP status code meaning the server rejected the request as invalid, and Bad Request is its short label. The point is that this reply differs from the reply for a fresh address.

with an error equivalent to:

Text
AlreadyRegistered

This is the error name the server returns, meaning the address already has an account. "Equivalent to" means the exact wording may differ.

This creates a reliable registration-status oracle:

Text
Email  ↓POST /api/account/register  ↓AlreadyRegistered?  ├── Yes → account exists  └── No  → registration can proceed

An "oracle" in security means any behaviour that answers a question you are not supposed to be able to ask. Here, by submitting an address and reading the reply, an attacker learns whether that address has an account. The branching diagram shows the two outcomes: AlreadyRegistered means the account exists; anything else means registration can proceed. This is separate from the activation-token vulnerability but increases the ability to determine whether an email address is already associated with an account.

A separate registration weakness

During testing the researcher also observed a related but distinct behaviour. When the client omitted requiresActivation from the registration request, the server could automatically activate the account and return an access token immediately. "The client" means the browser or program making the request; "omitted" means the field was simply left out.

The server did not consistently enforce the email-verification requirement independently of the client-supplied registration state. This should be treated as a separate weakness from the predictable activation token. The fundamental issue is that security-sensitive verification state is controlled or influenced by client input; verification requirements should be enforced server-side rather than relying on a client-provided activation flag.

In plain terms: the browser was effectively telling the server whether verification was needed, and the server believed it. A visitor can edit what their browser sends, so a security decision made that way is not reliable. The server should decide for itself.

Root cause

The problem is not merely that SHA-1 is an old hashing algorithm. Replacing SHA-1 with SHA-256 would not fix the underlying design, because SHA256(lowercase(email)) would still be completely reproducible. The problem is that there is no secret entropy involved. "Entropy" means randomness, the ingredient that makes a value unguessable. An attacker who knows [redacted] can calculate SHA1("[redacted]") without interacting with the server.

A secure verification token should contain unpredictable server-generated entropy:

Text
Email  +Random secret  ↓Verification token

rather than:

Text
Email  ↓Deterministic hash  ↓Verification token

The first diagram adds a random secret that only the server knows, so the result cannot be reproduced by anyone else. The second has no such ingredient, so anyone with the email can reproduce the result. The difference is the whole vulnerability.

The deeper issue is architectural:

Text
Verification secret        =public identifier        +deterministic transformation

An email address is not a secret, so any activation credential derived exclusively from that email is reproducible. The server needs to introduce unpredictable entropy that an attacker cannot calculate. A secure model looks more like:

Text
Registration     ↓Generate random 128+ bit value     ↓Store token server-side     ↓Send token to email     ↓User presents token     ↓Verify + invalidate     ↓Activate account

"128+ bit value" means a random number with at least 128 bits of randomness, which is far beyond guessing. "Store token server-side" means the server keeps its own record of the token rather than recomputing it. "Invalidate" means the token stops working after it has been used once. This chain keeps the secret genuinely secret: it exists only in the server's records and in the email.

Impact

The demonstrated impact is:

  • email-ownership verification bypass
  • pre-account-hijacking of not-yet-registered addresses
  • authenticated account creation without inbox access
  • user enumeration

Several scenarios were specifically excluded to keep the finding precise. This is not direct takeover of an existing active account: re-registering an email address that already belongs to an active account was rejected with an AlreadyRegistered response, so the predictable activation token does not allow an attacker to simply overwrite the password of an existing active account through registration. Saying clearly what an attack cannot do is part of a trustworthy report.

The password-reset token is separate. The researcher verified that the password-reset mechanism does not use the same predictable construction: the password-reset token was a random UUIDv4 rather than a value derived from the email address. A UUIDv4 is a long random identifier, so it cannot be computed from the email. The predictable-token issue is therefore specific to the account activation mechanism and should not be described as a password-reset-token prediction vulnerability.

Fix

A proper activation mechanism should use a high-entropy, unpredictable, single-use token:

Text
Random token    ↓At least 128 bits of entropy    ↓Stored server-side    ↓Associated with account + purpose    ↓Time limited    ↓Invalidated after successful use

Each line is a requirement. The token is random, so it cannot be computed. It has at least 128 bits of entropy, so it cannot be guessed. The server stores it, so the server is the authority. It is tied to a specific account and a specific purpose, so it cannot be reused elsewhere. It expires, so a leaked token has a short life. It stops working after use, so it cannot be replayed.

The token must not be derived solely from the email, username, member ID, account ID, timestamp or another predictable identifier. If a keyed construction is used, it should incorporate server-controlled secret material and appropriate lifecycle controls. "Keyed" means a secret key is mixed in, so the output cannot be reproduced without that key. Most importantly, activation should be treated as a server-side security state transition rather than something the client can downgrade or control through parameters such as requiresActivation.

The recommended remediation, as set out in the report:

  1. Replace the deterministic activation token with a cryptographically secure random token of at least 128 bits of entropy.
  2. Store the activation state server-side, associating the token with the account, email, activation purpose, expiration and single-use state.
  3. Invalidate tokens after use, so an activation token is not reusable once the account has been activated.
  4. Do not derive verification secrets from email addresses; SHA-1, SHA-256 or another unkeyed hash of the email does not solve the problem because the input itself is predictable.
  5. Enforce activation server-side, so the requirement for email verification does not depend on whether the client sends requiresActivation=true.
  6. Review registration-state enumeration, considering consistent responses for registered and unregistered addresses where practical while preserving legitimate registration functionality.

Variants to test

These are the checks a tester can repeat on other sites, in the same spirit as the original research.

  • Hash-of-email activation tokens. Register a controlled account, capture the server-issued activation token, and compare it with SHA-1 and SHA-256 of the lowercase email. A positive result is an exact match, which means the token can be computed offline for any known address.
  • Other deterministic derivations. Try hashes of the email combined with the membership identifier, username, account ID or a timestamp, since the report warns against deriving tokens from any of these. A positive result is a token you can reproduce locally from values the registration response already gives you.
  • Identifier leakage in registration responses. Inspect the registration response for identifiers the activation endpoint consumes, such as a membership GUID. A positive result is a pending account whose activation can be addressed without any email.
  • Client-controlled activation flags. Omit or alter fields such as requiresActivation in the registration request. A positive result is an account that is activated, or an access token returned, without any verification step.
  • Registration-status oracles. Submit an already-registered address and compare the status code and error body with a fresh address. A positive result is a distinct, reliable signal such as 400 Bad Request with AlreadyRegistered.
  • Token validation sanity checks. Send an intentionally wrong activation token first. A positive result is a rejection or redirect to a resend flow, confirming the parameter is validated and that a later success is meaningful.
  • Password-reset token construction. Capture reset tokens and check whether they are random (for example UUIDv4) or derived from the email. A positive result is a reset token you can reproduce offline, which would extend the impact well beyond activation.

A strong report does not just demonstrate the attack; it also demonstrates where the attack stops. Testing already-registered emails and the password-reset flow was what established the boundaries of this finding.

Glossary

  • API (Application Programming Interface): the set of behind-the-scenes addresses a website's pages use to send and receive data.
  • Endpoint: one specific address in an API, such as /api/account/register.
  • POST: the type of web request used to send data to a server.
  • GET: the type of web request used to ask for a page or data.
  • HTTP/2: a version of the protocol browsers and servers use to exchange requests and responses.
  • Header: a labelled line in a request or response carrying extra information, such as the data format.
  • JSON: a plain-text format for structured data, made of labelled values in braces.
  • Status code: a number in a server's reply saying what happened, such as 400 Bad Request.
  • Token: a short piece of text that stands in for proof of something, such as permission or identity.
  • Activation token: a one-off code meant to prove the person received a particular verification email.
  • Access token: a code kept after login so the server recognises the user on later requests.
  • Refresh token: a code used to obtain a new access token when the old one expires.
  • Cookie: a small piece of data a site asks the browser to store and send back with later requests, often holding a login session.
  • Session: the period during which a site treats you as logged in.
  • Hash: a mathematical recipe turning any text into a fixed-length jumble that cannot be reversed.
  • SHA-1: a hashing recipe producing a 40-character hexadecimal value.
  • SHA-256: a newer, longer hashing recipe.
  • Hexadecimal: a way of writing numbers using the digits 0 to 9 and the letters a to f.
  • Deterministic: always producing the same result from the same input, with no randomness.
  • Entropy: randomness; the ingredient that makes a value unguessable.
  • UUIDv4: a long random identifier, not derived from anything predictable.
  • Membership identifier (mid, membershipGuid): the value telling the server which pending account is being activated.
  • Principal: the identity a system recognises, here the account behind a session.
  • Claims: the pieces of information packed inside a token, such as which account it belongs to.
  • Client: the browser or program making a request.
  • Server-side: happening on the server, under the server's control, rather than in the browser.
  • Oracle: any behaviour that answers a question the attacker is not supposed to be able to ask, such as whether an email is registered.
  • User enumeration: learning which email addresses have accounts by observing different responses.
  • Pre-account hijacking: claiming an email address by registering it before its real owner does.
  • Verification bypass: getting past an identity check without satisfying it.
  • Invalidate: make a token stop working, usually after it has been used once.
  • Keyed construction: a token built with a secret key mixed in, so it cannot be reproduced without that key.

More by redhunter01

View all

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