Another major aspect is never visible in the script source code, and that is to set up your server so the CGI never runs as the web server user. For every task set up a different fake user and use something like suexec to run your CGI as that user. That way if you do have a hole, your server isn't directly compromised (though even getting local user access is already a huge step for a hacker). Here it will also allow you to set the permissions of your SQL server so that this user (and therefore CGI script) may only do the things he needs to do here. That DOES help somewhat against SQL injection (though the real solution to that is still using placeholders) and even against someone taking over your script and now trying to access the SQL server.
In reply to Re: Hacker Proofing My First Script
by thospel
in thread Hacker Proofing My First Script
by awohld
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |