Part I: Introduction to SQL InjectionSaturday, April 23, 2005
This is Part I of a serialization of a paper I have written on the SQL Injection defenses. As portions of the paper are finished I will post them on this blog. Topics will include a discussion on access control, security models, classification of attacks, and intrusion detection techniques. Most SQL injection attacks are executed through an application that takes user-supplied input for query parameters. The attacker supplies carefully a crafted string to form a new query with results very different than what the application developer intended. For example, consider a script on a website that takes a search parameter to return selected results from a database. A very simple attack may be possible by simply providing something like “1 OR 1=1” in the text field which causes the SQL server to return all records from a particular table. An attacker can often gain access to anything available with the script's privileges, which in many cases is full access to one or more databases. While SQL injection attacks could be be executed against any application, web applications are the most commonly vulnerable since the attacker can easily explore a site for vulnerabilities without being caught or having to work through sophisticated network intrusion techniques as most prospective targets leave their website applications wide open. Firewalls and traditional network intrusion detection systems are useless against SQL injection since it is an application exploit that in most cases is indistinguishable from expected use. Some signature-based detection systems have been developed for web servers to protect vulnerable scripts from malicious input. However, these signature-based systems are inherently susceptible to evasion methods that take advantage of the expressiveness of the SQL language or alternate character encodings. Remarkably, writing scripts that are not vulnerable to SQL injection is as simple as passing all user-provided text through a string escaping function prior to use as a parameter in a SQL statement, but as past experience has shown, vulnerable scripts are everywhere to be found. SQL injection affects every database on every platform. Attacks can be used to gain information disclosure, to bypass authentication mechanisms, to modify the database, and to, in some cases, execute arbitrary code on the database server itself!
Posted by Frank Rietta at
11:04 AM
|
"Whenever you find a man who says he doesn't believe in a
real Right and Wrong, you will find the same man going back on this a moment later."
Recent Posts
ArchivesApril 2005 / May 2005 / June 2005 / July 2005 / August 2005 / November 2005 / April 2006 / June 2006 / August 2006 / September 2006 / November 2006 / December 2006 / January 2007 / January 2008 /
About MeI am a software developer who has been marketing on the internet since 1999. I hold an MS in Information Security from the Georgia Institute of Technology, from where I previously earned a BS in Computer Science in 2005. I ran an Atlanta-based web hosting business from 1999 until I sold it in 2005. |
Home | Product List | Privacy | Contact