This section will talk about various common vulnerabilites found in PHP sites, and solutions on how to prevent them.
If you are interested in the security of well known PHP applications, there are many resources that you should check on a regular basis. When ever an exploit is found with any program, it gets reported and posted on various security websites, often with solutions on how to fix it.Here is a good resource for looking up known exploits in widely used PHP applications: SecurityFocus
Most vulnerabilities in PHP code are cause by insufficent input validation procedures (checking the user input). Best practice is to think about what each variable is expected to have and make sure it fits those requirements.Now to cover some common 'mistakes' people make when coding in PHP and using MySql:
|SQL Injection (2004-05-11)|
SQL Injection is when a visitor injects SQL code that manages to get processed by the SQL server.
|Cross-Site Scripting (2004-05-12)|
|GET/POST Variable Manipulation (2004-05-13)|
When a visitor is able to cheat the website by modifying GET/POST variables that contain sensitive information and therefore change things that he/she should not be able to.