HTTP Parameter Pollution
The application handles a parameter supplied more than once inconsistently, so one component can validate one value while another acts on a different one.
| Severity | Low |
| CVSS 3.1 | 3.7 CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N Open in the calculator |
| CVSS 4.0 | 6.3 CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N Open in the calculator |
| CWE | CWE-235: Improper Handling of Extra Parameters |
| OWASP Top 10 | A10:2025 Mishandling of Exceptional Conditions |
| Category | Input Validation |
Description
HTTP does not define what should happen when the same parameter name appears more than once in a query string or request body, and platforms differ: PHP keeps the last occurrence, the getParameter() method of Java servlets returns the first, classic ASP.NET joins the values with commas, and Node.js frameworks such as Express typically return an array. HTTP parameter pollution (HPP) exploits these differences.
The weakness arises when two components see different values for the same request. A web application firewall or validation layer may check one occurrence while the code that acts on the request uses another, so an attacker may be able to bypass input validation or a firewall rule. Where the application inserts a user-supplied value into a request it makes to an internal service or API (server-side parameter pollution), an extra &name=value pair, sometimes URL-encoded as %26, can add or override a parameter in that request, including a value that the application sets itself, such as an account identifier, role or price. Client-side variants occur where a value is reflected into links or form actions without encoding, so an injected parameter is carried into the user's next request, which lets an attacker alter links and forms presented to other users.
The issue is identified by repeating parameters, injecting encoded separators into parameter values and observing which value each part of the application acts on. Exploitation requires knowledge of how each component handles duplicate parameters, and in most cases the effect is limited to changing the behaviour of a single function. The impact depends entirely on what the overridden parameter controls: where that is authorisation or a financial value, the issue should be rated on that effect.
Remediation
- Define how each endpoint treats repeated parameters and enforce it: reject requests that contain a duplicate of a parameter that should appear once, rather than silently picking one occurrence.
- Make sure validation and use read the same occurrence through the same framework call, and that any front-end filter, web application firewall and back end agree on the behaviour.
- When building requests to other services, never concatenate user input into a query string or body. Use the HTTP client's parameter encoding or a URL builder, so that characters such as
&,=and#in a value are encoded, and set server-controlled parameters independently of user input. - Encode user-supplied values when reflecting them into URLs, links and form actions.
- In Node.js, where parameters can arrive as arrays, check the type of each value before use; middleware such as
hppcan enforce a single value.
Confirm the fix by repeating the original tests with duplicated and encoded parameters and checking that the request is rejected or handled consistently.
References
Add This Finding to Your Library
In Pental this write-up is in Settings, Library. Add to my library copies it into your own, rated in your firm's CVSS version, ready to put in your own words.
Free trialYour trial starts when your portal goes live, not when you sign up, so the time you spend setting up does not count. · No card required
Only need the reporting? Our reporting tool is free and open source, with the same library.