Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
r184 problems
#4
Ok, I have added nonces in every form or link that does modify the system and tested possibly all of them (I think).
There's no point in changing the code for my website only, so I'm sharing my modifications.

The nonce functions are defined in admin/inc/nonce.php, get_nonce and check_nonce.
The first is called when outputting a form or link; the latter is used for verification after a form is submitted. get_nonce outputs a sha1 hash containing:
* $SALT and $USR
* Ip address
* Action and file responsible for that action

Future development may introduce time-based nonces somehow.

I see some forms already had a protection against CSRF, the variable $SESSIONHASH defined in admin/inc/common.php: I haven't touched them as for now, but it would be better in the future (if you want to integrate my edits) to replace them with my nonce functions. I also haven't edited admin/download.php as I don't know which files are downloaded through there. Adding the nonce protection is easy, if needed.

In attachment is the $( svn diff ) from the latest checkout (r184). Of course it's a derivative work and thus released under the same GPLv3 license as GetSimple.

Edit: now nonce.php included in the diff
Reply


Messages In This Thread
r184 problems - by tankmiche - 2010-09-12, 18:06:56
r184 problems - by Zegnåt - 2010-09-12, 19:26:13
r184 problems - by tankmiche - 2010-09-12, 19:50:41
r184 problems - by tankmiche - 2010-09-14, 01:51:33
r184 problems - by tankmiche - 2010-09-14, 01:56:40
r184 problems - by WebFXWorld - 2010-09-15, 11:43:35
r184 problems - by ccagle8 - 2010-09-22, 01:55:26
r184 problems - by ccagle8 - 2010-09-22, 03:14:10
r184 problems - by ccagle8 - 2010-09-22, 03:35:06
r184 problems - by tankmiche - 2010-09-24, 18:41:34



Users browsing this thread: 1 Guest(s)