Not quite sure that I understood security in Laravel formats quite well. For example, if the form contains
<input type="hidden" name="user_id">
then, obviously, the hacker can change the value before sending the update. Although I looked here in CSRF, I do not quite understand if the protection is enough?
eg. Accepting the above, if I go to the site and open the form for editing the record, I am allowed to view, but not change, and maliciously change the "user_id", is it sufficient that the form is protected with {{ csrf_field() }}
or should I use some additional security, for example Crypt::encrypt($id)
, to hide user_id (stored in the database) and Crypt::decrypt($id)
?
Is it bad practice to expose a string id (e.g. user id) in a client browser (although everything is sent via https)?
Many thanks
source
share