In order to prevent CSRF attack, should I to send the md5 hash of my session_id() in an hidden field via form? he would be enough?
Thanks
In order to prevent CSRF attack, should I to send the md5 hash of my session_id() in an hidden field via form? he would be enough?
Thanks
I can't comment right now. You should provide code examples or something. Your question is really generic and if you really love be safe from Attacks you should almost think about having some "model" protection something like:
"...
1. Authenticate (when request)
2. Header check
3. I/O write timestamp in disk (or whatever)
4. A first token usually sent by GET (querystring) and it is the SHA1 or SHA512 hash of the user’s sessionID
5. A second token sent by POST (form) and it is the aes256 crypt of the hash with SHA1 or SHA512 (depends on how much faster the request have to be) of the user’s sessionID, plus additional informations like datetime and others (crypted only with aes256 and packet with all the request)
6. This two tokens must match with the original sessionID of the user, and additional informations are decrypted
7. The timestamp token need to match the timestamp saved on disk (or whatever)
..."
every user-case is different, i wrote it from my blog here: https://blog.myetv.tv/2017/09/18/writing-secure-code-how-myetv-do-crypt-auth-transfer-and-store-informations/
hope it helps ;)