Journal of Electrical and Computer Engineering

Ensemble Learning for SQL Injection Detection Using TF–IDF–Based Query Representation

Zain Wasef Marashdih, Mowafaq Salem Alzboon, Mohammad Subhi Al-Batah

Key points

From the paper's conclusion
  • These results indicate that TF–IDF–based query representation combined with ML models can provide effective SQLIA detection within the evaluated dataset.

Abstract

Structured Query Language Injection Attacks (SQLIAs) are among the most significant security threats to web applications, according to the Open Web Application Security Project (OWASP). These attacks enable unauthorized access to database information, compromising data security and application integrity. This study investigates machine learning (ML) models for SQLIA detection using a SQLIA dataset that was recently published on Kaggle. Textual queries were transformed into numerical features using term frequency–inverse document frequency (TF–IDF). To prevent data leakage, the dataset was first divided into training and testing subsets, and the TF–IDF vectorizer was fitted only on the training data before being applied to the test data. Random forest (RF), XGBoost, and an ensemble Voting Classifier were evaluated. In the experimental evaluation, 80% of the data was used for training and 20% for testing. Subsequently, experimental testing was conducted using 5‐fold cross‐validation. RF achieved the highest classification holdout accuracy of 99.48%, followed by the Voting Classifier with 99.41% and XGBoost with 99.39%. The Voting Classifier achieved the highest ROC–AUC score of 99.61%. These results indicate that TF–IDF–based query representation combined with ML models can provide effective SQLIA detection within the evaluated dataset. The findings highlight the importance of selecting appropriate classification models and robust validation strategies when dealing with high‐dimensional textual representations.

Read the paper

Discussion

Science Skim's AI key points, plus readers' public thoughts

Readers' thoughts

No reader thoughts yet.

Related papers

Ensemble Learning for SQL Injection Detection Using TF–IDF–Based Query Representation — Science Skim