Two great things to check: SQL injection and remote code execution .
SQL injection occurs when you take data from some unreliable source (i.e. all over the world of laughter!) And use it as an SQL query. The fix is ββto stop using string substitution to create queries and updates and strictly adhere to parameterized queries / updates. Note that using magic citation is a much lower approach to solving this issue, since it is much easier to do it wrong; "always parameterize every query" is an easier way that is easier to check. (Yes, you really need to check all your code here. Sorry.)
Remote code execution is when you have some kind of mechanism that allows the website client to request the website to start PHP, which is not pre-loaded onto the website in a directory that the web server can execute Do not write. This is convenient, yes, but it is very dangerous, because a cunning cracker may ask the web server to download a rootkit or other vile content. We often got this with our main web server at work, so now we run it on a strictly read-only file system (with remote logging) with remote execution of PHP code (or, really, open any other connection to a non-server with white list) is strictly prohibited. This upsets the various external web design consultants who continue to be hired, but this is because they are too often not very professional in the entire business of launching a secure system, and this means that this entire class of attacks is blocked.
(Another thing you need to pay attention to is XSS , although this is not quite an attack on your site. This happens when you cannot correctly specify untrusted content coming from your database to be served from your site without actually Protecting your site from being on the side of accepting such things is important, but first you need to solve more serious threats so that your site does not have toxic zombies.)
Donal fellows
source share