SQL Injection (SQLi) vulnerabilities put the security of web pages and application databases at risk. This article covers SQL injection vulnerabilities, how to prevent them, and resources to mitigate them.
On this page:
SQL injection is a form of attack in which malicious SQL statements are inserted into a web page form field and executed. Web pages/applications vulnerable to SQL injection essentially place their entire databases at risk.
Consider this (fairly common) scenario:
It can feel like a waste of time to drop what you’re working on now and spend time fixing old code. But, the benefit is in minimizing the likelihood your site/application will be used to defraud people or otherwise cause harm.
The most common cause is the programmer practice of simply concatenating unsanitized user input with other strings to form the SQL queries issued to the database.
Additionally, outputting detailed database error messages often provides an attacker with clues needed to create an effective SQL injection attack.
The following resources are a great place to gain a deeper understanding of SQL injection as well as the techniques used to mitigate it.
Information Security teaches hands-on secure coding workshops for web developers, which include understanding and mitigating SQL injection attacks. If you or your team is interested, please contact Pete Graff at pgraff@uw.edu.