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
- Enhancing Web Application Firewalls with Machine Learning for SQL Injection DetectionarXiv · 2026
- Enhanced SQL injection detection using chi-square feature selection and machine learning classifiersFrontiers in Big Data · 2025
- A Hybrid Deep Learning Model for SQL Injection Attack DetectionIEEE Access · 2026
- SeqSQLi: Sequential SQL Injection WAF Bypass via Deep Reinforcement LearningElectronics · 2026
- Are Your LLM-based Text-to-SQL Models Secure? Exploring SQL Injection via Backdoor AttacksProceedings of the ACM on Management of Data · 2025
- Duplicate leakage and evaluation integrity on a public synthetic sleep-health tabular dataset: A methodological case study.Computers in biology and medicine · 2026