Case 73E2C7 · Web AppSec · L2 Practitioner
Mass Assignment
- 01 What is it?
- 02 How is it abused?
- 03 How do you stop it?
What a strong answer covers
Try it out loud first. Then check yourself:
- Frameworks bind request JSON straight onto model objects, so extra fields the UI never shows still get saved
- Abuse: add "role":"admin", "isVerified":true or "balance" to a profile update; read API docs or responses to find field names
- OWASP API Top 10 2023 groups it with excessive data exposure as API3, Broken Object Property Level Authorization
- Fix: explicit allowlists of writable fields per endpoint (DTOs, Rails strong parameters), never bind the raw entity
- Test by replaying requests with fields seen in GET responses; add schema validation that rejects unknown properties
If the interviewer pushes back
- Why is a denylist of sensitive fields weaker than an allowlist as the model evolves?