MatriXSSed: A New Taxonomy for XSS in the Modern Web

Dolière Francis SoméWWW 2025 · OpenReview

TL;DR

The traditional "reflected vs. stored" matrix for Cross-Site Scripting (XSS) is no longer sufficient for the modern web. This paper introduces MatriXSSed, a new taxonomy that accounts for complex features like Service Workers, Edge computing, and WebAssembly, treating persistence as a continuum rather than a binary toggle.

What Problem Does This Paper Address?

For over two decades, the security community has categorized XSS using a simple 2x2 matrix: Is it client-side or server-side? Is it reflected (temporary) or stored (persistent)?

However, the web architecture has evolved into a multi-layered ecosystem. We now have Service Workers acting as programmable proxies in the browser, Edge Workers running serverless code at the CDN level, and WebAssembly (Wasm) providing a completely new execution environment alongside JavaScript. These technologies create "gray areas" that the old taxonomy can't describe. For instance, if a payload is reflected by an Edge Worker but then cached by a Service Worker, is it reflected or stored? The authors argue that our current mental models are imprecise, making it harder to defend against sophisticated, modern injection attacks.

Methods

The authors move away from rigid boxes and propose a descriptive framework based on two phases:

  1. Infection (The Delivery): How the malicious code gets into the system.
  2. Affection (The Execution): How and where the code actually runs.

To build this, they analyze the "precedence" and "persistence" of modern web components. They specifically investigate:

  • Context Isolation: How Workers and Worklets execute in threads separate from the main UI.
  • Storage Hierarchies: Comparing the lifespan of data in sessionStorage versus the newer, more permanent File System Access (FSA) API.
  • The "Service-Worker-Allowed" (SWA) Header: They perform a security analysis of this header to see how it can be abused to expand an attacker's scope.

Datasets

This is a theoretical and architectural paper rather than a large-scale empirical study. Instead of a traditional dataset, the authors use a comparative mapping (Figure 5 in the paper) where they take known high-profile XSS research from the last decade (e.g., studies on DOM-based XSS and Service Worker security) and "re-map" them into their new taxonomy to prove its expressiveness.

Key Insights and Ideas

  • Persistence is a Continuum: Instead of "persistent vs. non-persistent," the authors suggest a spectrum. A payload in the File System Access API is "more persistent" than one in localStorage because it can survive browser uninstalls and OS updates.
  • The Proxy Power of Service Workers: Service Workers can intercept all network requests for an origin. The authors highlight "Cache Collision" attacks, where a Service Worker can be tricked into serving a reflected XSS payload to every single user of a site, effectively turning a "one-off" attack into a global, persistent infection.
  • WebAssembly as a Dark Corner: While most XSS research focuses on JavaScript, Wasm is a compiled execution environment that can also be a sink for malicious code, yet it is often overlooked by current security scanners and Content Security Policies (CSP).
  • The SWA Header Exploit: The most striking "aha moment" is the demonstration of how an attacker with limited access to a subdirectory (like example.com/~attacker/) can use a server-side script to set the Service-Worker-Allowed: / header. This allows their malicious Service Worker to seize control of the entire domain, including other users' private directories.

Key Results

  • A New Taxonomy: The paper successfully maps 12 distinct modern attack scenarios that the old OWASP matrix struggled to categorize.
  • Domain Takeover Proof-of-Concept: The authors successfully mounted the SWA header attack in controlled environments across multiple Linux distributions (Debian, Ubuntu, Fedora) using standard Apache/PHP setups.
  • Defense Gap Analysis: They reveal that Content Security Policy (CSP) is significantly less effective in Worker contexts. For example, many CSP directives (like nonces or hashes) are not supported in Workers, and the script-src directive behaves differently, leaving a gap for attackers to exploit.

Limitations and Future Work

The authors acknowledge that while their taxonomy is more flexible, the web continues to change. Specifically:

  • Wasm Vulnerabilities: There is currently very little prior work or real-world data on XSS specifically targeting WebAssembly sinks; this remains a theoretical but high-risk area.
  • Automated Tooling: The paper provides the framework, but it does not provide an automated scanner to detect these "MatriXSSed" attacks. Developing tools that can trace data flows across Service Workers and Edge Workers is a suggested next step.
  • Browser Implementation: Some features, like the File System Access API, are currently only supported in Chromium-based browsers, meaning the "permanent" persistence threats are currently platform-specific.

Summary updated

Abstract

Cross-site scripting (XSS) constantly remains one of the most prevalent attacks on the Web. In this work, we question its current taxonomy, i.e., the client- or server-side reflected (non-persistent) or stored (persistent) matrix. The Web has extensively changed. Consequently, considering XSS with the lenses of this famous matrix has become at least imprecise, at most impossible for many code injection scenarios where (i) a service worker or an edge worker generates HTTP responses and can reflect or persist XSS payloads infecting not only JavaScript in web pages but also Web assembly, web workers and affecting one or many users automatically; (ii) an attacker sends a web push message directly to a browser push service to trigger code execution in a dormant service worker; or (iii) a cross-origin adversary tampers with code stored by a vulnerable website on the user’s physical/permanent file system, etc. Our proposal –to get out of the matrix and not enter another rigid one– expresses the essence of XSS as code infection and affection attack, and allows for clearly specifying the different actors and components involved, their environments, contexts and storages, as well as their recurrence and persistence seen as a continuum rather than a binary marker. From a defensive perspective, we showcase the challenges and limitations of current mechanisms at mitigating XSS targetting the entire attack surface of modern websites. Finally, we demonstrate an abuse of the Service-Worker-Allowed header (SWA) to control entire domains with malicious service workers.
BibTeX
@inproceedings{some2025matrixssed,
  author = {Dolière Francis Somé},
  title = {{MatriXSSed: A New Taxonomy for XSS in the Modern Web}},
  booktitle = {The Web Conference},
  year = {2025},
  url = {https://openreview.net/forum?id=iRQkdpfW02},
}
Figure