break and bypass verification email
The email verification token was simply the user's email address concatenated with a five-digit number and base64-encoded, so it could be guessed by brute force. An attacker could register an account with an email address they did not own and verify it without access to that mailbox.
Published on medium.com
when you register in bukalapak.com with email (example [email protected]) you will get message in your email to verify account like this
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
Bukalapak is an e-commerce site, and the feature under review is its email verification flow. When someone registers with an email address, Bukalapak sends a message containing a verification button. Clicking that button takes the user through a redirector on glimpse.bukalapak.com and then to a confirmation page on www.bukalapak.com that carries a token in the URL path. The confirmation page sends the token, together with an access_token, in an AJAX request to https://api.bukalapak.com, and the error message comes back in that response.
The researcher found two separate problems in this flow: an open redirect on the redirector, and a verification token that is predictable enough to brute force. Combined, they allow an account to be registered and verified with an email address the attacker does not own.
Setup
No special accounts or roles are needed beyond the ability to register on bukalapak.com. The tools used are a browser, Burp Suite (Repeater and Intruder) and a base64 encoder. The researcher notes that the random number in the token was always five digits across the many accounts created during testing.
Finding it
The starting point is the verification email. After registering with an address such as [redacted], the email contains a button that points to the redirector:
The link parameter holds the URL-encoded confirmation URL, and the rest of the query string carries tracking and template values. Two things stood out: the link parameter is a plain redirect target, and the confirmation URL ends in a token that looks like base64.

Exploitation
Step 1: open redirect on the redirector
The link parameter is not restricted to Bukalapak URLs. Pointing it at another site redirects the browser there:
https://glimpse.bukalapak.com/redirect?link=https%3A%2F%2Fwww.bing.com
This request redirects to bing.com. On its own this is an open redirect; in this flow it also matters because the redirector is the component that hands the user to the confirmation page.
Step 2: decode the token
The confirmation URL from the email is:
https://www.bukalapak.com/confirmation/[redacted]=
The token [redacted]= is base64 for [redacted]:26551. The structure is the email address, a colon, and a number. The researcher created many accounts and observed that the number was always five digits, so the token space for any known email address is only 100000 values.
Step 3: build a wrong token and observe the failure
To confirm the format, the researcher built a token with a deliberately wrong number, [redacted]:12345, and base64-encoded it:
[redacted]=
Opening the confirmation URL with that token:
https://www.bukalapak.com/confirmation/[redacted]=

The page reports that the token is invalid. Behind the page, the token and an access_token are sent in an AJAX request to https://api.bukalapak.com, and the error message comes back in that response.

Step 4: compare a valid and an invalid token
Using Burp Repeater, the researcher compared the API response for a valid token with the response for an invalid one. The valid token returns HTTP 200.

The invalid token returns HTTP 400.

The status code is therefore a clean oracle: 200 means the guessed number is correct, 400 means it is not.
Step 5: brute force the five digits
The AJAX request is intercepted and sent to Burp Intruder. The payload is the five-digit number, and the Intruder payload processing rules prefix the target email address and base64-encode the result, producing a token of the form email:NNNNN in base64 for each attempt. The target account in the demonstration is [redacted].

