A BERT-Based Approach for Detecting Cross-Site Scripting Attacks

Cross-site scripting (XSS) remains one of the most persistent threats to web application security, allowing attackers to inject malicious scripts that compromise user data and system integrity. Traditional detection methods, including rule-based approaches and conventional deep learning models, often fail to handle sophisticated obfuscation techniques and context-dependent payloads. To address these challenges, this paper proposes a BERT-based detection framework that formulates XSS detection as a binary text classification task. By leveraging BERT’s deep contextual representation capabilities, the model effectively captures nuanced semantic and structural features associated with malicious input. Extensive experiments on benchmark datasets—including payloads involving JavaScript obfuscation and URL encoding—demonstrate that the proposed method consistently outperforms traditional CNN-based models, hybrid variants (CNN+NLP, CNN+LSTM), and the GPT2-based baseline across all evaluation metrics.

Authors

Institutions

Publication Details

Published
2025-05-23
DOI
https://doi.org/10.1109/ecie65947.2025.11087084
Primary Topic
Web Application Security Vulnerabilities
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A BERT-Based Approach for Detecting Cross-Site Scripting Attacks

Quan Luo, Junxi Du, F. Zheng, Juan Guo
Web Application Security Vulnerabilities
article

A BERT-Based Approach for Detecting Cross-Site Scripting Attacks

Quan Luo, Junxi Du, F. Zheng, Juan Guo
article en

Abstract

Cross-site scripting (XSS) remains one of the most persistent threats to web application security, allowing attackers to inject malicious scripts that compromise user data and system integrity. Traditional detection methods, including rule-based approaches and conventional deep learning models, often fail to handle sophisticated obfuscation techniques and context-dependent payloads. To address these challenges, this paper proposes a BERT-based detection framework that formulates XSS detection as a binary text classification task. By leveraging BERT’s deep contextual representation capabilities, the model effectively captures nuanced semantic and structural features associated with malicious input. Extensive experiments on benchmark datasets—including payloads involving JavaScript obfuscation and URL encoding—demonstrate that the proposed method consistently outperforms traditional CNN-based models, hybrid variants (CNN+NLP, CNN+LSTM), and the GPT2-based baseline across all evaluation metrics.

Neusoft (China) (CN)
Openalex Percentile: Top 70%
Web Application Security Vulnerabilities
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.