A Vulnerability Detection Method for Internet Cross-site Scripting Based on Relationship Diagram Convolutional Networks

Zhida Guo, Xiaoli Li, Ran Hu, Dapeng Wang, Weijie SongJournal of Web Engineering 2025

Abstract

This research presents a high-speed, high-accuracy method for detecting Cross-Site Scripting (XSS) attacks by combining domain-specific ontologies with Relationship Diagram Convolutional Networks (R-GCN). By modeling XSS attacks through a domain-specific ontology and extracting word vectors from normalized attack data, the system feeds these into an attention-enhanced R-GCN (DR-GAT). The model further incorporates real-time threat intelligence, such as malicious domain and IP information, as supplementary rules. Experimental results demonstrate a 90.27% accuracy rate and a detection speed of 0.03 seconds, significantly outperforming traditional machine learning and literature-based methods.

Introduction

Cross-Site Scripting (XSS) remains one of the most prevalent and dangerous vulnerabilities on the internet, allowing attackers to inject malicious scripts into trusted websites. While many detection methods exist, they often suffer from high latency, making them unsuitable for real-time defense, or poor contextual awareness, treating attack scripts as simple sequences of text rather than structured code. This paper addresses these gaps by proposing a "white box" model that understands the structural and logical relationships between different parts of an XSS attack.

Methodology

The proposed detection framework integrates domain knowledge with deep learning through a multi-stage pipeline, moving from raw data to a structured graph representation.

Overall architecture of the XSS vulnerability detection system.

Ontology Construction and Data Preparation

Using domain knowledge, the researchers built an XSS ontology to model high-level concepts of an attack, such as "Sensitive Vocabulary," "Jump Links," and "Input Length Exceptions." This ontology allows for high-level modeling of the attack process and the relationships between various malicious indicators.

XSS attack ontology modeling.

To prepare the data, the system standardizes attack payloads through normalization (e.g., unifying URLs and numbers) to reduce noise and prevent overfitting. These tokens are then transformed into dense vectors using the Word2vec Skip-gram model, capturing semantic similarities between attack components.

The DR-GAT Model

The core innovation is the Relationship Diagram Convolutional Network with an Attention Mechanism (DR-GAT). Unlike standard GCNs, this model considers the type and direction of relationships between nodes in the attack graph. The attention mechanism allows the network to weigh certain "neighbor" nodes more heavily, focusing on the most critical parts of a malicious payload. After extracting node characteristics through convolution and pooling, the features are aggregated and fed into a fully connected neural network for classification.

Hybrid Rule Engine

The neural network is supplemented by a rule-based system that checks incoming requests against known malicious IP and domain name blacklists. This integration of threat intelligence provides an extra layer of defense, improving the overall effectiveness and reliability of the detection process.

Experimental Results

The researchers evaluated the DR-GAT method using the UNSW-NB15 dataset, a comprehensive network security benchmark containing over 3.5 million records, including diverse attack types like Fuzzers and simulated XSS attacks.

  • Superior Accuracy: The method achieved an accuracy of 90.27%, significantly outperforming the baseline textual methods (68.99%) and other literature-based models (58%–66%).
  • High Efficiency: The detection time was clocked at a remarkable 0.03 seconds, which is 3x to 7x faster than comparison methods.
  • Real-World Validation: In tests on a corporate network, the system successfully detected 58 XSS vulnerabilities across various categories (Persistent, Reflective, DOM-based) with only one false positive.

Conclusion

By treating XSS attacks as graphs rather than simple strings, the proposed R-GCN framework achieves a balance between deep contextual understanding and high-speed performance. The integration of domain ontologies and real-time threat intelligence provides a robust defense mechanism capable of maintaining internet security at wire-speed. Future work may involve adapting this framework for other injection-style attacks, such as SQL injection.

Summary updated

BibTeX
@article{guo2025vulnerability,
  author = {Zhida Guo and Xiaoli Li and Ran Hu and Dapeng Wang and Weijie Song},
  title = {{A Vulnerability Detection Method for Internet Cross-site Scripting Based on Relationship Diagram Convolutional Networks}},
  journal = {Journal of Web Engineering},
  year = {2025},
  doi = {10.13052/jwe1540-9589.2424},
}
Figure