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

Testing for Mass Assignment and HPP

Techniques to identify vulnerable parameters, test binding behavior, and verify parameter pollution handling.

Testing for Mass Assignment and HPP

You'll learn practical techniques to discover mass assignment weaknesses and parameter pollution vulnerabilities before attackers do.

The Testing Mindset

Testing for mass assignment and HTTP Parameter Pollution (HPP) requires thinking like an attacker who manipulates form submissions and API requests. Your goal is to identify parameters the application shouldn't accept but does, and observe how duplicate parameters behave.

Testing for Mass Assignment Vulnerabilities

Start by identifying all object properties. Review documentation, inspect responses, or examine client-side code to map out object attributes (especially privileged ones like isAdmin, role, accountBalance).

Add unexpected parameters to legitimate requests:

  • Submit isAdmin=true or role=admin alongside normal fields
  • Inject hidden attributes discovered in API schemas or error messages
  • Test both standard forms and JSON/XML API endpoints

Observe binding behavior: Watch if these injected parameters persist when you retrieve the resource. If your test parameter appears in the response or affects behavior, you've found mass assignment.

Testing for HTTP Parameter Pollution

Send duplicate parameters with different values:

username=user&role=customer&role=admin

Test multiple pollution patterns:

  • Same parameter name repeated in query strings
  • Mixed placement (URL parameters vs POST body)
  • Array notation variations (role[]=customer&role[]=admin)

Check server-side vs client-side handling: Does the server prioritize the first value? Last value? Concatenate them? Different frameworks behave differently, creating exploitable inconsistencies.

Verification Techniques

Use proxy tools to intercept and modify requests systematically. Test with different user roles to see if restrictions apply inconsistently. Monitor application logs for binding errors or warnings that reveal internal parameter handling.

Key Takeaway: Effective mass assignment and HPP testing requires systematically probing parameter handling by adding unexpected fields, duplicating parameters, and carefully observing how the application responds—any unexpected binding or value prioritization signals a vulnerability.