Exploiting Server-Side Parameter Pollution in Query Strings — An API Hacking Tale
The password reset endpoint passed the username into an internal API query without proper encoding, so an attacker could inject extra parameters. By injecting a field parameter set to reset_token, the attacker could retrieve the administrator's password reset token and take over the account.
Published on infosecwriteups.com
In this BurpSuite lab, I explore and exploit a server-side parameter pollution (SSPP) vulnerability. This classic API abuse scenario demonstrates how improperly parsed query parameters in server-side logic can lead to unauthorized access — in this case, compromising the administrator account and deleting user carlos.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the server-side code concatenated the user-supplied username directly into an internal API query string without encoding, allowing injected parameters to alter the query.
Impact
An attacker could obtain the administrator's password reset token and take over the account, then delete other users.
What the attacker needed
Access to the forgot password form; ability to intercept and modify requests
The fix
The server should properly encode user input before inserting it into internal API queries, or use a safe query builder that separates parameters from values.
How it was found
- Go to the forgot password page and submit the administrator username, intercepting the request.
- Send the request to Repeater and note the JavaScript file that handles the reset token.
- Inject an encoded ampersand to add a dummy parameter and observe the error about unsupported parameter.
- Inject an encoded hash to truncate the query and see the error about missing field.
- Add a field parameter and brute-force its value to find valid internal fields.
- Use the field value reset_token to obtain the administrator's reset token, then reset the password and log in to delete carlos.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
When you type a username into a password reset form, the server often builds a query to look up that user. If it does not properly separate your input from the query's own parameters, you can sneak in extra instructions. Here, adding a special character let the attacker ask the server to return the reset token instead of just checking the username.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.