SQL injection (SQLi) is a technique of injecting code into an existing SQL query, effectively hijacking it to perform malicious actions. SQLi can harm most applications that handle data, such as websites, desktops, and phone applications. SQLi allow malicious users to extract or modify data which they would not normally have access to.
Protect my SiteYou can detect SQL injections by monitoring your database and its queries. SQL injections are hard to detect as they execute genuine queries on the database, which will not raise any flags on the target. Most attacks are detected once the attacker uses the vulnerability to perform additional actions, such as modify database content to gain privileged access. Since these SQL injections are hard to detect, it’s important to take preventive measures.
The easiest way to protect yourself from SQL injections is to ensure you keep all of your components up to date. Most attackers rely on vulnerabilities which were fixed on the new versions of components, so they target websites remaining on the old, vulnerable versions. This doesn’t cover all attacks though: Some attackers can use zero-days, or undisclosed and unpatched vulnerabilities to compromise websites. In such cases, you should rely on generic SQL injection protection such as CloudProxy, the Sucuri Web Application Firewall. The website firewall correlates attack data across the Sucuri network to detect what requests attempt to perform an SQL injection, and block them before they even reach your website.