Course contentsShow
← Security
Lesson 933 of 3,05219. Web Security - Business Logic VulnerabilitiesFree lesson

Server-Side vs Client-Side HPP

Differences between server-side parameter pollution and client-side HPP in URLs and injection contexts.

Server-Side vs Client-Side HPP

What you'll learn: You'll understand where HTTP Parameter Pollution attacks execute and how server-side and client-side HPP differ in exploitation and impact.

The Core Distinction

HTTP Parameter Pollution (HPP) attacks can occur in two different contexts depending on where the polluted parameters are processed:

Server-Side HPP happens when duplicate parameters affect how the backend server processes requests. The attack manipulates server logic, database queries, or business rules by exploiting how the server handles multiple parameters with the same name.

Client-Side HPP occurs when polluted parameters are reflected in URLs or embedded in the client's browser, affecting JavaScript execution, client-side routing, or subsequent requests the browser makes.

Server-Side HPP Example

When you submit ?role=user&role=admin, the server might:

  • Use the last value (admin) in authorization checks
  • Concatenate both values in a database query
  • Use the first value in logging but the second in processing

This affects backend behavior like access control, data retrieval, or payment processing.

Client-Side HPP Example

The server reflects your input into a URL or JavaScript:

<a href="/profile?user=victim&user=attacker">View Profile</a>

The client-side code or browser might:

  • Parse only the second parameter, redirecting to the wrong profile
  • Execute JavaScript differently based on which value it reads
  • Send unintended parameters in AJAX requests

The Key Difference

Think of it like pollution entering a water system: server-side HPP pollutes the water at the treatment plant (backend), affecting everyone downstream. Client-side HPP pollutes the tap in your home (browser), affecting only what happens in that specific location.

Key Takeaway: Server-side HPP exploits backend parameter handling to manipulate server logic, while client-side HPP exploits reflected parameters to manipulate browser behavior and client-side code execution.