Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
HTTP Parameter Pollution (HPP) occurs when an application doesn't properly handle multiple parameters with the same name. Different web servers and frameworks handle duplicate parameters differently, which can lead to bypassing input validation, WAF evasion, or logic manipulation.
What to Check
Duplicate parameter handling
Server-side parameter pollution
Client-side parameter pollution
WAF bypass via parameter pollution
Business logic bypass
Parameter precedence
How to Test
Step 1: Test Parameter Handling
#!/bin/bash
TARGET="https://target.com"# Test duplicate parametersecho"[*] Testing duplicate parameter handling..."# Same parameter multiple times in query string
curl -s "$TARGET/search?q=test1&q=test2" | head -20
# Parameter in both query string and body
curl -s -X POST "$TARGET/search?q=query_value" -d "q=body_value" | head -20
# URL encoded duplicates
curl -s "$TARGET/search?q=test1&q=test2&q=test3"# Different encodings
curl -s "$TARGET/search?q=test&%71=polluted"# %71 = q
#!/bin/bash# Test parameter handling by server type
TARGET="https://target.com/page"echo"=== HPP Server Behavior Tests ==="# Test 1: Basic duplicate parametersecho -e "\n[Test 1] Basic duplicate: ?id=1&id=2"
curl -s "$TARGET?id=1&id=2" | grep -oP 'id["\s:=]+\K[^"&\s,<]+' | head -5
# Test 2: URL encoded duplicateecho -e "\n[Test 2] URL encoded: ?id=1&%69%64=2"
curl -s "$TARGET?id=1&%69%64=2" | grep -oP 'id["\s:=]+\K[^"&\s,<]+' | head -5
# Test 3: Array notation (PHP)echo -e "\n[Test 3] Array notation: ?id[]=1&id[]=2"
curl -s "$TARGET?id[]=1&id[]=2" | grep -oP 'id["\s:=]+\K[^"&\s,<]+' | head -5
# Test 4: POST body vs query stringecho -e "\n[Test 4] Query vs Body: ?id=query with POST id=body"
curl -s -X POST "$TARGET?id=query" -d "id=body" | grep -oP 'id["\s:=]+\K[^"&\s,<]+' | head -5
# Test 5: JSON body pollutionecho -e "\n[Test 5] JSON with duplicate keys"
curl -s -X POST "$TARGET" \
-H "Content-Type: application/json" \
-d '{"id":"1","id":"2"}' | head -20
Step 4: HPP Attack Scenarios
# Scenario 1: Vote manipulation# Original: /vote?poll_id=1&choice=A# Attack: /vote?poll_id=1&choice=A&choice=B&choice=C# If server processes all choices, attacker votes multiple times# Scenario 2: Price manipulation# Original: /checkout?item=123&price=100# Attack: /checkout?item=123&price=100&price=1# If server uses last price value, attacker pays less# Scenario 3: Access control bypass# Original: /api/user?id=123&role=user# Attack: /api/user?id=123&role=user&role=admin# If server uses last role value, attacker escalates privileges# Scenario 4: WAF evasion# WAF blocks: <script>alert(1)</script># Attack: /page?input=<script>&input=alert(1)</script># Server concatenates: <script>alert(1)</script> (bypasses WAF)
Tools
Tool
Purpose
Burp Suite
Parameter manipulation
ParamMiner
Parameter discovery
Arjun
Hidden parameter finder
curl
Manual testing
Remediation
# Python/Flask - Handle duplicate parameters explicitlyfrom flask import Flask, request
app = Flask(__name__)
@app.route('/api/action')defhandle_action():
# Get only the first value
param = request.args.get('param') # First value only# Or explicitly handle multiple values
all_values = request.args.getlist('param')
iflen(all_values) > 1:
# Log potential HPP attempt
app.logger.warning(f"Multiple values for param: {all_values}")
# Use only the first or rejectreturn"Invalid request", 400return process_param(param)
<?php// PHP - Explicitly handle parameters// By default, PHP uses the last value// Get all values$values = $_GET;
// Check for array parametersif (is_array($_GET['param'])) {
// Handle array or rejecterror_log("HPP attempt detected");
http_response_code(400);
exit("Invalid request");
}
// Use the expected single value$param = $_GET['param'];
?>