The essence of command injection attacks in web applications

被引:162
作者
Su, ZD [1 ]
Wassermann, G [1 ]
机构
[1] Univ Calif Davis, Davis, CA 95616 USA
关键词
algorithms; experimentation; languages; reliability; security; verification; command injection attacks; web applications; grammars; parsing; runtime verification;
D O I
10.1145/1111320.1111070
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
Web applications typically interact with a back-end database to retrieve persistent data and then present the data to the user as dynamically generated output, such as HTML web pages. However, this interaction is commonly done through a low-level API by dynamically constructing query strings within a general-purpose programming language, such as Java. This low-level interaction is ad hoc because it does not take into account the structure of the output language. Accordingly, user inputs are treated as isolated lexical entities which, if not properly sanitized, can cause the web application to generate unintended output. This is called a command injection attack, which poses a serious threat to web application security. This paper presents the first formal definition of command injection attacks in the context of web applications, and gives a sound and complete algorithm for preventing them based on context-free grammars and compiler parsing techniques. Our key observation is that, for an attack to succeed, the input that gets propagated into the database query or the output document must change the intended syntactic structure of the query or document. Our definition and algorithm are general and apply to many forms of command injection attacks. We validate our approach with SQLCHECK, an implementation for the setting of SQL command injection attacks. We evaluated SQLCHECK on real-world web applications with systematically compiled real-world attack data as input. SQLCHECK produced no false positives or false negatives, incurred low runtime overhead, and applied straightforwardly to web applications written in different languages.
引用
收藏
页码:372 / 382
页数:11
相关论文
共 39 条
[1]  
Aho Alfred V., 1986, ADDISON WESLEY SERIE
[2]  
Anley C., 2002, Advanced SQL injection in SQL server applications
[3]  
[Anonymous], 2005, 20 IFIP INT INF SEC
[4]  
[Anonymous], PROC 49 ANN ACM SIGA
[5]  
BIERMAN G, 2005, IN PRESS 19 EUR C OB
[6]  
Boyd S.W., 2004, LNCS, V2
[7]  
BRABRAND C, 2000, WORLD WIDE WEB, V3
[8]  
Buehrer G., 2005, P INT WORKSH SOFTW E
[9]  
Cook W. R., 2005, P 27 INT C SOFTW ENG
[10]  
DEAN D, P IEEE S RES SEC PRI