Interview practice question
User made themselves an admin
Backend Engineering · Auth and Security · Intermediate
A user sent an extra field "role": "admin" in their profile update request, and it worked. How did this happen and how do you prevent it?
What a strong answer covers
Your AI report card counts how many of these ideas you cover.
- Mass assignment vulnerability.
- Request body bound directly to model.
- Use explicit DTO/allowlist of editable fields.
- Ignore or reject unknown fields.
- Separate admin-only endpoints.
Practise this topic
Start without signing up. Sign in free to get an AI report card on your answer.