#BugBounty - Compromising User Account- “How I was able to compromise user account via HTTP Parameter Pollution(HPP)”
The password reset function was vulnerable to HTTP parameter pollution: supplying two email parameters caused the reset link to be generated for the victim's address but sent to the attacker's address. An attacker could therefore take over any user account by obtaining the reset link and setting a new password.
Published on medium.com
#### Avinash Jain (@logicbomb1)
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.
Context
The target was an Indian online shopping site. Like most shopping apps, it had a feature to share shortlisted shopping items on social media sites, which the author calls the social sharing button. The same application also had a login authentication page with a reset password functionality. The author found an HPP issue in the sharing feature and then escalated it to a full user account compromise through the password reset flow.
HPP, as the author describes it, pollutes the HTTP parameters of a web application to perform a task different from the intended behaviour. Supplying multiple HTTP parameters with the same name may cause an application to interpret values in unanticipated ways.
Setup
No accounts, roles or special tooling beyond a browser extension are described. The author used Wappalyzer to analyse the backend application framework, which showed that JSP and Apache were in use. The victim's mail id used in the reset flow was [redacted], and the attacker's mail id used in the tampered request was [redacted]. The author also read HackerOne reports and an Acunetix whitepaper on how different applications handle HPP before testing.
Finding it
The author first looked at the social sharing functionality. The redacted HTTP request for sharing a shortlisted item looked like this:
Adding a u parameter pointing to an attacker-controlled site produced a simple HPP vulnerability:
Sharing that link on Facebook changed the content to:
https://www.facebook.com/sharer.php?u=https://www.redacted.com/zephyr-mini-alpha board/p/?u-http://www.evil.com&pid=ETYDBYSKDDZQGDJD&vi=XXXX
Instead of sharing the shortlisted item, evil.com was shared on the victim's Facebook page. The author reasoned that HPP occurs because of the way different web servers and development frameworks handle multiple parameters, so it is a backend application technology issue. If it occurred on the social sharing button, it could be present elsewhere in the application.
Exploitation
Step 1: Locate the password reset functionality
In the search to exploit the issue further, the author went to the login authentication page, which had a reset password functionality.

Reset Password Page
Step 2: Identify the backend framework
Before testing, the author analysed the backend application framework with Wappalyzer, which showed that JSP and Apache were in use. This mattered because the author wanted to know how that framework handles parameter pollution, using the Acunetix whitepaper as a reference.
Step 3: Trigger a normal reset request
Providing the victim's mail id and submitting it triggered the following HTTP request:

Reset Password HTTP Request
According to the functionality, it generated the reset password link taking the value as [redacted] and sent it to the same mail id.
Step 4: Supply multiple email parameters
The author checked whether supplying multiple email parameters causes the backend application framework to work differently. The attacker's email id was added and the tampered request looked like this:
Tampered HPP Reset Password Request
As expected, the backend application (JSP in this case) took the value of the first email parameter to generate the password reset link and used the value supplied in the second email value to trigger the send mail to [redacted]. Because of this, the attacker received the link to reset the password of the victim's account.
Step 5: Take over the account
The author opened the link, set the password for the victim account and was able to log in to the same account, finally taking over the account.

