SQLPsdem: A Proxy-Based Mechanism Towards Detecting, Locating and Preventing Second-Order SQL Injections
- 14 May 2024
- journal article
- research article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 50 (7) , 1807-1826
Abstract
Due to well-hidden and stage-triggered properties of second-order SQL injections in web applications, current approaches are ineffective in addressing them and still report high false negatives and false positives. To reduce false results, we propose a Proxy-based static analysis and dynamic execution mechanism towards detecting, locating and preventing second-order SQL injections (SQLPsdem). The static analysis first locates SQL statements in web applications and identifies all data sources and injection points (e.g., Post, Sessions, Database, File names) that injection attacks can exploit. After that, we reconstruct the SQL statements and use attack engines to jointly generate attacks to cover all the state-of-the-art attack patterns so as to exploit these applications. We then use proxy-based dynamic execution to capture the data transmitted between web applications and their databases. The data are the reconstructed SQL statements with variable values from the attack payloads. If a web application is vulnerable, the data will contain malicious attacks on the database. We match the data with rules formulated by attack patterns to detect first and second-order SQL injection vulnerabilities in web applications, particularly the second-order ones. We use a representative and complete coverage of attack patterns and precise matching rules to reduce false results. By escaping and truncating malicious payloads in the data transmitted from the web application to the database, we can eliminate the possible negative impact of the data on the database. In the evaluation, by generating 52,771 SQL injection attacks using four attack generators, SQLPsdem successfully detects 26 second-order (including 13 newly discovered ones) and 375 first-order SQL injection vulnerabilities in 12 open-source web applications. SQLPsdem can also 100% eliminate the malicious impact of the data with negligible overhead.Keywords
Funding Information
- National Natural Science Foundation of China (62376240)
- S&T Program of Hebei (226Z0701G, 236Z0702G, 236Z0304G)
- Natural Science Foundation of Hebei Province (F2022203026)
- Science and Technology Project of Hebei Education Department (BJK2022029)
- Innovation Capability Improvement Plan Project of Hebei Province (22567637H)
This publication has 32 references indexed in Scilit:
- A Web Second-Order Vulnerabilities Detection MethodIEEE Access, 2018
- Application of Hidden Markov Model in SQL Injection Detection2017
- An Analysis of Black-Box Web Application Vulnerability Scanners in SQLi Detection2015
- Automated Security Testing Framework for Detecting SQL Injection Vulnerability in Web Application2015
- Detecting SQL injection attacks using query result sizeComputers & Security, 2014
- Detection Method of the Second-Order SQL Injection in Web Applications2014
- Defining Injection AttacksLecture Notes in Computer Science, 2014
- A novel method for SQL injection attack detection based on removing SQL query attribute valuesMathematical and Computer Modelling, 2012
- SQL Injection Attacks and Defense2009
- Automatically Hardening Web Applications Using Precise Tainting2005