← Home ← Codex ← DEBT ← Engine
Browse by Category
+ added · updated 7d
← Back to glossary

HTTP Parameter Pollution

Security CWE-235 OWASP A3:2021 CVSS 6.5 PHP 5.0+ Intermediate
debt(d5/e3/b3/t7)
d5 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'specialist tool catches it' (d5). The detection_hints.tools list includes semgrep, owasp-zap, and burpsuite — all specialist security tools requiring deliberate configuration and testing. Standard linters and compilers won't surface duplicate parameter handling issues; active security scanning or manual code review is required to detect the misuse.

e3 Effort Remediation debt — work required to fix once spotted

Closest to 'simple parameterised fix' (e3). The quick_fix describes explicitly normalising how $_GET and $_POST values are consumed — always taking the first or last value deliberately. This is a small, localised code change at each parameter access point rather than a single one-liner, but it doesn't require cross-file architectural changes. Common mistakes point to a pattern-level fix (deduplication/normalisation at ingestion) applied within one component.

b3 Burden Structural debt — long-term weight of choosing wrong

Closest to 'localised tax' (b3). The applies_to scope is web and API contexts, which is fairly broad, but the actual debt is localised — it manifests at input handling boundaries rather than spreading across the entire codebase. Teams need to be aware of parameter parsing conventions, but the remediation doesn't impose a persistent productivity tax on unrelated work streams.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap — contradicts how a similar concept works elsewhere' (t7). The misconception field explicitly captures this: developers assume duplicate parameters are either ignored or follow a universal 'last wins' rule, but behaviour is inconsistent across runtimes and components (PHP uses last, some WAFs check first). This contradiction between how the WAF and the application parse the same URL is a documented cross-system gotcha that directly enables security bypass — a competent developer would confidently guess wrong about the parsing behaviour.

About DEBT scoring →

Also Known As

HPP parameter pollution duplicate parameters

TL;DR

Submitting duplicate HTTP parameters exploits inconsistencies in how servers and applications parse repeated keys.

Explanation

HTTP Parameter Pollution (HPP) sends the same parameter multiple times in a request (?id=1&id=2). Different frameworks handle this differently — PHP uses the last value, others use the first, some concatenate. Attackers exploit these inconsistencies to bypass WAF rules, override security parameters, or manipulate application logic that processes parameters differently at different layers. Prevention: explicitly choose which occurrence of a duplicated parameter to use and document that choice.

Common Misconception

Duplicate query parameters are simply ignored or the last one wins. Behaviour varies — PHP uses the last value, some WAFs check only the first, creating a gap where a malicious second value bypasses the WAF but reaches the application.

Why It Matters

Sending duplicate query parameters can confuse application logic when different components parse the same URL differently, bypassing validation or security checks.

Common Mistakes

  • Assuming $_GET['param'] is always a single value — PHP treats param[]=a&param[]=b as an array.
  • Security filters that inspect one instance while the application processes another.
  • Constructing URLs from user input and not normalising duplicate parameters before passing to downstream services.
  • WAF rules that check the first occurrence of a parameter while the backend processes the last.

Code Examples

✗ Vulnerable
// PHP uses last value for duplicate params
// ?role=user&role=admin → $_GET['role'] = 'admin'
$role = $_GET['role']; // silently picks 'admin'
✓ Fixed
// Validate after parsing — don't assume only one value arrived
$role = $_GET['role'] ?? 'user';
if (!in_array($role, ['user', 'editor'], true)) {
    $role = 'user'; // safe default
}

// Awareness: different frameworks handle duplicate params differently
// PHP: last value wins  |  Flask: first value wins  |  ASP.NET: comma-joins
// Always validate the result, regardless of framework

Added 15 Mar 2026
Edited 22 Mar 2026
Views 136
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings W 0 pings T 0 pings F 1 ping S 0 pings S 2 pings M 0 pings T 0 pings W 0 pings T 0 pings F 0 pings S 1 ping S 0 pings M 1 ping T 0 pings W 0 pings T 1 ping F 1 ping S 0 pings S 1 ping M 0 pings T 1 ping W 0 pings T 0 pings F 0 pings S 1 ping S 0 pings M 0 pings T 0 pings W 0 pings T
No pings yet today
No pings yesterday
ChatGPT 38 Amazonbot 11 Ahrefs 8 Google 6 Bing 6 Scrapy 6 SEMrush 4 Meta AI 3 Perplexity 2 Brave Search 2 Applebot 2 Majestic 1 Twitter/X 1 Unknown AI 1
crawler 84 crawler_json 7
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Low
⚡ Quick Fix
Treat $_GET and $_POST as arrays that may contain multiple values per key; always take the first or last value explicitly, never assume single value
📦 Applies To
PHP 5.0+ web api
🔗 Prerequisites
🔍 Detection Hints
Query parameters passed to backend APIs without deduplication; WAF bypass via duplicate parameter values
Auto-detectable: ✓ Yes semgrep owasp-zap burpsuite
⚠ Related Problems
🤖 AI Agent
Confidence: High False Positives: Medium ✗ Manual fix Fix: Medium Context: Function Tests: Update
CWE-235 CWE-20


✓ schema.org compliant