arrow
Return

Machine-Learning-Based Detection of SQL Injection Attacks in Web Applications

delete2026-05-09
delete0
PRE
AI
A
Aldossary, Haya
N
Noura Aleisa *
DOI:10.3390/app16104691delete
deleteOriginal
deleteOriginal request for help
deleteShare
deleteSave
Abstract

Abstract

En 中文
The increasing development and prevalence of web applications have contributed to a surge in web attacks, with injection vulnerabilities considered amongst the most pivotal, widespread, and severe. SQL injection attacks are a substantial type of attack that exploits flaws in web applications to carry out malicious SQL commands. This study aims to evaluate the effectiveness of machine-learning algorithms for detecting SQL injection attacks based on query patterns. The proposed approach involves data preprocessing, employing machine learning (ML) algorithms such as XGBoost, AdaBoost, SVM, and Light Gradient Boost, and comparing their performance, which was applied using a publicly available SQL injection dataset from Kaggle. This study used two datasets: one for training and testing the classifier and one for evaluating its performance. The dataset was preprocessed using TF-IDF for feature extraction, and the models were evaluated using standard performance metrics, such as accuracy, precision, recall, and F1-score. Based on the test results, SVM outperforms all other models across all metrics with an accuracy of 0.9847, precision of 0.9847, recall of 0.9847, and F1-score of 0.9874, closely followed by XGBoost. Light Gradient Boost and AdaBoost exhibit lower performance across all metrics, suggesting that SVM and XGBoost are more effective classifiers for the dataset. These findings highlight the effectiveness of machine learning methods, especially SVM, in recognizing SQL injection attacks and enhancing web application security.
Keywords:
SQL injection
XGBoost
AdaBoost
SVM
Light Gradient Boost

Journal

A
Applied Sciences-Basel
IF:
2.5
Papers:
7.6K
Citations:
4

Organization

S
Saudi Electronic University
Scholars:
747
Papers: 895
Citations: 9
Cited Papers

Cited Papers

errShare
errSave
SQL Injection Attack: Quick View
err2023-02-14
err0
errOAAI
errVugar Abdullayev; Dr. Alok Singh Chauhan
errShare
errSave
A Proactive Approach for Detecting SQL and XSS Injection Attacks
err2024-06-05
err0
PREAI
errLakshmi,B. Siva; Kovvuri,Divya; Bolisetti,H N Valli; Chikkala,Dhana Sree; Karri,Sravanthi; Yadlapalli,Geetha
errShare
errSave
Learning to detect SQLIA using node centrality with feature selection
err2016-12-01
err0
PREAI
errDebabrata Kar; Ajit Kumar Sahoo; Khushboo Agarwal; Suvasini Panigrahi; Madhabananda Das
errShare
errSave
researcher View more