journal article·2025-11-21Open access

Comparative Analysis of SQL Injection Defense Mechanisms Based on Three Approaches: PDO, PVT, and ART

Jiho Choi, Young-Ae Jung, Hoon Ko

Applied Sciences· Volume 15· Issue 23

Abstract

This study presents a comprehensive examination of the risks associated with SQL Injection attacks, with a particular focus on the Union Select technique. This method is frequently exploited by attackers to retrieve unauthorized data by appending malicious queries to legitimate database calls. We analyzed multiple real-world cases where personal information was leaked through such attacks, underscoring the urgent need for robust countermeasures in modern web applications. To address these threats, we developed and implemented a multi-layered defense strategy. This strategy includes using PHP Data Objects (PDO) with Prepared Statements to safely handling user inputs, rigorous input pattern validation to detect and reject suspicious payloads, and a redirection-based filtering mechanism to disrupt abnormal access attempts. Through controlled experiments, we validated the effectiveness of these techniques in mitigating SQL Injection attacks. The results demonstrate that our approach successfully blocked malicious queries and prevented unauthorized data access or manipulation. These findings represent a significant contribution to enhancing the security, stability, and trustworthiness of web-based systems, especially those handling sensitive user information. Finally, this work is presented as an educational comparative study, not as a proposal of new defense mechanisms, aiming to provide a clear and reproducible evaluation of standard SQL injection countermeasures. The contributions of this work are threefold: (i) it provides a unified comparative evaluation of three representative SQL injection defense methods—PDO, pattern validation, and attacker redirection—under identical experimental conditions; (ii) it analyzes their strengths, weaknesses, and practical applicability in PHP–MySQL environments; and (iii) it serves as an educational reference that bridges theoretical understanding and practical implementation. The study also suggests directions for extending this work through machine-learning-based anomaly detection and runtime self-protection (RASP) frameworks.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Web Application Security Vulnerabilities · Security and Verification in Computing · Information and Cyber Security

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Department of Computer Science and Engineering, Sunmoon University, 70, Sunmoon-ro 221 beon-gil, Tangjeong-myeon, Asan 31460, Republic of Korea

Department of AI Software Technology, Sunmoon University, 70, Sunmoon-ro 221 beon-gil, Tangjeong-myeon, Asan 31460, Republic of Korea

Funding

Sun Moon University

References (20)

Show source-provided references
1. Database security—Concepts, approaches, and challenges10.1109/TDSC.2005.9 ↗
2. A systematic review of detection and prevention techniques of SQL injection attacks10.1080/19393555.2021.1995537 ↗
3. Appelt, D., Panichella, A., and Briand, L. (2017, January 23–26). Automatically repairing web application firewalls based on successful SQL injection attacks. Proceedings of the 2017 IEEE 28th International Symposium on Software Reliability Engineering (ISSRE), Toulouse, France.10.1109/ISSRE.2017.28 ↗
4. Alkhalaf, A., Alkhatib, B., and Ghanem, S. (2022, January 23–24). SQL Injection Attack Detection Using Machine Learning Techniques. Proceedings of the 7th International Conference on Advanced Computing and Intelligent Engineering, Cuttack, India.
5. Sql injection attack detection and prevention techniques using machine learning
6. Bisht, P., and Venkatakrishnan, V.N. (2008, January 10–11). XSS-GUARD: Precise dynamic prevention of cross-site scripting attacks. Proceedings of the International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment, Paris, France.
7. Tasdemir, K., Khan, R., Siddiqui, F., Sezer, S., Kurugollu, F., Yengec-Tasdemir, S.B., and Bolat, A. (2023). Advancing SQL injection detection for high-speed data centers: A novel approach using cascaded NLP. arXiv.
8. Dasari, N.S., Badii, A., Moin, A., and Ashlam, A. (2025). Enhancing SQL Injection Detection and Prevention Using Generative Models. arXiv.
9. A deep learning approach based on multi-view consensus for SQL injection detection10.1007/s10207-023-00791-y ↗
10. Viegas, J., Halfond, W., and Orso, A. (2006, January 16–17). A classification of SQL-injection attacks and countermeasures. Proceedings of the IEEE International Symposium Secure Software Engineering 2006, Arlington, VA, USA.
11. Yash, V. (2022). SQL Injection Attack Detection Using Naive Bayes Classifier. [Doctoral Dissertation, Institute of Technology].
12. Detecting SQL injection attacks by binary gray wolf optimizer and machine learning algorithms10.1007/s00521-024-09429-z ↗
13. An approach to detection of SQL injection attack based on dynamic query matching
14. Hasan, M., Balbahaith, Z., and Tarique, M. (2019, January 19–21). Detection of SQL injection attacks: A machine learning approach. Proceedings of the 2019 International Conference on Electrical and Computing Technologies and Applications (ICECTA), Ras Al Khaimah, United Arab Emirates.10.1109/ICECTA48151.2019.8959617 ↗
15. DESIGNING AN ADAPTIVE HONEYPOT FOR ADVANCED CYBERSECURITY THREAT DETECTION
16. Morić, Z., Dakić, V., and Regvart, D. (2025). Advancing Cybersecurity with Honeypots and Deception Strategies. Informatics, 12.10.3390/informatics12010014 ↗
17. Halfond, W.G., and Orso, A. (2005, January 7–11). AMNESIA: Analysis and monitoring for NEutralizing SQL-injection attacks. Proceedings of the IEEE/ACM International Conference on Automated Software Engineering, Long Beach, CA, USA.10.1145/1101908.1101935 ↗
18. SQL Injection Attack Detection Using Machine Learning Algorithm10.58496/MJCS/2022/002 ↗
19. Alarfaj, F.K., and Khan, N.A. (2023). Enhancing the Performance of SQL Injection Attack Detection through Probabilistic Neural Networks. Appl. Sci., 13.10.3390/app13074365 ↗
20. Combining Regular Expressions and Machine Learning for SQL Injection Detection in Urban Computing10.5753/jisa.2024.3799 ↗