The researcher reports that the five-digit space can be cracked in about 15 minutes with low bandwidth, and that the account is then verified without any access to the mailbox.
Root cause
The verification token is not a secret. It is a deterministic encoding of the email address plus a five-digit number, It is a deterministic encoding of the email address plus a five-digit number.. Anyone who knows the email address can enumerate the 100000 possible tokens, and the API distinguishes a correct guess from a wrong one by status code alone. The open redirect on glimpse.bukalapak.com is a separate weakness in the same chain: the redirector accepts arbitrary external URLs in link, the redirector accepts arbitrary external URLs in link..
Impact
An attacker can register an account with any email address that is not yet registered and verify it without owning that mailbox. The link parameter redirects to an external site such as bing.com. The researcher rated the issue as high severity.
Fix
The report does not describe a fix. The token should be replaced with a value that cannot be derived from the email address, for example a long random value stored server-side and tied to the pending registration, and the confirmation endpoint should rate-limit or lock out repeated failed attempts. The redirector should restrict link to an allowlist of Bukalapak hosts, or drop the parameter entirely.
Variants to test
- Decode any verification or password-reset token you receive. If it is base64 of an email plus a short number, try neighbouring numbers against the confirmation endpoint and watch for a status-code difference between valid and invalid.
- Look for redirector endpoints on the target's subdomains that take a URL parameter. A positive result is a request that returns a 30x to a host you control.
- Check whether the confirmation API returns different status codes or bodies for valid and invalid tokens. A clean 200/400 split makes brute force practical.
- Register several accounts and compare the token structure across them. A fixed-length numeric component, as here, bounds the search space.
- Test whether the confirmation endpoint enforces rate limiting by sending a burst of wrong tokens and observing whether responses change or the account is locked.
What happened, in plain words
Bukalapak is an online shopping site. Like most sites, it asks you to prove that an email address belongs to you before it lets you use that address on an account. The way it does this is simple: you sign up with an email, Bukalapak sends you a message with a button, and clicking that button tells Bukalapak "yes, this person can read that inbox".
The researcher found that this proof could be faked. Two separate weaknesses combined to make it possible:
- The link in the email goes through a redirector, a small service whose only job is to send your browser onwards to another address. That redirector would happily send you to any site on the internet, not just to Bukalapak. This is called an open redirect.
- The value that proves you own the email, called a token, was built in a way that could be guessed. It was just the email address plus a five-digit number, scrambled with a common encoding called base64. Five digits means only 100,000 possible values, and a computer can try all of them quickly.
Put together, an attacker could pick any email address that had not yet been registered, guess the token, and end up with a verified account for an address they do not control. The researcher rated the issue as high severity.
Background you need first
A few ideas come up again and again below, so here they are from zero.
- Email verification: when a website wants to be sure an email address is really yours, it sends a message to that address containing a special link. Only someone who can open that inbox can click the link. If the site then marks the account as verified, it trusts that the click proves ownership.
- Token: a short piece of text that acts like a claim ticket. The site gives it to you, and later you hand it back to prove you are the same person. A good token is long and random so nobody else can guess it. A bad token is short, or built from information anyone can see.
- Base64: a way of writing data using only letters, digits and a couple of symbols. It is not encryption and it is not secret. Anyone can decode it in a second. It is like writing a phone number in a different font: it looks different, but the information is the same.
- URL and query string: a web address. The part after a
?is the query string, made ofname=valuepairs separated by&. Servers read these values to decide what to do. - URL encoding: some characters cannot appear in a URL as-is, so they are written as
%followed by two hex digits.%3Ais a colon,%2Fis a slash,%40is an@. Decoding turns them back into the original characters. - Redirect: when a server answers a request with "not here, go there instead". Your browser follows automatically, so you often do not notice.
- Open redirect: a redirect where the destination is taken from a value the visitor controls, and is not checked against a list of allowed sites. Attackers use it to make a link that starts on a trusted domain but ends somewhere else.
- API: a service that answers requests from programs rather than showing pages to people. Here,
https://api.bukalapak.comis the API that decides whether a token is valid. - AJAX request: a request a web page makes in the background, without reloading the whole page. When you click a button and a small message appears without the page changing, an AJAX request probably happened.
access_token: a value that identifies the current session or user to the API. It is sent alongside the token so the API knows who is asking.- HTTP status code: a three-digit number in every response.
200means "OK, here is your answer".400means "your request was bad".30xmeans "go somewhere else". - Brute force: trying every possibility until one works. If there are only 100,000 possibilities, a computer can do it.
- Burp Suite: a tool for inspecting and changing web traffic. Repeater lets you send the same request again and again with small edits. Intruder sends the same request many times, each with a different value in a chosen spot.
- Oracle: any signal that tells an attacker whether a guess was right. A status code that differs between a correct and an incorrect guess is a perfect oracle.
The setup
The researcher only needed a normal account on bukalapak.com, a browser, Burp Suite, and something that can base64-encode text. No special access was required. During testing, many accounts were created, and in every one the random number inside the token was five digits long.
Finding it
The starting point is the verification email itself. After registering with an address such as [redacted], the email contains a button. That button does not point straight at Bukalapak. It points at a redirector on glimpse.bukalapak.com, which then forwards the browser to the confirmation page:
Line by line:
https://glimpse.bukalapak.com/redirectis the redirector service.link=https%3A%2F%2Fwww.bukalapak.com%2Fconfirmation%[redacted]%3Dis the destination, URL-encoded. Decoded, it ishttps://www.bukalapak.com/confirmation/[redacted]=. The long string at the end is the token.llstttu=[redacted]is a long hex value.subject=Segera+Verifikasi+Email+Kamuis the email subject, URL-encoded. The+signs stand for spaces.tag=confirmation,template_id=0andtype=ClickEmailare template and tracking labels.user_email=ha99999kou%40gmail.comis the recipient address, with@written as%40.
Two things stood out. First, link is a plain destination that the redirector follows, with no visible restriction. Second, the confirmation URL ends in a token that looks like base64, which means it can probably be decoded.

