🏠 Home
Write-up by wook413

Lab: Password reset poisoning via middleware

This lab is vulnerable to password reset poisoning. The user carlos will carelessly click on any links in emails that he receives. To solve the lab, log in to Carlos's account. You can log in to your own account using the following credentials: wiener:peter. Any emails sent to this account can be read via the email client on the exploit server.


I went straight to the login page and clicked the "Forgot password?" button, since the lab specifies it is vulnerable to password reset poisoning.

image-20260719100355165

I was prompted to enter a username or email, so I entered wiener.

image-20260719100407546

I navigated to the Email Client to see if I'd received any email for the password reset.

image-20260719100502089

There was an email from the server containing an external link. The URL also contained a temp-forgot-password-token.

image-20260719100516632

When I clicked the link, I was taken to a page where I could type in a new password.

image-20260719100544937

I pulled up the last POST request I made to /forgot-password and confirmed that the temporary password token is what verifies the user.

image-20260719101816512

I grabbed the URL from the exploit server.

image-20260719102148800

I added an X-Forwarded-Host header, and sent the request to see if X-Forwarded-Host is supported. If so, I could use it to point the dynamically generated reset link to my own server.

image-20260719102136369

I went back to my email client and received another email. Notice that the URL of the external link is now different. It reflects the X-Forwarded-Host header.

image-20260719102229237

Now I went back to the same POST request, changed the username to carlos, and made the request.image-20260719102402015

I checked the Access Log to see if there was any request from carlos. I noticed one request originating from a different IP address, a GET request to /forgot-password, meaning he must have clicked the password reset link I generated. Notice that this URL also contains the temp-forgot-password-token we need to perform the poisoning.

image-20260719102507691

/forgot-password?temp-forgot-password-token=8eia3aprtfvbwehspy2iet3rx50boj1d

I pulled up the POST request made to /forgot-password, replaced the temp-forgot-password-token value with carlos's token, and changed his password to carlos. The server returned a 302, and following the redirect returned a 200 OK, so there was no error.

image-20260719102927204

I attempted to authenticate as carlos:carlos.

image-20260719103001303

I successfully logged in as carlos!

Solved!

image-20260719103021502