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.
The Detection Pipeline
As illustrated in the system architecture, the process involves two primary modules:
- 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.
- Detection Module: Incoming HTTP requests from the browser are intercepted. The system performs:
- Decoding & Normalization: Revealing hidden scripts by decoding URL, Unicode, and HTML entities.
- Pre-screening: A simple pattern matcher checks for high-frequency "attack vocabulary" (e.g.,
javascript,alert). If absent, the request is dismissed as safe. - Multi-mode Screening: Suspicious strings are processed using a Deterministic Finite Automaton (DFA) to extract subsequences.
- 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.
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