1 HPP Mechanics
HTTP Parameter Pollution (HPP) occurs when an attacker sends multiple values for the same parameter. Different web frameworks parse these duplicates differently, enabling logic bypass.
Parsing differences:
Request: GET /transfer?amount=100&amount=99999
Flask (Python): request.args.get("amount") → "100" (first)
Django: request.GET["amount"] → "99999" (last)
PHP: $_GET["amount"] → "99999" (last)
Express (Node): req.query.amount → ["100","99999"] (array)Attack scenario (WAF bypass):
GET /search?q=normal&q=<script>alert(1)</script>A WAF may check only the first parameter value and find it clean, while the backend uses the last value containing the XSS payload.
HPP is also used in OAuth attacks by duplicating the redirect_uri parameter when servers parse differently from each other.