|
International Journal of Computer Applications
Foundation of Computer Science (FCS), NY, USA
|
| Volume 187 - Issue 82 |
| Published: February 2026 |
| Authors: Eka Patriya, Purwanti, Maulana Mujahidin |
10.5120/ijca2026926442
|
Eka Patriya, Purwanti, Maulana Mujahidin . LoRA Based Fine Tuning of CodeBERT for SQL Injection and Cross-Site Scripting Detection in PHP Source Code. International Journal of Computer Applications. 187, 82 (February 2026), 63-70. DOI=10.5120/ijca2026926442
@article{ 10.5120/ijca2026926442,
author = { Eka Patriya,Purwanti,Maulana Mujahidin },
title = { LoRA Based Fine Tuning of CodeBERT for SQL Injection and Cross-Site Scripting Detection in PHP Source Code },
journal = { International Journal of Computer Applications },
year = { 2026 },
volume = { 187 },
number = { 82 },
pages = { 63-70 },
doi = { 10.5120/ijca2026926442 },
publisher = { Foundation of Computer Science (FCS), NY, USA }
}
%0 Journal Article
%D 2026
%A Eka Patriya
%A Purwanti
%A Maulana Mujahidin
%T LoRA Based Fine Tuning of CodeBERT for SQL Injection and Cross-Site Scripting Detection in PHP Source Code%T
%J International Journal of Computer Applications
%V 187
%N 82
%P 63-70
%R 10.5120/ijca2026926442
%I Foundation of Computer Science (FCS), NY, USA
Web application vulnerabilities such as SQL Injection (SQLi) and Cross-Site Scripting (XSS) remain critical security threats, particularly in PHP-based applications. Although recent advances in pretrained language models have shown strong potential for automated source code vulnerability detection, conventional fine-tuning approaches often incur high computational and memory costs. This paper proposes a parameter-efficient vulnerability detection framework based on LoRA based fine-tuning of CodeBERT for classifying PHP source code into SQL Injection, XSS, and benign categories. The proposed approach integrates systematic source code preprocessing, Byte Pair Encoding–based tokenization, and Low-Rank Adaptation to significantly reduce the number of trainable parameters while preserving the representational power of the pretrained model. Experimental results show that the proposed method achieves high detection performance, reaching an overall accuracy of 97% while fine-tuning less than 1% of the total model parameters. These findings demonstrate that LoRA-enhanced CodeBERT provides an effective and computationally efficient solution for automated SQL Injection and XSS detection in PHP source code, making it suitable for practical deployment in resource-constrained environments.