skip to main content
10.1145/3320269.3384760acmconferencesArticle/Chapter ViewAbstractPublication Pagesasia-ccsConference Proceedingsconference-collections
research-article
Public Access

You shall not pass: Mitigating SQL Injection Attacks on Legacy Web Applications

Published:05 October 2020Publication History

ABSTRACT

SQL injection (SQLi) attacks pose a significant threat to the security of web applications. Existing approaches do not support object-oriented programming that renders these approaches unable to protect the real-world web apps such as Wordpress, Joomla, or Drupal against SQLi attacks. We propose a novel hybrid static-dynamic analysis for PHP web applications that limits each PHP function for accessing the database. Our tool, SQLBlock, reduces the attack surface of the vulnerable PHP functions in a web application to a set of query descriptors that demonstrate the benign functionality of the PHP function. We implement SQLBlock as a plugin for MySQL and PHP. Our approach does not require any modification to the web app. We evaluate SQLBlock on 11 SQLi vulnerabilities in Wordpress, Joomla, Drupal, Magento, and their plugins. We demonstrate that SQLBlock successfully prevents all 11 SQLi exploits with negligible performance overhead (i.e., a maximum of 3% on a heavily-loaded web server).

References

  1. Akamai. 2019. https://www.akamai.com/us/en/multimedia/documents/state-of-the-internet.Google ScholarGoogle Scholar
  2. Beans Erik Balde Samit, Barantsev Alexei. 2018. Selenium - Web Browser Automation. https://docs.seleniumhq.org/.Google ScholarGoogle Scholar
  3. Sruthi Bandhakavi, Prithvi Bisht, P Madhusudan, and VN Venkatakrishnan. 2007. CANDID: preventing sql injection attacks using dynamic candidate evaluations. In Proceedings of the 14th ACM conference on Computer and communications security. 12--24.Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. G. Bernardo and S. Miroslav. 2019. sqlmap: automatic SQL injection tool. https://sqlmap.org.Google ScholarGoogle Scholar
  5. Stephen W Boyd and Angelos D Keromytis. 2004. SQLrand: Preventing SQL injection attacks. In International Conference on Applied Cryptography and Network Security. 292--302.Google ScholarGoogle ScholarCross RefCross Ref
  6. Gregory Buehrer, Bruce W Weide, and Paolo AG Sivilotti. 2005. Using parse tree validation to prevent SQL injection attacks. In Proceedings of the 5th international workshop on Software engineering and middleware. 106--113.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. G. Cleary, M. Corpin, O. Cox, H. Lau, B. Nahorney, D. O'Brien, B. O'Gorman, J.Power, S. Wallace, P. Wood, and Wueest C. 2019. Internet Security Threat Report. Technical Report 24. Symantec Corporation.Google ScholarGoogle Scholar
  8. The MITRE Corp. 2014. CVE-2014--3704. https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2014--3704.Google ScholarGoogle Scholar
  9. Oracle Corporation. 2019. https://dev.mysql.com/doc/refman/8.0/en/.Google ScholarGoogle Scholar
  10. Johannes Dahse and Thorsten Holz. 2014. Simulation of Built-in PHP Features for Precise Static Code Analysis. In Proceedings of the Network and Distributed System Security Symposium.Google ScholarGoogle ScholarCross RefCross Ref
  11. Johannes Dahse and Thorsten Holz. 2014. Static Detection of Second-order Vulnerabilities in Web Applications. In Proceedings of the 23rd USENIX Conference on Security Symposium. 989--1003.Google ScholarGoogle Scholar
  12. Dataanyze. 2019. MySQL Market Share and Competitor Report. https://www.datanyze.com/market-share/databases/mysql-market-share.Google ScholarGoogle Scholar
  13. Drupal. 2016. https://www.drupal.org/docs/7/api/database-api.Google ScholarGoogle Scholar
  14. Apache Software Foundation. 2018. ab - Apache HTTP server benchmarking tool. https://httpd.apache.org/docs/2.4/programs/ab.html.Google ScholarGoogle Scholar
  15. W. Halfond, A. Orso, and P. Manolios. 2008. WASP: Protecting Web Applications Using Positive Tainting and Syntax-Aware Evaluation. IEEE Transactions on Software Engineering34 (2008), 65--81.Google ScholarGoogle Scholar
  16. William G Halfond, Jeremy Viegas, Alessandro Orso, et al. 2006. A classification of SQL-injection attacks and countermeasures. In Proceedings of the IEEE International Symposium on Secure Software Engineering. 13--15.Google ScholarGoogle Scholar
  17. William G. J. Halfond and Alessandro Orso. 2005. AMNESIA: Analysis and Monitoring for NEutralizing SQL-injection Attacks. In Proceedings of the 20th IEEE/ACM International Conference on Automated Software Engineering. 174--183.Google ScholarGoogle Scholar
  18. Yao-Wen Huang, Fang Yu, Christian Hang, Chung-Hung Tsai, Der-Tsai Lee, and Sy-Yen Kuo. 2004. Securing Web Application Code by Static Analysis and Runtime Protection. In Proceedings of the 13th International Conference on World Wide Web. 40--52.Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Docker Inc. 2018. Docker: Enterprise Container Platform.Google ScholarGoogle Scholar
  20. Nenad Jovanovic, Christopher Kruegel, and Engin Kirda. 2006. Pixy: A Static Analysis Tool for Detecting Web Application Vulnerabilities (Short Paper). In IEEE Symposium on Security and Privacy. 258--263.Google ScholarGoogle Scholar
  21. Anyi Liu, Yi Yuan, Duminda Wijesekera, and Angelos Stavrou. 2009. SQLProb: a proxy-based architecture towards preventing SQL injection attacks. In Proceedings of the 2009 ACM symposium on Applied Computing. 2054--2061.Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. V Benjamin Livshits and Monica S Lam. 2005. Finding Security Vulnerabilities in Java Applications with Static Analysis. In USENIX Security Symposium. 18--18.Google ScholarGoogle Scholar
  23. Port Swigger Ltd. 2019. https://portswigger.net/burp.Google ScholarGoogle Scholar
  24. Ibéria Medeiros, Miguel Beatriz, Nuno Neves, and Miguel Correia. 2016. Hacking the DBMS to prevent injection attacks. In Proceedings of the Sixth ACM Conference on Data and Application Security and Privacy. 295--306.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Ibéria Medeiros, Miguel Beatriz, Nuno Neves, and Miguel Correia. 2019. SEP-TIC: Detecting Injection Attacks and Vulnerabilities Inside the DBMS. IEEE Transactions on Reliability(2019).Google ScholarGoogle Scholar
  26. Ettore Merlo, Dominic Letarte, and Giuliano Antoniol. 2007. Automated protection of php applications against SQL-injection attacks. In11th European Conference on Software Maintenance and Reengineering (CSMR'07). IEEE, 191--202.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Metasploit. 2019. metasploit. https://www.metasploit.com.Google ScholarGoogle Scholar
  28. Abbas Naderi-Afooshteh, Anh Nguyen-Tuong, Mandana Bagheri-Marzijarani, Jason D Hiser, and Jack W Davidson. 2015. Joza: Hybrid taint inference for defeating web application sql injection attacks. In 2015 45th Annual IEEE/IFIP International Conference on Dependable Systems and Networks. 172--183.Google ScholarGoogle ScholarDigital LibraryDigital Library
  29. Q-Success. 2019. Usage Statistics and Market Share of Content Management Systems for Websites, August 2019. https://w3techs.com/technologies/overview/content_management/all.Google ScholarGoogle Scholar
  30. Q-Success. 2019. Usage Statistics and Market Share of PHP for Websites, August 2019. https://w3techs.com/technologies/details/pl-php/all/all.Google ScholarGoogle Scholar
  31. Donald Ray and Jay Ligatti. 2012. Defining code-injection attacks. In Acm Sigplan Notices. 179--190.Google ScholarGoogle Scholar
  32. Offensive Security. 2019. Exploit Database. https://exploit-db.com.Google ScholarGoogle Scholar
  33. Vadym Slizov. 2019. php-parser. https://github.com/z7zmey/php-parser.Google ScholarGoogle Scholar
  34. Sooel Son, Kathryn S. McKinley, and Vitaly Shmatikov. 2013. Diglossia: detecting code injection attacks with precision and efficiency. In Proceedings of the 20thACM SIGSAC conference on Computer. 1181--1192.Google ScholarGoogle ScholarDigital LibraryDigital Library
  35. Sooel Son and Vitaly Shmatikov. 2011. SAFERPHP: Finding Semantic Vulnerabilities in PHP Applications. In Proceedings of the ACM SIGPLAN 6th Workshop on Programming Languages and Analysis for ecurity. 1--13.Google ScholarGoogle ScholarDigital LibraryDigital Library
  36. Zhendong Su and Gary Wassermann. 2006. The Essence of Command Injection Attacks in Web Applications. In Conference Record of the 33rd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages. 372--382.Google ScholarGoogle Scholar
  37. San-Tsai Sun and Konstantin Beznosov. 2008. Sqlprevent: Effective dynamic detection and prevention of sql injection attacks without access to the application source code.Google ScholarGoogle Scholar
  38. Gary Wassermann and Zhendong Su. 2007. Sound and Precise Analysis of Web Applications for Injection Vulnerabilities. In Proceedings of the 28th ACM SIGPLAN Conference on Programming Language Design and Implementation. 32--41.Google ScholarGoogle ScholarDigital LibraryDigital Library

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
    ASIA CCS '20: Proceedings of the 15th ACM Asia Conference on Computer and Communications Security
    October 2020
    957 pages
    ISBN:9781450367509
    DOI:10.1145/3320269

    Copyright © 2020 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 the author(s) 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: 5 October 2020

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    Overall Acceptance Rate418of2,322submissions,18%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader