PulseExploreJournal ClubDebatesTrendingResearchersJournals
Instagram
HomeExploreJournal ClubTrending
Synapse
⌘+K
Synapse
May 15, 2026Applied Sciences0 citationsOpen Access

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

View Full Paper
HAHaya AldossaryNANoura Aleisa

Key Points

  • This study aims to assess how well machine-learning algorithms can detect SQL injection attacks based on query patterns.
  • Utilized machine learning algorithms including XGBoost, AdaBoost, SVM, and Light Gradient Boost.
  • Employed TF-IDF for feature extraction from a publicly available SQL injection dataset from Kaggle.
  • Evaluated model performance using accuracy, precision, recall, and F1-score metrics.
  • SVM achieved an accuracy of 0.9847, precision of 0.9847, recall of 0.9847, and F1-score of 0.9874.
  • XGBoost followed closely in performance metrics but was outperformed by SVM.
  • Light Gradient Boost and AdaBoost showed lower effectiveness in all evaluated metrics.

Abstract

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.

Ask AI
Helpful
Bookmark
Share
View Full Paper

Cite This Study

Aldossary et al. (2026) studied this question.

synapsesocial.com/papers/6a06b8f8e7dec685947ab6eehttps://doi.org/10.3390/app16104691
Ask AI
Helpful
Bookmark
Share
View Full Paper