From Email Verification to 0-Click Account Takeover
The email verification endpoint accepted a request without the hash parameter, allowing verification of any company email address. The password reset endpoint then accepted a boolean value for the token parameter, which passed a loose comparison and returned valid access and refresh tokens for the victim's account.
medium.com
Published on medium.com
بس� الله، والصلاة والسلا� على رسول الله. While testing the authentication flow of an external bug bounty program, a small email verification quirk turned into a zero‑click account takeover once I challenged a couple of assumptions on token presence and type handling.
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 backend used a loose comparison (==) between the supplied token and the stored token, so a boolean true was treated as equal to a non-empty string.
Impact
An attacker could take over any user's account and gain unauthorised access to internal systems such as customer support tickets.
What the attacker needed
Ability to register an account; knowledge of victim's email address; victim has a company-domain email
The fix
The report states the issue was fixed, though the exact fix is not described; it should involve strict type checking and proper token validation.
How it was found
- Register a new account and observe the email verification link containing username and hash parameters.
- Remove the hash parameter and send a verification request using a company-domain email address.
- Access internal features such as the customer support ticket system now available to the verified company email.
- Attempt password reset with various invalid tokens (reused token, cross-account token, missing token, empty token) to test validation.
- Send a password reset request with a boolean true value instead of a string token.
- Receive valid access and refresh tokens for the victim's account.
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.
The website had two checks that were too loose. First, it let someone verify an email address without proving they owned it. Second, when resetting a password, it compared the supplied token to the stored one in a way that treated the word 'true' as matching any non-empty token, so an attacker could take over any account.
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.