SQLShield: Leakage-resistant SQL Injection Detection with Fine-tuned CodeBERT, Classical Baselines, and Cross-source Evaluation
High benchmark accuracy in SQL injection (SQLi) detection can mislead when preprocessing leakage, nearduplicate variants, baseline representation, and source shift are left uncontrolled.SQLShield is a leakage-resistant evaluation framework comparing fine-tuned CodeBERT and BERT-base against four word-level and two characterlevel TF-IDF baselines on a 56,621-query corpus partitioned by normalized-text group.On the fixed 5,654-query test set, CodeBERT reaches 99.95% accuracy (95% Wilson CI: 99.84-99.98)with three errors, but a character 3-5-gram LinearSVC reaches 99.84% with nine at a fraction of the training cost, and the paired difference is not statistically significant (exact McNemar p=0.109375).Across three independent group-aware partitions the ordering of the leading models is unstable: the six-error gap falls to zero at one partition, and BERT-base and the character baseline change places.On overlap-free cross-source residuals all eight models fail in one direction, at balanced accuracy between 0.501 and 0.559, while the direction that does transfer separates them by an order of magnitude in false positives on the same residual: 5 for the character baseline, 128 for BERT-base and 769 for CodeBERT.Performance survives near-duplicate family consolidation down to Jaccard 0.7.Cross-source transfer is sharply asymmetric: A->B retains discrimination (ROC-AUC=0.99025)whereas B->A collapses at the transferred operating point (balanced accuracy=0.5039)while retaining above-chance ranking (ROC-AUC=0.7033).Neither mixed-source benchmark accuracy nor model class alone establishes source portability.
Authors
- Loui Al Sardy (ORCID: https://orcid.org/0000-0002-8461-5154)
- Osama K. Qtaish (ORCID: https://orcid.org/0000-0003-4099-3062)
- Mahmoud Khalid Baklizi (ORCID: https://orcid.org/0000-0002-4164-2611)
- Mohammad Alkhazaleh (ORCID: https://orcid.org/0000-0002-4630-7783)
- Musab Zghoul
Institutions
- Friedrich-Alexander-Universität Erlangen-Nürnberg (DE)
- Petra University (JO)
- Isra University (JO)
Publication Details
- Journal
- International journal of intelligent engineering and systems
- Published
- 2026-11-17
- DOI
- https://doi.org/10.22266/ijies2026.1231.37
- Primary Topic
- Web Application Security Vulnerabilities
- Type
- article
- Field-Weighted Citation Impact
- 0.00