July 29, 2026
Solving PortSwigger Lab: Password Brute-Force via Password Change
Welcome to this step-by-step walkthrough for the “Password brute-force via password change” lab from PortSwigger’s Web Security Academy. In…
By Ayeshaaghafoor
3 min read
Welcome to this step-by-step walkthrough for the "Password brute-force via password change" lab from PortSwigger's Web Security Academy. In authentication security, brute-force defenses often focus heavily on primary endpoints such as /login. However, auxiliary features—such as user registration, password resets, and password update forms—frequently expose identical authentication logic without the same rate-limiting or lockout mechanisms.
Note: This article was written with the assistance of AI tools.
1. Vulnerability Analysis & Core Logic
The Flaw
When a web application allows logged-in users to change their password, it usually requires entering the current password as a security measure to prevent unauthorized changes via CSRF or open sessions.
The security vulnerability in this lab stems from two key implementation flaws:
- Broken Access Control in Password Reset Logic: The password change request explicitly includes a hidden or editable
usernameparameter (username=wiener). If the backend processes password changes for whichever username is supplied in the request body without checking if it matches the active session cookie, an attacker can attempt to change any arbitrary user's password (e.g., targetcarlos). - Differential Response Oracle: When validating password change attempts, the application checks conditions sequentially:
- Condition A: Is the supplied
current-passwordcorrect for the specifiedusername? If incorrect, it returns: <p class="is-warning">Current password is incorrect</p>- Condition B: Do
new-password-1andnew-password-2match? If the current password is correct, but the new passwords intentionally do not match, it returns: <p class="is-warning">New passwords do not match</p>
By intentionally providing mismatching new passwords, we turn the password-change endpoint into a boolean oracle. We can brute-force the target user's current password without actually changing their password or triggering standard lockouts.
2. Reconnaissance & Baseline Probing
Log into the application using the provided credentials (wiener:peter) and navigate to the My Account page. Perform a standard password change request while intercepting traffic using Burp Suite.
Test 1: Supplying an Invalid Current Password
Send the captured POST request to Burp Repeater. Modify current-password to an invalid value (peter).
Test 2: Supplying the Valid Current Password with Mismatched New Passwords
Next, supply the valid current password (peter), but set new-password-1=vq and new-password-2=va.
This differential response confirms our logic:
- Response includes "Current password is incorrect" →Password candidate is FALSE.
- Response includes "New passwords do not match" → Password candidate is TRUE.
3. Configuring Burp Intruder Brute-Force Attack
Now, we pivot our target from wiener to carlos.
- Send the password change POST request to Burp Intruder.
- Set the
usernameparameter tocarlos. - Set intentionally mismatching values for the new password fields (e.g.,
new-password-1=vandnew-password-2=vs). - Place a single payload position marker on the
current-passwordparameter: - HTTP
POST /my-account/change-password HTTP/2
Host: 0a2e00f803a432e4804399420089007e.web-security-academy.net
Cookie: session=...
...
username=carlos¤t-password=§peter§&new-password-1=v&new-password-2=vsPOST /my-account/change-password HTTP/2
Host: 0a2e00f803a432e4804399420089007e.web-security-academy.net
Cookie: session=...
...
username=carlos¤t-password=§peter§&new-password-1=v&new-password-2=vs- In the Settings tab under Grep — Match, add a match rule for
New passwords do not match.
- Under the Payloads tab, paste the list of candidate passwords provided by the lab.
- Click Start attack.
4. Execution & Exploit Verification
Monitor the Intruder attack results. Look for the request that flags a match under your Grep — Match column or displays a distinct response length.
As observed in the results:
- Payload
yankeesevaluated toTRUEfor theNew passwords do not matchrule. - This identifies
yankeesas the valid current password for usercarlos.
With Carlos's password confirmed, log out of wiener and log in as carlos using password yankees.
5. Remediation Guidelines
To protect application endpoints against password-change brute-forcing and session manipulation:
- Enforce Strict Session Ownership: Never rely on user-supplied parameters (like
username=...) to determine whose account is being modified. Always derive the identity of the account being updated directly from the authenticated server-side session context. - Apply Uniform Rate-Limiting: Enforce strict rate-limiting and account lockout policies across all sensitive operations, including login, password reset, and password change endpoints.
- Prevent Response Oracles: Validate all inputs holistically or handle errors consistently so that invalid field states do not disclose sensitive validation order details to potential attackers.