Skip to content

Commit 34da1da

Browse files
authored
Merge pull request #2002 from HackTricks-wiki/research_update_src_pentesting-web_parameter-pollution_20260314_130529
Research Update Enhanced src/pentesting-web/parameter-pollut...
2 parents b44b4fe + f16a680 commit 34da1da

1 file changed

Lines changed: 36 additions & 3 deletions

File tree

src/pentesting-web/parameter-pollution.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
{{#include ../banners/hacktricks-training.md}}
44

55

6+
67
## HTTP Parameter Pollution (HPP) Overview
78

89
HTTP Parameter Pollution (HPP) is a technique where attackers manipulate HTTP parameters to change the behavior of a web application in unintended ways. This manipulation is done by adding, modifying, or duplicating HTTP parameters. The effect of these manipulations is not directly visible to the user but can significantly alter the application's functionality on the server side, with observable impacts on the client side.
@@ -50,6 +51,35 @@ The way web technologies handle duplicate HTTP parameters varies, affecting thei
5051
- **Flask:** Adopts the first parameter value encountered, such as `a=1` in a query string `a=1&a=2`, prioritizing the initial instance over subsequent duplicates.
5152
- **PHP (on Apache HTTP Server):** Contrarily, prioritizes the last parameter value, opting for `a=2` in the given example. This behavior can inadvertently facilitate HPP exploits by honoring the attacker's manipulated parameter over the original.
5253

54+
55+
### HPP Testing Notes (OWASP WSTG)
56+
57+
- HTTP standards do not define how to interpret multiple parameters with the same name, so behavior varies across stacks and components.
58+
- When testing server-side HPP, duplicate each parameter in query strings or bodies and observe whether the application concatenates values, uses first/last, or errors.
59+
- For client-side HPP, inject a URL-encoded `&` into a reflected parameter value (e.g., `%26HPP_TEST`) and look for decoded occurrences such as `&HPP_TEST` or `&HPP_TEST` inside generated links or form actions.
60+
61+
### Server-Side Parameter Pollution (SSPP) in Internal APIs
62+
63+
Some applications embed user input into server-side requests to internal APIs. If that input is not properly encoded, you can inject or override parameters in the internal request. Test any user input, including query parameters, form fields, headers, and URL path parameters.
64+
65+
Common probes:
66+
67+
- Add a new parameter with `%26` (URL-encoded `&`).
68+
- Truncate the downstream query with `%23` (URL-encoded `#`).
69+
- Override an existing parameter by duplicating it.
70+
71+
Example:
72+
73+
```http
74+
GET /userSearch?name=peter%26name=carlos&back=/home
75+
```
76+
77+
Potentially results in a server-side request like:
78+
79+
```http
80+
GET /users/search?name=peter&name=carlos&publicProfile=true
81+
```
82+
5383
## Parameter pollution by technology
5484

5585
There results were taken from [https://medium.com/@0xAwali/http-parameter-pollution-in-2024-32ec1b810f89](https://medium.com/@0xAwali/http-parameter-pollution-in-2024-32ec1b810f89)
@@ -118,6 +148,10 @@ There results were taken from [https://medium.com/@0xAwali/http-parameter-pollut
118148

119149
## JSON Injection
120150

151+
{{#ref}}
152+
json-xml-yaml-hacking.md
153+
{{#endref}}
154+
121155
### Duplicate keys
122156

123157
```ini
@@ -223,8 +257,7 @@ Which might create inconsistences
223257
- [https://medium.com/@0xAwali/http-parameter-pollution-in-2024-32ec1b810f89](https://medium.com/@0xAwali/http-parameter-pollution-in-2024-32ec1b810f89)
224258
- [https://bishopfox.com/blog/json-interoperability-vulnerabilities](https://bishopfox.com/blog/json-interoperability-vulnerabilities)
225259

260+
- [https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/07-Input_Validation_Testing/04-Testing_for_HTTP_Parameter_Pollution](https://owasp.org/www-project-web-security-testing-guide/v42/4-Web_Application_Security_Testing/07-Input_Validation_Testing/04-Testing_for_HTTP_Parameter_Pollution)
261+
- [https://portswigger.net/web-security/api-testing/server-side-parameter-pollution](https://portswigger.net/web-security/api-testing/server-side-parameter-pollution)
226262

227263
{{#include ../banners/hacktricks-training.md}}
228-
229-
230-

0 commit comments

Comments
 (0)