Sound and precise analysis of web applications for injection vulnerabilities
Authors:
Open Access
- 10 June 2007
- journal article
- Published by Association for Computing Machinery (ACM) in ACM SIGPLAN Notices
- Vol. 42 (6) , 32-41
Abstract
Web applications are popular targets of security attacks. One common type of such attacks is SQL injection, where an attacker exploits faulty application code to execute maliciously crafted database queries. Bothstatic and dynamic approaches have been proposed to detect or prevent SQL injections; while dynamic approaches provide protection for deployed software, static approaches can detect potential vulnerabilities before software deployment. Previous static approaches are mostly based on tainted information flow tracking and have at least some of the following limitations: (1) they do not model the precise semantics of input sanitization routines; (2) they require manually written specifications, either for each query or for bug patterns; or (3) they are not fully automated and may require user intervention at various points in the analysis. In this paper, we address these limitations by proposing a precise, sound , and fully automated analysis technique for SQL injection. Our technique avoids the need for specifications by consideringas attacks those queries for which user input changes the intended syntactic structure of the generated query. It checks conformance to this policy byconservatively characterizing the values a string variable may assume with a context free grammar, tracking the nonterminals that represent user-modifiable data, and modeling string operations precisely as language transducers. We have implemented the proposed technique for PHP, the most widely-used web scripting language. Our tool successfully discovered previously unknown and sometimes subtle vulnerabilities in real-world programs, has a low false positive rate, and scales to large programs (with approx. 100K loc).Keywords
This publication has 23 references indexed in Scilit:
- Precise alias analysis for static detection of web application vulnerabilities2006
- Defending Against Injection Attacks Through Context-Sensitive String Evaluation2006
- Static Analysis for Java Servlets and JSPLecture Notes in Computer Science, 2006
- Using parse tree validation to prevent SQL injection attacks2005
- Automatically Hardening Web Applications Using Precise Tainting2005
- Securing web application code by static analysis and runtime protection2004
- SQLrand: Preventing SQL Injection Attacks2004
- Regular Approximation of Context-Free Grammars through Transformation2001
- An efficient compiler for weighted rewrite rules1996
- An efficient context-free parsing algorithmCommunications of the ACM, 1970