Contextual Detection of Cross-Site Scripting Attacks Using RoBERTa-Based Deep Learning Model
DOI:
https://doi.org/10.19139/soic-2310-5070-3291Keywords:
Cross-Site Scripting, RoBERTa, Transformer Models, Machine Learning, Deep LearningAbstract
As internet usage grows, web applications remain vulnerable to Cross-Site Scripting attacks, in which malicious actors construct malicious scripts via user input, posing major threats to data security and program integrity. This paper presents a contextual detection method of cross-site scripting attacks using a RoBERTa based deep learning model, which uses advanced natural language understanding to observe payload patterns. The model's ability to understand contextual relationships reduces the need for manual feature engineering, resulting in a reliable solution for detecting both basic and sophisticated obfuscated assaults. To improve the model's contextual learning capabilities, the proposed methodology included carefully dataset selection and preprocessing procedures such as decoding, tokenization, and the removal of redundant patterns. The model underwent specialized fine-tuning using a balanced dataset of benign and malicious payloads. The results of the research show outstanding performance, with the model obtaining 99.38% accuracy and a false positive rate of 0.71%. These results indicate the model's ability to accurately detect different Cross-Site Scripting payloads while minimizing false detections. The findings make major contributions to web security by providing a highly accurate detection method for one of the most popular cybersecurity threats, laying the groundwork for future advances in automated threat detection.Downloads
Published
2026-05-31
How to Cite
Almansour, T. ., Almasri, M. M., & Nagro, S. A. (2026). Contextual Detection of Cross-Site Scripting Attacks Using RoBERTa-Based Deep Learning Model. Statistics, Optimization & Information Computing. https://doi.org/10.19139/soic-2310-5070-3291
Issue
Section
Research Articles
License
Copyright (c) 2026 Thamer Almansour, Marwah M. Almasri, Shimaa A. Nagro

This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication with the work simultaneously licensed under a Creative Commons Attribution License that allows others to share the work with an acknowledgement of the work's authorship and initial publication in this journal.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgement of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).