Comparison of Machine Learning Algorithms Used for Detecting XSS Attacks

Web security has become a critical concern due to the increasing sophistication of cyber threats, with Cross-Site Scripting (XSS) among the most prevalent attacks. Traditional rule-based detection struggles against adaptive threats, making machine learning a valuable alternative. This study evaluates the effectiveness of three machine learning models - Support Vector Machine (SVM), Logistic Regression (LR) and K-Nearest Neighbors (KNN) - for detecting XSS attacks. Experimental results indicate that SVM achieves the highest classification accuracy, efficiently distinguishing malicious from legitimate requests. LR provides a balance between performance and computational efficiency, while KNN demonstrates lower recall, limiting its effectiveness in detecting complex attacks. We emphasize the potential of machine learning in strengthening web security and improving XSS detection, with future research focusing on feature optimization and ensemble learning to improve detection accuracy.

Authors

Institutions

Publication Details

Published
2025-05-29
DOI
https://doi.org/10.1109/emes65692.2025.11045588
Primary Topic
Network Security and Intrusion Detection
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Comparison of Machine Learning Algorithms Used for Detecting XSS Attacks

Felicia Mirabela Costea, Mihaela Meze, Octavia-Maria Bolojan
Network Security and Intrusion Detection
article

Comparison of Machine Learning Algorithms Used for Detecting XSS Attacks

Felicia Mirabela Costea, Mihaela Meze, Octavia-Maria Bolojan
article en

Abstract

Web security has become a critical concern due to the increasing sophistication of cyber threats, with Cross-Site Scripting (XSS) among the most prevalent attacks. Traditional rule-based detection struggles against adaptive threats, making machine learning a valuable alternative. This study evaluates the effectiveness of three machine learning models - Support Vector Machine (SVM), Logistic Regression (LR) and K-Nearest Neighbors (KNN) - for detecting XSS attacks. Experimental results indicate that SVM achieves the highest classification accuracy, efficiently distinguishing malicious from legitimate requests. LR provides a balance between performance and computational efficiency, while KNN demonstrates lower recall, limiting its effectiveness in detecting complex attacks. We emphasize the potential of machine learning in strengthening web security and improving XSS detection, with future research focusing on feature optimization and ensemble learning to improve detection accuracy.

University of Oradea (RO)
Openalex Percentile: Top 84%
Network Security and Intrusion Detection
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.