Page cover
githubEdit

smogHTTP Parameter Pollution

When different components of an application stack parse duplicate parameters differently, allowing attackers to send conflicting values that pass validation in one layer but execute in another

User Request → Nginx (PHP validation) → Python/Flask API → Database
triangle-exclamation

How Different Technologies Parse Duplicate Parameters

PHP

Uses last value (B)

Python/Flask

Uses first value (A)

Node.js/Express

Returns array [A, B]

Java/Tomcat

Uses first value (A)

ASP.NET

Concatenates "A,B"

chevron-rightDetectionhashtag
circle-info

Step 1: Identify Multi-Layer Architecture

Check HTTP response headers
curl -I https://target.com

Look for:

  • Multiple Server headers

  • X-Powered-By (indicates different tech)

  • Different error message formats

circle-info

Step 2: Test Parameter Handling

Test with duplicate parameter
curl "https://target.com/api?test=first&test=second" -v
  • Check response body

  • Check behavior differences

  • Check logs

circle-info

Step 3: Map Critical Parameters

?user=
?id=
?role=
?admin=
?price=
?url=
?file=
?email=
chevron-rightExploitation Exampleshashtag
triangle-exclamation
triangle-exclamation
triangle-exclamation
circle-info

Testing Checklist

chevron-rightPreventionhashtag
circle-info

Option 1: Reject Duplicates

circle-info

Option 2: Use Same Parser Everywhere

  • Use consistent parameter handling across stack

  • Either always use first value OR always use last value

circle-info

Option 3: Validate at Every Layer

Last updated