Adversarial testing of machine learning models designed for SQL injection detection

Elena S. Egorova, Olga R. Laponina

Abstract


SQL injection remains one of the most prevalent web application vulnerabilities, consistently ranked among the most critical security threats according to the OWASP classification. In response to the increasing complexity of such attacks, contemporary research and engineering approaches have actively adopted machine learning (ML) and deep learning (DL) techniques for the automated detection of malicious SQL queries. Despite their high classification accuracy on static datasets, these models are susceptible to adversarial attacks—intentionally crafted inputs that preserve both the syntactic validity and semantic equivalence of the original queries but disrupt the model’s decision logic. This paper presents a method for adversarial testing of machine learning models designed for SQL injection detection. The proposed approach is based on the sequential application of mutation operators that maintain the syntactic correctness and semantic equivalence of the input queries. The algorithm is implemented as an iterative process aimed at reducing the model’s confidence in identifying a malicious query, while operating under black-box constraints without access to internal parameters or architecture. The method has been experimentally validated on three model architectures: MobileBERT, LSTM, and a hybrid CNN-LSTM. The evaluation results demonstrate a notable decrease in precision and recall for the injection class after applying adversarial mutations. The proposed framework serves as an effective tool for objective assessment of model robustness against polymorphic SQL injections and provides a foundation for developing more resilient security systems. Due to its universality and reproducibility, the method is also applicable for augmenting training datasets in adversarial learning settings. Furthermore, it holds potential for adaptation to other types of text-based attacks (e.g., XSS) and integration into industrial-grade web application security solutions.


Full Text:

PDF (Russian)

References


OWASP Top Ten // OWASP. 2020. URL: https://owasp.org/www-project-top-ten/ (Data obrashhenija: 01.05.2025).

Wang Y., Kosinski M. Deep neural networks are more accurate than humans at detecting sexual orientation from facial images //Journal of personality and social psychology. – 2018. – T. 114. – #. 2. – S. 246.

Kolhe A. K., Adhikari P. A SQL Injection: Internal Investigation of Injection, Detection and Prevention of SQL Injection Attacks //International Journal of Engineering Research & Technology (IJERT). – 2014. – T. 3. – #. 1.

Demetrio L. et al. Waf-a-mole: evading web application firewalls through adversarial machine learning //Proceedings of the 35th Annual ACM Symposium on Applied Computing. – 2020. – S. 1745-1752.

Guan Y. et al. Ssqli: A black-box adversarial attack method for sql injection based on reinforcement learning //Future Internet. – 2023. – T. 15. – #. 4. – S. 133.

Alqhtani M., Alghazzawi D., Alarifi S. Black-Box Adversarial Attacks Against SQL Injection Detection Model //Contemporary Mathematics. – 2024. – S. 5098-5112.

Boekweg K. I. Developing a SQL Injection Exploitation Tool with Natural Language Generation : dis. – Brigham Young University, 2024.

Judova E. A., Laponina O. R. Sravnitel'nyj analiz podhodov k obnaruzheniju SQL-in"ekcij s pomoshh'ju metodov mashinnogo obuchenija //International Journal of Open Information Technologies. – 2023. – T. 11. – #. 6. – S. 175-181.

Alghawazi M., Alghazzawi D., Alarifi S. Detection of sql injection attack using machine learning techniques: a systematic literature review //Journal of Cybersecurity and Privacy. – 2022. – T. 2. – #. 4. – S. 764-777.

Gandhi N. et al. A CNN-BiLSTM based approach for detection of SQL injection attacks //2021 International conference on computational intelligence and knowledge economy (ICCIKE). – IEEE, 2021. – S. 378-383.

Kakisim A. G. A deep learning approach based on multi-view consensus for SQL injection detection //International Journal of Information Security. – 2024. – T. 23. – #. 2. – S. 1541-1556.

Zhang W. et al. Deep Neural Network‐Based SQL Injection Detection Method //Security and Communication Networks. – 2022. – T. 2022. – #. 1. – S. 4836289.

Tang P. et al. Detection of SQL injection based on artificial neural network //Knowledge-Based Systems. – 2020. – T. 190. – S. 105528.

Xie X. et al. Sql injection detection for web applications based on elastic-pooling cnn //IEEE Access. – 2019. – T. 7. – S. 151475-151481.

Finlayson S. G. et al. Adversarial attacks on medical machine learning //Science. – 2019. – T. 363. – #. 6433. – S. 1287-1289.

Alatwi H. A., Aldweesh A. Adversarial black-box attacks against network intrusion detection systems: A survey //2021 IEEE World AI IoT Congress (AIIoT). – IEEE, 2021. – S. 0034-0040.

Yan S. et al. A survey of adversarial attack and defense methods for malware classification in cyber security //IEEE Communications Surveys & Tutorials. – 2022. – T. 25. – #. 1. – S. 467-496.

Carlini N., Wagner D. Adversarial examples are not easily detected: Bypassing ten detection methods //Proceedings of the 10th ACM workshop on artificial intelligence and security. – 2017. – S. 3-14

Suhomlin, Vladimir Aleksandrovich. "Sozdanie profilja" Kiberbezopasnost' i iskusstvennyj intellekt" dlja napravlenija podgotovki FIIT na osnove kurrikulumnogo podhoda." Sovremennye informacionnye tehnologii i IT-obrazovanie 17.3 (2021): 724-734.

Korniukhina, Sofia P., and Olga R. Laponina. "Research of the Capabilities of Deep Learning Algorithms to Protection Against Phishing Attacks." International Journal of Open Information Technologies 11.6 (2023): 163-174.

Zubrienko, G. A., and O. R. Laponina. "Data Sampling Techniques for Anomaly Detection in Network Traffic." International Journal of Open Information Technologies 4.10 (2016): 1-8.

O rabotah po cifrovoj jekonomike / V. P. Kuprijanovskij, D. E. Namiot, S. A. Sinjagov, A. P. Dobrynin // Sovremennye informacionnye tehnologii i IT-obrazovanie. – 2016. – T. 12, # 1. – S. 243-249. – EDN XEQRFJ.

Roznichnaja torgovlja v cifrovoj jekonomike / V. P. Kuprijanovskij, S. A. Sinjagov, D. E. Namiot [i dr.] // International Journal of Open Information Technologies. – 2016. – T. 4, # 7. – S. 1-12. – EDN WCMIWN.


Refbacks

  • There are currently no refbacks.


Abava  Кибербезопасность ИБП для ЦОД СНЭ

ISSN: 2307-8162