How an Expired Trial Led to a Critical Email Verification Bypass
The email verification token in the URL contained a Base64-encoded, signed message that included the plaintext verification code. An attacker could decode the token to obtain the code and verify an account without access to the email inbox.
medium.com
Published on medium.com
During a recent pentest of a coworking space management application, our team had a really productive start. We quickly found some serious stuff: a critical IDOR that let us hijack other tenants’ payment methods, and a stored XSS right in the admin dashboard.
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.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application embedded the verification code inside a signed but not encrypted token in the URL, so the code was readable by anyone who decoded the token.
Impact
An attacker could verify an account without email access, potentially impersonating members or staff, accessing member-only resources, or committing fraud.
What the attacker needed
Ability to sign up for an account; access to the verification page URL
The fix
The token in the URL should be an opaque random string, and the verification code should be stored server-side and compared only on the server.
How it was found
- Sign up for a new account and reach the email verification page.
- Notice the token parameter in the URL, which looks like a Base64 string with a suffix.
- Decode the token layer by layer to reveal a JSON structure containing the verification code.
- Copy the code from the decoded token and submit it in the verification form.
- The account is verified without accessing the email inbox.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you sign up, the app sends a code to your email to prove you own it. Here, the app also put that same code inside the link you click, just hidden with a simple encoding (Base64) that anyone can reverse. So an attacker could read the code from the link and verify an account without needing the email.
What is Account takeover?
Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.