|
ABSTRACT
Many data-intensive applications dynamically construct queries in response to client requests and execute them. Java servlets, for example, can create strings that represent SQL queries and then send the queries, using JDBC, to a database server for execution. The servlet programmer enjoys static checking via Java's strong type system. However, the Java type system does little to check for possible errors in the dynamically generated SQL query strings. Thus, a type error in a generated selection query (e.g., comparing a string attribute with an integer) can result in an SQL runtime exception. Currently, such defects must be rooted out through careful testing, or (worse) might be found by customers at runtime. In this article, we present a sound, static program analysis technique to verify that dynamically generated query strings do not contain type errors. We describe our analysis technique and provide soundness results for our static analysis algorithm. We also describe the details of a prototype tool based on the algorithm and present several illustrative defects found in senior software-engineering student-team projects, online tutorial examples, and a real-world purchase order system written by one of the authors.
REFERENCES
Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.
| |
1
|
Alfred V. Aho , Ravi Sethi , Jeffrey D. Ullman, Compilers: principles, techniques, and tools, Addison-Wesley Longman Publishing Co., Inc., Boston, MA, 1986
|
 |
2
|
|
| |
3
|
Andersen, L. 1994. Program analysis and specialization for the C programming language. Ph.D. thesis, DIKU, University of Copenhagen. DIKU report 94/19.
|
 |
4
|
|
 |
5
|
|
| |
6
|
Choi, T.-H., Lee, O., Kim, H., and Doh, K.-G. 2006. A practical string analyzer by the widening approach. In Proceedings of the 4th Asian Symposium on Programming Languages and Systems (APLAS 2006) (Sydney, Australia). Springer-Verlag, New York, 374--388.
|
| |
7
|
Christensen, A., M&oslah;ller, A., and Schwartzbach, M. 2003. Precise analysis of string expressions. In Proceedings of the 10th International Static Analysis Symposium (San Diego, CA). Springer-Verlag, New York, 1--18.
|
| |
8
|
Cook, W. R., and Ibrahim, A. H. 2005. Programming languages & databases: What's the problem?? url: http://www.cs.utexas.edu/~wcook/Drafts/2005/PLDBProblem.pdf.
|
 |
9
|
|
| |
10
|
Guyot, J. 1998. BNF index of SQL for Oracle 7. Available at http://cui.unige.ch/db-research/Enseignement/analyseinfo/SQL7/.
|
 |
11
|
|
 |
12
|
|
 |
13
|
|
| |
14
|
JBoss. 2006. Hibernate. url: http://www.hibernate.org/.
|
 |
15
|
|
 |
16
|
|
 |
17
|
|
 |
18
|
Eugene Kohlbecker , Daniel P. Friedman , Matthias Felleisen , Bruce Duba, Hygienic macro expansion, Proceedings of the 1986 ACM conference on LISP and functional programming, p.151-161, August 1986, Cambridge, Massachusetts, United States
[doi> 10.1145/319838.319859]
|
 |
19
|
|
| |
20
|
Microsoft. 2004. ADO.NET. url: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/adonetanchor.asp.
|
| |
21
|
Microsoft. 2005. LINQ Project. url: http://msdn.microsoft.com/netframework/future/linq/.
|
| |
22
|
Oracle. 2006. Oracle TopLink. url: http://www.oracle.com/technology/products/ias/toplink/index.html.
|
 |
23
|
Thomas Reps , Susan Horwitz , Mooly Sagiv, Precise interprocedural dataflow analysis via graph reachability, Proceedings of the 22nd ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.49-61, January 23-25, 1995, San Francisco, California, United States
[doi> 10.1145/199448.199462]
|
 |
24
|
|
 |
25
|
|
| |
26
|
SQLJ. 1997. See http://www.sqlj.org.
|
 |
27
|
Zhendong Su , Manuel Fähndrich , Alexander Aiken, Projection merging: reducing redundancies in inclusion constraint graphs, Proceedings of the 27th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, p.81-95, January 19-21, 2000, Boston, MA, USA
[doi> 10.1145/325694.325706]
|
| |
28
|
|
 |
29
|
|
| |
30
|
Raja Vallée-Rai , Phong Co , Etienne Gagnon , Laurie Hendren , Patrick Lam , Vijay Sundaresan, Soot - a Java bytecode optimization framework, Proceedings of the 1999 conference of the Centre for Advanced Studies on Collaborative research, p.13, November 08-11, 1999, Mississauga, Ontario, Canada
|
| |
31
|
Viega, J., and McGraw, G. 2001. Building Secure Software: How to Avoid Security Problems the Right Way. Addison Wesley, Boston, MA.
|
| |
32
|
Wassermann, G., and Su, Z. 2004. An analysis framework for security in Web applications. In Proceedings of the 3rd FSE Workshop on the Specification and Verification of Component Based Systems (SAVCBS 2004) (Newport Beach, CA). ACM, New York, 70--78.
|
 |
33
|
|
| |
34
|
Yellin, D. 1993. Speeding up dynamic transitive closure for bounded degree graphs. Acta Inf. 30, 4 (July), 369--384.
|
|