A XSS Attack Detection Method based on Skip List

Chun Shan, Jing Cui, Changzhen Hu, Jingfeng Xue, Hao Wang, Mhagama RaphaelInternational Journal of Security and Its Applications 2016

Abstract

In recent years, the destruction of cross-site scripting (XSS) attacks is gradually increasing, but the existing XSS defense methods have some problems, such as complex disposition, low performance, high non-response rates, or high rates of false positives. Therefore, it is imminent to establish an efficient XSS defense mechanism. This paper presents a cross-site scripting attacking detection method based on an improved skip list algorithm. It fulfills the rapid detection of cross-site scripting attacks through several steps, including creating a skip list signature, detecting suspicious strings, and marking attack vectors. Experiments show that compared with traditional XSS defense methods, this new approach reduces the false alarm rate and effectively improves time performance.

Introduction

Cross-Site Scripting (XSS) remains one of the most persistent threats in web security, consistently ranking high on the OWASP Top Ten. The challenge isn't just identifying an attack; it's doing so at scale without slowing down the user experience or drowning security teams in false positives.

Existing defense mechanisms often struggle with a "performance-accuracy trade-off." Complex regex-based engines or behavioral analysis tools can be computationally expensive (high latency) or difficult to deploy across diverse platforms. There is a specific need for a defense mechanism that is both lightweight enough for high-traffic environments and smart enough to recognize obfuscated attack vectors.

Proposed Detection Framework

The core innovation of this research is an optimized detection pipeline that leverages a probability-weighted Skip List data structure. Unlike standard skip lists that use random level assignment, this method prioritizes the most frequent attack signatures to achieve faster search times.

System architecture of the XSS detection framework, showing the initialization and detection modules.

The Detection Pipeline

As illustrated in the system architecture, the process involves two primary modules:

  1. Initialization Module: Attack vectors (AV) are loaded from a feature library (such as HA.CKKERS). These vectors are normalized, translated into MD5 hashes (represented as 64-bit integers), and inserted into the Skip List based on their probability of occurrence.
  2. Detection Module: Incoming HTTP requests from the browser are intercepted. The system performs:
  3. Decoding & Normalization: Revealing hidden scripts by decoding URL, Unicode, and HTML entities.
  4. Pre-screening: A simple pattern matcher checks for high-frequency "attack vocabulary" (e.g., javascript, alert). If absent, the request is dismissed as safe.
  5. Multi-mode Screening: Suspicious strings are processed using a Deterministic Finite Automaton (DFA) to extract subsequences.
  6. Skip List Search: Extracted signatures are hashed and compared against the optimized Skip List index.

Optimized Skip List Construction

In a standard Skip List, node levels are determined randomly to maintain $O(\log N)$ search time. This research improves upon this by using the probability distribution of known attack vectors. Signatures that appear more frequently in the wild are assigned to higher levels of the Skip List, allowing the search algorithm to find them much faster.

Structure of a multi-level skip list used for indexing attack signatures.

By converting complex, variable-length strings into fixed-length MD5 hashes, the Skip List performs numerical comparisons rather than string comparisons, which is significantly more efficient at the CPU level.

Experimental Results

The researchers utilized the HA.CKKERS library to build the feature index and XSSed.com to collect 1,000 POST requests, 1,000 GET requests, and 1,000 normal samples for benchmarking against the IISUTM (Internet Information Services URL Tool Mapper) framework.

Key results include:

  • Higher Accuracy: The method detected 880/1000 POST attacks and 887/1000 GET attacks, outperforming IISUTM in both categories.
  • Lower False Alarms: The false alarm rate for normal samples was reduced by 21.3% compared to the baseline.
  • Scalable Performance: At the 10,000-request level, the new method was 82% faster than traditional testing methods. Even at a scale of 1 million requests, it maintained a 20% performance lead.

Conclusion

The probability-weighted Skip List approach offers a significant improvement in XSS detection by turning a general-purpose data structure into a specialized security index. While highly effective for known signatures, future work will focus on integrating distributed technologies to handle even larger traffic volumes and expanding the feature library to better detect novel "Zero-Day" XSS patterns.

Summary updated

Abstract

In recent years, the destruction of cross-site scripting (XSS) attacks is gradually increasing, but the existing XSS defense methods have some problems, such as, complex disposition, low performance, high non-response rates or high rate of false positives. Therefore, it is imminent to establish an efficient XSS defense mechanism. This paper presents a cross-site scripting attacking detection method, which is based on improved algorithm skip list. It can fulfill the rapid detection of cross-site scripting attacks by using some steps, for example, creating a skip list signature, detecting suspicious strings, marking attack vectors and so on. Experiment shows that compared with the traditional defense method of XSS attack, the new defense method can reduce the false alarm rate of detection, and improve the time performance effectively.
BibTeX
@article{shan2016xss,
  author = {Chun Shan and Jing Cui and Changzhen Hu and Jingfeng Xue and Hao Wang and Mhagama Raphael},
  title = {{A XSS Attack Detection Method based on Skip List}},
  journal = {International Journal of Security and Its Applications},
  year = {2016},
  doi = {10.14257/ijsia.2016.10.5.09},
}
Figure