#0201
Your API exposes a user-update endpoint. The handler blindly merges the incoming JSON body onto the stored user object. A regular user discovers they can include a 'role' field and instantly become an admin.
Mass-assignment vulnerabilities arise when request data is applied to a model without an explicit allowlist. Any field the model contains — including privileged ones — becomes writable.
Mass assignment is one of the fastest privilege escalation paths. A single missing allowlist lets any authenticated user rewrite their own role, verified status, or any other sensitive attribute.
updateUser('alice', 'alice', { role: 'admin' }, db)// returns user with role still 'user'
updateUser('alice', 'alice', { name: 'Alice B.' }, db)// returns user with updated name