Hello all!
I'm just about to release a website I've designed into the wild, but before I do, I would love some help determining whether I have made any silly security mistakes. Since I'm using shared hosting rather than dedicated, this is a very important concern. After much research and tutorial-reading I've done the following:
- All PHP scripts (including database credentials) are owned by me, with
700 (-rwx------)400 (-r--------) permissions. - Session files are stored in a directory owned by me, with 700 (drwx------) permissions (so people sharing the same host as me cannot hijack sessions).
- When the user logs in they are assigned a new session ID, to prevent session fixation.
- PHP include files are stored in a directory outside of the public webspace, with
700 (drwx------)100 (d--x------) permissions. - The admin section of the site is secured with SSL and reCAPTCHA.
Every piece of data that is used in a mysql query is escaped with mysql_real_escape_string to prevent SQL injection.- Mysql queries are handled using prepared statements via the mysqli PHP plugin. This should prevent SQL injection.
- Plaintext input is put through htmlspecialchars() in an attempt to stop XSS, and other types of input are sanitised by typecasting them.
- The admin password is stored as a
n MD5 SHA-256 hashsalted SHA-512 hash. - Sessions expire after 1 hour of inactivity.
This is my first real world web design project and I'm terrified that I may have forgotten something or left some security hole open. If you can spot any omissions or you have any further suggestions please let me know!
Thanks in advance.