Authorization disclaimer. This walkthrough is limited to the intentionally vulnerable PortSwigger Web Security Academy lab linked below. Test only systems you own or are explicitly authorized to assess.
Overview
The public password-reset workflow forwards attacker-controlled data to an internal API query string. Delimiters in the supplied value alter the backend parameter set.

Lab objective/setup
Use POST /forgot-password to determine how the supplied username is inserted into an internal query string. The backend normally returns the requested user’s masked email; the goal is to replace the appended field=email parameter with field=reset_token.
What I observed
The normal request for administrator returns a masked email. An unknown username returns Invalid username; injecting %26x=y returns Parameter is not supported, proving that decoded & creates a backend parameter. Adding %26field=x%23 changes the error to Invalid field, showing that %23 truncates the gateway’s original suffix.




Why it is vulnerable
The front end and internal API disagree about where one parameter ends and another begins, so server-side parameter pollution changes the backend request.
Walkthrough in the authorized PortSwigger lab
- Send
username=administrator%26x=y; the backend reports an unsupported parameter. - Send
username=administrator%26field=x%23; the backend reports an invalid field, confirming control offieldand truncation of the appended query string. - Fuzz the field name and identify
reset_tokenas a valid response type. - Submit
username=administrator%26field=reset_token%23and copy the returned token. - Follow the client-script reset URL, set an administrator password, sign in, and delete
carlos.
1 | username=administrator |
1 | username=administrator%26x=y |







Verification
After the administrator password reset and deletion of carlos, the Academy changes the lab state to solved.

Impact and defensive lesson
Encode user-controlled values before inserting them into backend query strings, construct requests with parameter APIs rather than concatenation, reject duplicate or unexpected parameters, and never expose password-reset tokens through a generic user-field lookup.