Skip to content
Account takeover Write-up Intermediate

How I Found Account take over via (“Host header injection Bypas

The password reset feature built the reset link from the X-Forwarded-Host header instead of the real host. An attacker could make the victim's reset email point to the attacker's server and capture the reset token to take over the account.

Skysenz Follow

Published on skysenz.medium.com

Gua nemu celah di fitur “Forgot Password” target Intinya gua bisa nipu server biar dia ngirim link reset password ke domain punya gua sendiri bukan ke domain asli mereka Hasilnya Gua bisa dapet token buat ganti password user lain

Skysenz, on skysenz.medium.com

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 trusted the client-supplied X-Forwarded-Host header when generating the password reset URL instead of using a fixed, configured hostname.

Impact

An attacker who knows a victim's email could take over their account without knowing the old password, provided the victim clicks the poisoned reset link.

What the attacker needed

Attacker knows victim's email; victim clicks the reset link; attacker controls a server

How it was found

  1. Intercept the forgot password request with Burp Suite.
  2. Add or modify the X-Forwarded-Host header to point to an attacker-controlled server.
  3. Observe that the server builds the reset link using the header value.
  4. The victim receives an official email whose reset button points to the attacker's server.
  5. The token is logged on the attacker's server when the victim clicks the link.
  6. Use the captured token on the real site to reset the victim's password.

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 forget a password, a site emails you a special link with a secret code (a token) that lets you set a new one. This site trusted a header called X-Forwarded-Host, which is just extra information sent with the request, to decide the domain in that link. By putting their own domain there, the attacker made the email link point to their server, so when the victim clicked it the secret code was sent to the attacker.

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.

More by Skysenz

View all

1 more disclosed report, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Account takeover

The lesson behind this report.

Getting into someone else's account through a flaw in sign-in, password reset, second factor, single sign-on or session handling.