Providing a Method for Analyzing Textual Data and Using Machine Learning Techniques for SQL Injection Detection
Keywords:
data security, database, SQL, SQL injection, SQL injection prevention, machine learningAbstract
The use of computer networks, especially the Internet, is expanding steadily and has become an integral part of human life, and web applications necessarily use database servers. The importance of data protection in the web environment is doubled by the diverse personal, medical, financial and other data used for various purposes, whose vulnerabilities may cause irreparable harm to the stakeholders. Data vulnerabilities in the web environment should therefore be identified and addressed in light of emerging threats. One of these vulnerabilities is SQL injection in the SQL Server database, which is the subject of this research. The focus of this study is to increase the precision of injection prevention, for which injection prevention methods were combined so that their advantages are used more widely. The simultaneous use of machine learning and text matching methods (the two main methods of injection prevention) in this study enhances the effectiveness and reliability of injection prevention. The result of this study is an improvement of 1.91% for the proposed hybrid approach compared with the base algorithm.
References
Alghawazi, M., Alghazzawi, D., & Alarifi, S. (2022). Detection of SQL Injection Attack Using Machine Learning Techniques: A Systematic Literature Review. Journal of Cybersecurity and Privacy, 2(4), 764–777. https://doi.org/10.3390/jcp2040039
Chen, D., Yan, Q., Wu, C., & Zhao, J. (2021). SQL Injection Attack Detection and Prevention Techniques Using Deep Learning. Journal of Physics: Conference Series, 1757(1), 012055. https://doi.org/10.1088/1742-6596/1757/1/012055
Choi, J., Kim, H., Choi, C., & Kim, P. (2011). Efficient Malicious Code Detection Using N-Gram Analysis and SVM. In 2011 14th International Conference on Network-Based Information Systems (pp. 618–621). IEEE. https://doi.org/10.1109/nbis.2011.104
Chun, R. (2019). SQL injection detection using machine learning. San Jose State University.
Dogbe, E., Millham, R., & Singh, P. (2013). A combined approach to prevent SQL injection. In Science and Information Conference, London.
Esmaeilpour, M. (2016). A practical approach to data mining. Islamic Azad University, Hamedan.
Fang, Y., Peng, J., Liu, L., & Huang, C. (2018). WOVSQLI: Detection of SQL injection behaviors using word vector and LSTM. In Proceedings of the 2nd International Conference on Cryptography, Security and Privacy (ICCSP 2018), Guiyang. ACM. https://doi.org/10.1145/3199478.3199503
Gu, T., Dolan-Gavitt, B., & Garg, S. (2017). BadNets: Identifying vulnerabilities in the machine learning model supply chain. arXiv. https://arxiv.org/abs/1708.06733
Halfond, W. G. J., Orso, A., & Manolios, P. (2008). WASP: Protecting Web Applications Using Positive Tainting and Syntax-Aware Evaluation. IEEE Transactions on Software Engineering, 34(1), 65–81. https://doi.org/10.1109/tse.2007.70748
Hall, M., Frank, E., Holmes, G., Pfahringer, B., Reutemann, P., & Witten, I. H. (2009). The WEKA data mining software: An update. ACM SIGKDD Explorations Newsletter, 11(1), 10–18. https://doi.org/10.1145/1656274.1656278
Hanmanthu, B., Ram, B. R., & Niranjan, P. (2015). SQL Injection Attack prevention based on decision tree classification. In 2015 IEEE 9th International Conference on Intelligent Systems and Control (ISCO) (pp. 1–5). IEEE. https://doi.org/10.1109/isco.2015.7282227
Hastie, T., Tibshirani, R., & Friedman, J. (2003). The elements of statistical learning: Data mining, inference, and prediction. Springer.
Jokar, M. M. (2016). A deep look at network packets with Wireshark [in Persian]. Pendar Pars.
Kar, D., & Panigrahi, S. (2013). Prevention of SQL Injection attack using query transformation and hashing. In 2013 3rd IEEE International Advance Computing Conference (IACC) (pp. 1317–1323). IEEE. https://doi.org/10.1109/iadcc.2013.6514419
Kar, D., Sahoo, A. K., Agarwal, K., Panigrahi, S., & Das, M. (2016). Learning to detect SQLIA using node centrality with feature selection. In 2016 International Conference on Computing, Analytics and Security Trends (CAST) (pp. 18–23). IEEE. https://doi.org/10.1109/cast.2016.7914933
Komiya, R., Paik, I., & Hisada, M. (2011). Classification of malicious web code by machine learning. In 2011 3rd International Conference on Awareness Science and Technology (iCAST) (pp. 406–411). IEEE. https://doi.org/10.1109/icawst.2011.6163109
Lee, I., Jeong, S., Yeo, S., & Moon, J. (2012). A novel method for SQL injection attack detection based on removing SQL query attribute values. Mathematical and Computer Modelling, 55(1-2), 58–68. https://doi.org/10.1016/j.mcm.2011.01.050
Liu, Y., & Dai, Y. (2024). Deep Learning in Cybersecurity: A Hybrid BERT–LSTM Network for SQL Injection Attack Detection. IET Information Security, 2024(1), Article 5565950. https://doi.org/10.1049/2024/5565950
Lu, D., Fei, J., & Liu, L. (2023). A Semantic Learning-Based SQL Injection Attack Detection Technology. Electronics, 12(6), 1344. https://doi.org/10.3390/electronics12061344
M, G., & H B, P. (2022). Semantic Query-Featured Ensemble Learning Model for SQL-Injection Attack Detection in IoT-Ecosystems. IEEE Transactions on Reliability, 71(2), 1057–1074. https://doi.org/10.1109/tr.2021.3124331
McCamon, M. (2019, September 21). OWASP [Open source project]. https://www.owasp.org
Mitchell, T. M. (1997). Machine learning. McGraw-Hill.
Moh, M., Pininti, S., Doddapaneni, S., & Moh, T.-S. (2016). Detecting Web Attacks Using Multi-stage Log Analysis. In 2016 IEEE 6th International Conference on Advanced Computing (IACC) (pp. 733–738). IEEE. https://doi.org/10.1109/iacc.2016.141
Nejad Ghomi, A. A. J. (2012). MySQL training [in Persian]. Oloum.
Nejad Ghomi, A. A. J. (2016). PHP training [in Persian]. Oloum-e Rayaneh.
Ntagwabira, L., & Kang, S. L. (2010). Use of Query tokenization to detect and prevent SQL injection attacks. In 2010 3rd International Conference on Computer Science and Information Technology (pp. 438–440). IEEE. https://doi.org/10.1109/iccsit.2010.5565202
Oswald, K. (2019, October 12). Apache Friends. https://www.apachefriends.org
Pinzon, C., De Paz, J. F., Bajo, J., Herrero, A., & Corchado, E. (2010). AIIDA-SQL: An Adaptive Intelligent Intrusion Detector Agent for detecting SQL Injection attacks. In 2010 10th International Conference on Hybrid Intelligent Systems (pp. 73–78). IEEE. https://doi.org/10.1109/his.2010.5600026
Ross, K., Moh, M., Moh, T.-S., & Yao, J. (2018). Multi-source data analysis and evaluation of machine learning techniques for SQL injection detection. In Proceedings of the ACMSE 2018 Conference (pp. 1–8). ACM. https://doi.org/10.1145/3190645.3190670
Sajjadi, S. M. S., & Tajalli Pour, B. (2013). Study of SQL Injection Attacks and Countermeasures. International Journal of Computer and Communication Engineering, 539–542. https://doi.org/10.7763/ijcce.2013.v2.244
Sanders, C. (2011). Practical packet analysis: Using Wireshark to solve real-world network problems (2nd ed.). No Starch Press.
Tajbakhsh, M. (2011). Penetration testing guide with Kali Linux 2 [in Persian]. Pendar.
Tan, P.-N., Steinbach, M., & Kumar, V. (2006). Introduction to data mining. Pearson Addison Wesley.
Thalji, N., Raza, A., Islam, M. S., Samee, N. A., & Jamjoom, M. M. (2023). AE-Net: Novel Autoencoder-Based Deep Features for SQL Injection Attack Detection. IEEE Access, 11, 135507–135516. https://doi.org/10.1109/access.2023.3337645
Downloads
Published
Issue
Section
License
Copyright (c) 2026 DarnerView

This work is licensed under a Creative Commons Attribution-NonCommercial 4.0 International License.