Lab 13: HTTP Parameter Pollution & Mass Assignment

Objective

Exploit two related server-side input handling flaws from Kali Linux:

  1. HTTP Parameter Pollution (HPP) — send duplicate query parameters (role=user&role=admin) and observe which value the server uses

  2. Mass Assignment — POST a JSON body with extra fields (role, is_admin) that the server binds to the user model without filtering

  3. Price tampering — inject price=0.01 into a purchase request to bypass server-side validation

  4. Array injection — send price[]=0&price[]=999 to confuse type-checking logic


Background

Mass assignment vulnerabilities occur when a framework automatically maps request parameters to model fields without an explicit allowlist. HPP exploits ambiguity in how servers handle multiple values for the same parameter.

Real-world examples:

  • 2012 GitHub mass assignment — Egor Homakov used Rails mass assignment to add his SSH key to the Rails organisation repository by POSTing public_key[user_id]=4223 (the Rails org owner's ID). Account takeover of the entire Rails project in one request.

  • 2019 HackerOne report (redacted) — a fintech API bound all JSON fields to the user model; sending {"balance": 99999} in a profile update request credited the attacker's account.

  • 2021 multiple Node.js + Mongoose apps — Mongoose findOneAndUpdate with spread operator: User.findOneAndUpdate(id, {...req.body}) — any field in req.body gets written to the database.

  • HPP in WAFs — ModSecurity and Cloudflare handle duplicate parameters differently from the backend; HPP can bypass WAF rules targeting the first occurrence of a parameter.

OWASP: A04:2021 Insecure Design, A01:2021 Broken Access Control


Architecture

Time

35 minutes


Lab Instructions

Step 1: Setup


Step 2: Launch Kali + HPP Analysis


Step 3: Mass Assignment — Role Escalation via Register

📸 Verified Output:


Step 4: Mass Assignment — Privilege Escalation via Update


Step 5: Price Tampering in Purchase

📸 Verified Output:


Steps 6–8: Remediation + Cleanup


Further Reading

Last updated