TELKOMNIKA (Telecommunication Computing Electronics and Control)
Vol 24, No 5: October 2026

Enhancing SQL injection detection accuracy with fine-tuning LLaMa 3.2 1B using low-rank adaptation

Diash Firdaus (Institut Teknologi Nasional Bandung (ITENAS))
Idi Sumardi (Al-Ghifari University)
Muhammad Ichwan (Institut Teknologi Nasional Bandung (ITENAS))
Maulana Seno Aji Yudhantara (Institut Teknologi Nasional Bandung (ITENAS))



Article Info

Publish Date
01 Oct 2026

Abstract

Structured query language injection (SQL injection/SQLi) remains a critical threat to web application security, particularly because it can bypass traditional detection systems through obfuscation. Existing approaches, including rule-based systems and classical machine learning (ML) models, often fail to capture the contextual semantics of com0plex SQL queries. This study proposes a lightweight and context-aware SQLi detection model by fine-tuning the large language model Meta artificial intelligence (LLaMA) 3.2–1B large language model using low-rank adaptation (LoRA). The model was trained using the SQL-Injection-Extend dataset obtained from Kaggle, consisting of 57,310 malicious SQLi samples and 52,208 benign user-input samples. The benign data comprise general user-generated text commonly submitted through web application interfaces. Experimental results demonstrate that the proposed model achieves an accuracy of 99.91%, precision of 99.96%, recall of 99.86%, and an F1-score of 99.91%, outperforming baseline models including convolutional neural network (CNN), long short-term memory (LSTM), and non-fine-tuned large language models (LLMs). These findings indicate that LoRA-based fine-tuning substantially enhances detection performance while maintaining computational efficiency, making the approach suitable for real-time deployment in modern web security systems. Furthermore, the integration of context-aware digital forensic reporting supports post-incident investigation and improves the interpretability of detection outcomes.

Copyrights © 2026






Journal Info

Abbrev

TELKOMNIKA

Publisher

Subject

Computer Science & IT

Description

Submitted papers are evaluated by anonymous referees by single blind peer review for contribution, originality, relevance, and presentation. The Editor shall inform you of the results of the review as soon as possible, hopefully in 10 weeks. Please notice that because of the great number of ...