Exploitation
Step 1: open redirect on the redirector
The link parameter is not limited to Bukalapak addresses. Pointing it at another site sends the browser there:
https://glimpse.bukalapak.com/redirect?link=https%3A%2F%2Fwww.bing.com
Line by line:
https://glimpse.bukalapak.com/redirectis the same redirector.link=https%3A%2F%2Fwww.bing.comdecodes tohttps://www.bing.com, a site that has nothing to do with Bukalapak.
This request redirects to bing.com. On its own that is an open redirect. In this flow it also matters because the redirector is the piece that hands the user over to the confirmation page, so it is part of the chain that the attacker can influence.
Step 2: decode the token
The confirmation URL from the email is:
https://www.bukalapak.com/confirmation/[redacted]=
Line by line:
https://www.bukalapak.com/confirmation/is the page that checks the token.[redacted]=is the token, placed directly in the URL path.
Decoding that token from base64 gives [redacted]:26551. The structure is the email address, a colon, and a number. The researcher created many accounts and saw that the number was always five digits, so for any known email address there are only 100,000 possible tokens. That is a small enough space to try exhaustively.
Step 3: build a wrong token and observe the failure
To confirm the format, the researcher built a token with a deliberately wrong number, [redacted]:12345, and base64-encoded it:
[redacted]=
Line by line:
[redacted]=is the base64 form of[redacted]:12345. The email is the same as before, but the number is different, so this token should not be valid.
Opening the confirmation URL with that token:
https://www.bukalapak.com/confirmation/[redacted]=
Line by line:
- The path is the same confirmation page.
- The token is the wrong one just built.

The page reports that the token is invalid. Behind the page, the token and an access_token are sent in an AJAX request to https://api.bukalapak.com, and the error message comes back in that response. In other words, the token is checked through a background request to the API.

Step 4: compare a valid and an invalid token
Using Burp Repeater, the researcher sent the same API request twice, once with a valid token and once with an invalid one, and compared the responses. The valid token returns HTTP 200.

The invalid token returns HTTP 400.

The status code is therefore a clean oracle: 200 means the guessed number is correct, 400 means it is not. The status code differs between a valid and an invalid token.
Step 5: brute force the five digits
The AJAX request is intercepted and sent to Burp Intruder. The payload is the five-digit number. The Intruder payload processing rules prefix the target email address and base64-encode the result, so each attempt produces a token of the form email:NNNNN in base64. The target account in the demonstration is [redacted].

The researcher reports that the five-digit space can be cracked in about 15 minutes with low bandwidth, and that the account is then verified without any access to the mailbox.
Root cause
The verification token is not a secret. It is a deterministic encoding of the email address plus a five-digit number, It is a deterministic encoding of the email address plus a five-digit number.. Anyone who knows the email address can enumerate the 100,000 possible tokens, and the API distinguishes a correct guess from a wrong one by status code alone. The open redirect on glimpse.bukalapak.com is a separate weakness in the same chain: the redirector accepts arbitrary external URLs in link, the redirector accepts arbitrary external URLs in link..
Impact
An attacker can register an account with any email address that is not yet registered and verify it without owning that mailbox. The link parameter redirects to an external site such as bing.com.
Fix
The report does not describe a fix. The token should be replaced with a value that cannot be derived from the email address, for example a long random value stored server-side and tied to the pending registration, and the confirmation endpoint should rate-limit or lock out repeated failed attempts. The redirector should restrict link to an allowlist of Bukalapak hosts, or drop the parameter entirely.
Variants to test
- Decode any verification or password-reset token you receive. If it is base64 of an email plus a short number, try neighbouring numbers against the confirmation endpoint and watch for a status-code difference between valid and invalid.
- Look for redirector endpoints on the target's subdomains that take a URL parameter. A positive result is a request that returns a 30x to a host you control.
- Check whether the confirmation API returns different status codes or bodies for valid and invalid tokens. A clean 200/400 split makes brute force practical.
- Register several accounts and compare the token structure across them. A fixed-length numeric component, as here, bounds the search space.
- Test whether the confirmation endpoint enforces rate limiting by sending a burst of wrong tokens and observing whether responses change or the account is locked.
Glossary
- Base64: an encoding that rewrites data using letters, digits and a couple of symbols. It is not encryption and provides no secrecy.
- Burp Intruder: the part of Burp Suite that sends the same request many times with a different value in a chosen spot.
- Burp Repeater: the part of Burp Suite that lets you resend a request with small edits and compare responses.
- Email verification: a process where a site sends a link to an address and treats a click on that link as proof the address belongs to the account holder.
- HTTP status code: a three-digit number in every response, such as 200 for OK, 400 for a bad request, or 30x for a redirect.
- Open redirect: a redirect whose destination comes from a value the visitor controls and is not checked against an allowlist.
- Query string: the part of a URL after
?, made ofname=valuepairs separated by&. - Redirect: a server answer telling the browser to go to a different address instead.
- Token: a short piece of text used as a claim ticket to prove identity or permission later.
- URL encoding: writing characters that cannot appear in a URL as
%followed by two hex digits. - URL: a web address.