Root cause
The backend application framework handled multiple parameters with the same name inconsistently: it used the first email value to generate the reset link but the second email value to decide where to send the mail. The author attributes this to how JSP and Apache handle parameter pollution, and notes that HPP is a backend application technology issue. The report does not describe any defence that was in place or why it failed to stop the attack.
Impact
An attacker could compromise any user account by causing the password reset link to be delivered to an attacker-controlled mailbox and then setting a new password. The author states this allowed compromising any user account via HTTP Parameter Pollution.
Fix
The report does not describe any fix or remediation.
Variants to test
- Test other features that send email or generate links from a user-supplied parameter, such as invitations, notifications or account verification. A positive result is a request with two parameters of the same name where the generated link uses one value and the delivery address uses the other.
- Test the same duplicate-parameter pattern on other endpoints of the same application, since the author reasoned that a framework-level HPP issue can appear in other parts of the application. A positive result is any endpoint where the framework picks different occurrences of the same parameter for different purposes.
- Test the social sharing feature with an added
uparameter pointing to an attacker-controlled domain. A positive result is the attacker's domain being shared instead of the intended item.
What happened, in plain words
A security researcher found a bug in an Indian online shopping website. The bug let him take over any user's account. He did not need the user's password.
The trick was to send the website a form with the same field filled in twice. The website used the first copy of the field to build a password reset link, but used the second copy to decide where to send that link. So the researcher asked the site to reset the victim's password, and the site dutifully emailed the reset link to the researcher's own mailbox instead of the victim's. He clicked the link, chose a new password, and logged in as the victim.
This kind of bug is called HTTP Parameter Pollution, or HPP for short. This article walks through the whole story from the beginning, explaining every term as it comes up, so you can follow it even if you have never done security testing before.
Background: what the website did
The target was an Indian online shopping site. Like most shopping apps, it let users shortlist items they liked and then share those items on social media sites. The author calls this the social sharing button. The same site also had a login page with a reset password functionality, which is the usual "forgot my password" link you see on almost every website.
The author found a bug in the sharing feature and pushed it further, all the way to taking over a user account, by abusing the password reset flow.
What HTTP parameters are
When you fill in a form on a website and press submit, your browser sends the values to the server. Each value travels with a name, and the pair is called a parameter. If a form has a field called email, the browser sends something like email=[redacted]. The server reads the name, finds the value, and acts on it. Think of parameters as labelled boxes on a delivery form: the label says what the box contains, and the server opens the box with the matching label.
What HTTP Parameter Pollution means
HPP, as the author describes it, pollutes the HTTP parameters of a web application to perform a task different from the intended behaviour. Supplying multiple HTTP parameters with the same name may cause an application to interpret values in unanticipated ways.
A simple comparison: imagine a form that asks for your delivery address, and you write two different addresses in the same box. A careful postal worker might use the first one, a careless one might use the last one, and a confused one might combine both into nonsense. The form only expected one answer, so nobody defined what should happen when there are two. That ambiguity is the whole bug class. Different web servers and programming frameworks resolve it differently, and an attacker who knows which one is in use can sometimes predict which copy will win.
What a backend framework is
A website is not one program. The part you see in your browser is the front end. The part that runs on the company's servers, handles requests, talks to databases and builds pages is the back end. A backend framework is a ready-made set of tools and conventions that developers use to build that back end, so they do not have to write everything from scratch. Two common ones are Apache, a web server, and JSP, short for JavaServer Pages, a Java-based technology for building web pages. The author mentions both because the way a framework handles duplicate parameters is exactly what decides whether HPP is exploitable.
Setup
No accounts, roles or special tooling beyond a browser extension are described. The author used Wappalyzer, a browser extension that inspects a website and guesses which technologies it is built with, to analyse the backend application framework. It showed that JSP and Apache were in use.
The victim's mail id used in the reset flow was [redacted], and the attacker's mail id used in the tampered request was [redacted]. The author also read HackerOne reports and an Acunetix whitepaper on how different applications handle HPP before testing. Reading up first is a sensible habit: it tells you what to look for and what results other people have seen.
Finding it
The author first looked at the social sharing functionality. The redacted HTTP request for sharing a shortlisted item looked like this:
Line by line:
https://www.redacted.comis the site's address.redacted.comstands in for the real domain, which the author removed before publishing./zephyr-mini-alpha board/p/is the path to the page, the part that tells the server which feature you are using. The space in the middle is how it appears in the report.?marks the start of the parameters.pid=ETYDBYSKDDZQGDJDis one parameter, a product or board identifier.&separates one parameter from the next.vi=XXXXis a second parameter, with its value hidden.
Adding a u parameter pointing to an attacker-controlled site produced a simple HPP vulnerability:
Line by line:
- Everything is the same as before, except a new parameter has been inserted at the front:
u=http://www.evil.com. uis presumably the address the page should point to or share.evil.comis a domain the attacker controls, used here as a stand-in for any site the attacker wants to promote.- The original
pidandviparameters are still there, so the page still looks like a normal share request.
Sharing that link on Facebook changed the content to:
https://www.facebook.com/sharer.php?u=https://www.redacted.com/zephyr-mini-alpha board/p/?u-http://www.evil.com&pid=ETYDBYSKDDZQGDJD&vi=XXXX
Line by line:
https://www.facebook.com/sharer.phpis Facebook's sharing endpoint, the address Facebook uses when a site asks it to share a link.u=is Facebook's own parameter for the address to share. Its value is the whole shopping-site link from the previous step.- Inside that value, the shopping site's own
uparameter appears again, now written with a hyphen (u-http://www.evil.com) as it appears in the report.
Instead of sharing the shortlisted item, evil.com was shared on the victim's Facebook page. The author reasoned that HPP occurs because of the way different web servers and development frameworks handle multiple parameters, so it is a backend application technology issue. If it occurred on the social sharing button, it could be present elsewhere in the application. That reasoning is the important move: a bug in one feature is a clue that the same underlying weakness may affect other features built on the same framework.
Exploitation
Step 1: Locate the password reset functionality
In the search to exploit the issue further, the author went to the login authentication page, which had a reset password functionality. A password reset is a high-value target because it is the feature that lets someone who has lost their password get back into an account. If you can bend it, you can often get into an account you do not own.

The screenshot shows the reset password page: the form where a user types the email address tied to their account and asks the site to send them a reset link.
Step 2: Identify the backend framework
Before testing, the author analysed the backend application framework with Wappalyzer, which showed that JSP and Apache were in use. This mattered because the author wanted to know how that framework handles parameter pollution, using the Acunetix whitepaper as a reference. Knowing the framework is like knowing the make of a lock before you try keys: it narrows down which behaviours are likely.
Step 3: Trigger a normal reset request
Providing the victim's mail id and submitting it triggered the following HTTP request:

The screenshot shows the reset password HTTP request as it is sent when the form is submitted normally.
According to the functionality, it generated the reset password link taking the value as [redacted] and sent it to the same mail id. In other words, the site did what it was supposed to do: it built a link for the account belonging to that address and emailed the link to that same address. Nothing is wrong yet. This step is the baseline, the normal behaviour you compare everything else against.
Step 4: Supply multiple email parameters
The author checked whether supplying multiple email parameters causes the backend application framework to work differently. The attacker's email id was added and the tampered request looked like this:
The screenshot shows the tampered request, with the attacker's email address added alongside the victim's.
As expected, the backend application (JSP in this case) took the value of the first email parameter to generate the password reset link and used the value supplied in the second email value to trigger the send mail to [redacted]. Because of this, the attacker received the link to reset the password of the victim's account.
This is the heart of the bug. The site treated the two copies of the same field as if they were two different pieces of information. One copy decided whose password would be reset, and the other decided where the message would go. Neither decision was wrong on its own, but together they let the attacker ask for a reset of someone else's account and receive the result in his own inbox.
Step 5: Take over the account
The author opened the link, set the password for the victim account and was able to log in to the same account, finally taking over the account. Account takeover means exactly what it sounds like: the attacker now controls the account, can read whatever the real owner could read, and can change things as the real owner. The victim, meanwhile, has had their password changed without being asked.

The final screenshot shows the result: the author logged in to the victim's account after setting a new password through the reset link.
Root cause
The backend application framework handled multiple parameters with the same name inconsistently: it used the first email value to generate the reset link but the second email value to decide where to send the mail. The author attributes this to how JSP and Apache handle parameter pollution, and notes that HPP is a backend application technology issue. The report does not describe any defence that was in place or why it failed to stop the attack.
Impact
An attacker could compromise any user account by causing the password reset link to be delivered to an attacker-controlled mailbox and then setting a new password. The author states this allowed compromising any user account via HTTP Parameter Pollution.
Fix
The report does not describe any fix or remediation.
Variants to test
- Test other features that send email or generate links from a user-supplied parameter, such as invitations, notifications or account verification. A positive result is a request with two parameters of the same name where the generated link uses one value and the delivery address uses the other.
- Test the same duplicate-parameter pattern on other endpoints of the same application, since the author reasoned that a framework-level HPP issue can appear in other parts of the application. A positive result is any endpoint where the framework picks different occurrences of the same parameter for different purposes.
- Test the social sharing feature with an added
uparameter pointing to an attacker-controlled domain. A positive result is the attacker's domain being shared instead of the intended item.
Glossary
- Account takeover: a situation where an attacker gains control of another person's account, usually by obtaining or resetting their password.
- Apache: a widely used web server program that receives requests from browsers and passes them to the application.
- Backend: the part of a website that runs on the company's servers, as opposed to the part you see in your browser.
- Backend framework: a ready-made set of tools and conventions developers use to build the server side of a website.
- Browser extension: a small add-on you install in your browser to give it extra features.
- Endpoint: a specific address on a server that performs a specific action, such as a login or a password reset.
- Front end: the part of a website you see and interact with in your browser.
- HackerOne: a platform where security researchers report bugs to companies and sometimes receive rewards.
- HPP (HTTP Parameter Pollution): a bug where sending the same parameter more than once makes an application behave in an unintended way.
- HTTP request: the message your browser sends to a server to ask for a page or submit data.
- JSP (JavaServer Pages): a Java-based technology for building web pages on the server.
- Parameter: a named value sent with a request, such as
email=[redacted]. - Password reset flow: the sequence of steps a site uses to let a user who forgot their password set a new one, usually by emailing a special link.
- Payload: the crafted part of a request that carries the attack, such as the extra parameter.
- Redacted: with sensitive details removed, such as real domain names or identifiers, before publishing.
- Social sharing button: a feature that lets a user post a link to an item on a social media site.
- Wappalyzer: a browser extension that inspects a website and identifies the technologies it is built with.
- Whitepaper: a written technical document explaining a topic in depth.