EUVIMEDEUVIMED entdecken
Open Access · CC BY 4.0

Enhanced SQL injection detection using chi-square feature selection and machine learning classifiers

Emanuel Casmiry, Neema Mduma, Ramadhani Sinde

Frontiers in Big Data · 19.11.2025 · 8

DOI: 10.3389/fdata.2025.1686479 ↗

Kurz gefasst

Fachartikel in der Zeitschrift Frontiers in Big Data, online erschienen am 19.11.2025. Verfasst von Emanuel Casmiry und 2 weiteren Autor:innen. Beteiligte Einrichtung: Computational and Communication Science and Engineering (CoCSE), The Nelson Mandela African Institution of Science and Technology (NM-AIST), Arusha, …. Die Arbeit wurde bisher 7-mal zitiert (Crossref) und nennt 41 Literaturangaben. Der Volltext ist frei zugänglich (Open Access, CC BY 4.0).

AbstractSchlagwörterBibliografische AngabenZitierenVerwandte Studien

Abstract (Originalsprache)

In the face of increasing cyberattacks, Structured Query Language (SQL) injection remains one of the most common and damaging types of web threats, accounting for over 20% of global cyberattack costs. However, due to its dynamic and variable nature, the current detection methods often suffer from high false positive rates and lower accuracy. This study proposes an enhanced SQL injection detection using Chi-square feature selection (FS) and machine learning models. A combined dataset was assembled by merging a custom dataset with the SQLiV3.csv file from the Kaggle repository. A Jensen–Shannon Divergence (JSD) analysis revealed moderate domain variation (overall JSD = 0.5775), with class-wise divergence of 0.1340 for SQLi and 0.5320 for benign queries. Term Frequency-Inverse Document Frequency (TF-IDF) was used to convert SQL queries into feature vectors, followed by the Chi-square feature selection to retain the most statistically significant features. Five classifiers, namely multinomial Naïve Bayes, support vector machine, logistic regression, decision tree, and K-nearest neighbor, were tested before and after feature selection. The results reveal that Chi-square feature selection improves classification performance across all models by reducing noise and eliminating redundant features. Notably, Decision Tree and K-Nearest Neighbors (KNN) models, which initially performed poorly, showed substantial improvements after feature selection. The Decision Tree improved from being the second-worst performer before feature selection to the best classifier afterward, achieving the highest accuracy of 99.73%, precision of 99.72%, recall of 99.70%, F1-score of 99.71%, a false positive rate (FPR) of 0.25%, and a misclassification rate of 0.27%. These findings highlight the crucial role of feature selection in high-dimensional data environments. Future research will investigate how feature selection impacts deep learning architectures, adaptive feature selection, incremental learning approaches, robustness against adversarial attacks, and evaluate model transferability across production web environments to ensure real-time detection reliability, establishing feature selection as a vital step in developing reliable SQL injection detection systems.

Schlagwörter

Stichwörter der Autor:innen

SQL injectioncyberattacksfeature selectionhigh-dimensional datamachine learning

Autor:innen und Institutionen

  • Computational and Communication Science and Engineering (CoCSE), The Nelson Mandela African Institution of Science and Technology (NM-AIST), Arusha, Tanzania.

Zitieren

APA

Casmiry, E., Mduma, N., & Sinde, R. (2025). Enhanced SQL injection detection using chi-square feature selection and machine learning classifiers. Frontiers in Big Data, 8. https://doi.org/10.3389/fdata.2025.1686479

Vancouver

Casmiry E, Mduma N, Sinde R. Enhanced SQL injection detection using chi-square feature selection and machine learning classifiers. Frontiers in Big Data. 2025;8. doi:10.3389/fdata.2025.1686479

BibTeX
@article{Casmiry2025,
  author = {Casmiry, Emanuel and Mduma, Neema and Sinde, Ramadhani},
  title = {Enhanced SQL injection detection using chi-square feature selection and machine learning classifiers},
  journal = {Frontiers in Big Data},
  year = {2025},
  volume = {8},
  doi = {10.3389/fdata.2025.1686479}
}
Kostenlos starten →