bit-Tech
Vol. 8 No. 3 (2026): bit-Tech

A Hybrid CNN-LSTM Approach for Detecting Cross-Site Scripting Attacks in Web Applications

Anugera, Eka Seftrian (Unknown)
Mirza, Anis (Unknown)



Article Info

Publish Date
10 Apr 2026

Abstract

Cross-Site Scripting (XSS) remains one of the most pervasive and persistent vulnerabilities in modern web applications, allowing attackers to inject and execute malicious scripts through user input fields. Conventional detection mechanisms based on static rules, blacklists, or handcrafted features often fail to recognize obfuscated or context-aware payloads, leading to severe gaps in real-time protection. This study proposes a hybrid deep learning architecture combining Convolutional Neural Networks (CNN) and Long Short-Term Memory (LSTM) to overcome these limitations by simultaneously capturing spatial patterns and sequential dependencies in character-level input. The model was trained and validated using both public XSS datasets and sanitized internal web logs to ensure robustness across diverse payload structures. Experimental results demonstrate high classification performance, achieving 98.67% accuracy, 98.21% precision, 99.29% recall, and an ROC-AUC of 0.9990. The hybrid CNN-LSTM architecture’s novel integration of local feature extraction and temporal context modeling enables superior generalization compared to conventional CNN or LSTM-only approaches. Beyond quantitative metrics, the model was deployed in a Flask-based web simulation to assess its real-world applicability, where it successfully detected and mitigated live XSS payloads in real time without disrupting benign user operations. These findings highlight the potential of hybrid deep learning models as adaptive, low-latency defenses for strengthening modern web application security infrastructures.

Copyrights © 2026






Journal Info

Abbrev

bt

Publisher

Subject

Computer Science & IT

Description

The bit-Tech journal was developed with the aim of accommodating the scientific work of Lecturers and Students, both the results of scientific papers and research in the form of literature study results. It is hoped that this journal will increase the knowledge and exchange of scientific ...