How I Bypassed Account Verification with a Simple Host Header Tri
The sign-up process used the untrusted Host header to build the email verification link, so an attacker could point it at their own server. When the victim clicked the link, the verification token was sent to the attacker, who could then verify and take over the account.
Published on infosecwriteups.com
Free Article Link: Click for free!
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
The backend generated absolute verification URLs from the client-supplied Host header without validating it against trusted domains.
Impact
The attacker could bypass email verification and authentication to gain full control of the victim's newly created account, with potential to escalate if the account had elevated privileges.
What the attacker needed
Victim's email address; attacker-controlled server; victim clicks the verification link
The fix
The backend should only use trusted domains for verification links, avoid blindly using the Host header for URL generation, and filter requests at the load balancer or proxy against a whitelist of accepted hosts.
How it was found
- Register a new account using the victim's email address.
- Intercept the sign-up request and change the Host header to the attacker's server.
- The backend builds the verification link using the attacker's Host value and emails it to the victim.
- The victim clicks the link, sending the verification token to the attacker's server.
- Use the captured token to verify the account on behalf of the victim and gain access.
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 site emails you a link to confirm your address. This site built that link using a value the visitor's browser sends called the Host header, which says which website is being requested. Because the site trusted that value, an attacker could make the link point to their own server, receive the confirmation token, and use it to take over the 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.