Don't Get Owned 101
Authentication, authorisation, validation, secrets, backups.
authentication
Who are you?
A door with a lock. The key either fits or it doesn't. Failure looks like 401.
authorization
What are you allowed to do?
You're inside the building. Which rooms open for your badge? Failure looks like 403.
AUTHENTICATION
Who are you?
the mistake people make
Trusting a user id sent from the browser instead of reading it from the verified session.
An endpoint returns 403 for a signed-in user. What kind of problem is it?
don't get owned 101
If a rule only exists in your interface, it does not exist.
Hiding a button, disabling an input and skipping a page in the router are all UX. Anyone can send the request anyway. Every rule that matters is enforced on the server or in the database.