-
Security
Prevent mass assignment on my update endpoints
Stops endpoints from writing whatever fields the client sends, so users can't grant themselves admin or change prices.
Free Prompt
What This Does / How This Helps
Finds the endpoints that write whatever fields the client sends and replaces that with explicit allowlists of editable fields. Mass assignment is the bug where a profile update endpoint happily accepts { "role": "admin" } or { "balance": 1000000 } alongside the name change, because the code dumps the whole request body into the database. The UI never sends those fields, but nothing stops anyone from adding them to the request. The per-endpoint table plus the role-injection test makes the fix provable: send the sneaky payload, confirm it does nothing.
Want to skip doing this by hand?
Fortivibe audits your app for all of the areas these prompts cover (and more).