skip to main content
10.1145/1315245.1315249acmconferencesArticle/Chapter ViewAbstractPublication PagesccsConference Proceedingsconference-collections
Article

CANDID: preventing sql injection attacks using dynamic candidate evaluations

Published:28 October 2007Publication History

ABSTRACT

SQL injection attacks are one of the topmost threats for applications written for the Web. These attacks are launched through specially crafted user input on web applications that use low level string operations to construct SQL queries. In this work, we exhibit a novel and powerful scheme for automatically transforming web applications to render them safe against all SQL injection attacks.

A characteristic diagnostic feature of SQL injection attacks is that they change the intended structure of queries issued. Our technique for detecting SQL injection is to dynamically mine the programmer-intended query structure on any input, and detect attacks by comparing it against the structure of the actual query issued. We propose a simple and novel mechanism, called C<scp>ANDID</scp>, for mining programmer intended queries by dynamically evaluating runs over benign candidate inputs. This mechanism is theoretically well founded and is based on inferring intended queries by considering the symbolic query computed on a program run. Our approach has been implemented in a tool called C<scp>ANDID</scp>, that retrofits Web applications written in Java to defend them against SQL injection attacks. We report extensive experimental results that show that our approach performs remarkably well in practice.

References

  1. Online SQL syntax checker. http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm.Google ScholarGoogle Scholar
  2. Using Google code search to find security bugs. Internet Bulletin, Oct 2006.Google ScholarGoogle Scholar
  3. Alur, R., Cerný, P., Madhusudan, P., and Nam, W. Synthesis of interface specifications for java classes. In POPL (2005), pp. 98--109. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Ammons, G., Bodík, R., and Larus, J. R. Mining specifications. In POPL (2002), pp. 4--16. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Anley, C. Advanced SQL injection in SQL server applications, White paper, Next Generation Security Software Ltd. Tech. rep., 2002.Google ScholarGoogle Scholar
  6. Apache. The JMeter project. http://jakarta.apache.org/jmeter/.Google ScholarGoogle Scholar
  7. Biba, K. J. Integrity considerations for secure computer systems. Tech. Rep. ESD-TR-76-372, USAF Electronic Systems Division, Bedford, MA, Apr. 1977.Google ScholarGoogle Scholar
  8. Boyd, S. W., and Keromytis, A. D. Sqlrand: Preventing sql injection attacks. In ACNS (2004), pp. 292--302.Google ScholarGoogle ScholarCross RefCross Ref
  9. Buehrer, G., Weide, B. W., and Sivilotti, P. A. G. Using parse tree validation to prevent sql injection attacks. In SEM (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Cook, W. R., and Rai, S. Safe query objects: statically typed objects as remotely executable queries. In ICSE (2005), pp. 97--106. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Emmi, M., Majumdar, R., and Sen, K. Dynamic test input generation for database applications. In International Symposium on Software Testing and Analysis (ISSTA'07), 2007, ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Halfond, W., and Orso, A. AMNESIA: Analysis and Monitoring for NEutralizing SQL-Injection Attacks. In ASE (2005), pp. 174--183. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Halfond, W., Orso, A., and Manolios, P. Using Positive Tainting and Syntax-Aware Evaluation to Counter SQL Injection Attacks. In FSE (2006), pp. 175--185. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. Halfond, W. G., Viegas, J., and Orso, A. A Classification of SQL-Injection Attacks and Countermeasures. In SSSE (2006).Google ScholarGoogle Scholar
  15. Secureworks press release. Internet news report, July 2006. http://www.secureworks.com/press/20060718-sql.html.Google ScholarGoogle Scholar
  16. Livshits, V. B., and Lam, M. S. Finding security vulnerabilities in Java applications with static analysis. In USENIX Security Symposium (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. McClure, R. A., and Krüger, I. H. Sql dom: compile time checking of dynamic sql statements. In ICSE (2005), pp. 88--96. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. MITRE. Common vulnerabilities and exposures list. http://cve.mitre.org/.Google ScholarGoogle Scholar
  19. Nguyen-Tuong, A., Guarnieri, S., Greene, D., Shirley, J., and Evans, D. Automatically hardening web applications using precise tainting. In SEC(2005), pp. 295--308.Google ScholarGoogle Scholar
  20. O. Maor and A. Shulman. SQL injection signatures evasion. White paper, Imperva. Tech. rep., 2002.Google ScholarGoogle Scholar
  21. Pietraszek, T., and Berghe, C. V. Defending against injection attacks through context-sensitive string evaluation. In RAID (2005). Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Sabelfeld, A., and Myers, A. C. Language-based information-flow security. IEEE JSA, (2003).Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. Soot: a java optimization framework. http://www.sable.mcgill.ca/soot/.Google ScholarGoogle Scholar
  24. Su, Z., and Wassermann, G. The essence of command injection attacks in web applications. In POPL (2006), pp. 372--382. Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Dark reading security analysis. Internet, September 2006. http://www.darkreading.com/document.asp?doc_id=103774&WT.svl=news1_3.Google ScholarGoogle Scholar
  26. Valeur, F., Mutz, D., and Vigna, G. A learning-based approach to the detection of sql attacks. In DIMVA (2005), pp. 123--140. Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Top five vulnerabilities. IT management security report. http://www.computerweekly.com/Articles/2004/04/16/201840/Top+five+threats.htm.Google ScholarGoogle Scholar
  28. Weimer, W., and Necula, G. C. Mining temporal specifications for error detection. In TACAS (2005), pp. 461--476. Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Xie, Y., and Aiken, A. Static detection of security vulnerabilities in scripting languages. In USENIX Security Symposium (2006). Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Xu, W., Bhatkar, S., and Sekar, R. Taint-enhanced policy enforcement: A practical approach to defeat a wide range of attacks. In 15th USENIX Security Symposium (2006). Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. CANDID: preventing sql injection attacks using dynamic candidate evaluations

          Recommendations

          Comments

          Login options

          Check if you have access through your login credentials or your institution to get full access on this article.

          Sign in
          • Published in

            cover image ACM Conferences
            CCS '07: Proceedings of the 14th ACM conference on Computer and communications security
            October 2007
            628 pages
            ISBN:9781595937032
            DOI:10.1145/1315245

            Copyright © 2007 ACM

            Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

            Publisher

            Association for Computing Machinery

            New York, NY, United States

            Publication History

            • Published: 28 October 2007

            Permissions

            Request permissions about this article.

            Request Permissions

            Check for updates

            Qualifiers

            • Article

            Acceptance Rates

            CCS '07 Paper Acceptance Rate55of302submissions,18%Overall Acceptance Rate1,261of6,999submissions,18%

            Upcoming Conference

            CCS '24
            ACM SIGSAC Conference on Computer and Communications Security
            October 14 - 18, 2024
            Salt Lake City , UT , USA

          PDF Format

          View or Download as a PDF file.

          PDF

          eReader

          View online with eReader.

          eReader