arXiv:2610.31984cs.CROct 2026

Manuscript Offprint

arXiv:2610.31984

WADE: An LSTM-Based Anomaly Detection Engine for WebAssembly Applications

Ilaria Campestrini, Stefano Zanero, Engin Kirda

Ilaria Campestrini ∗^{*} †^{\dagger}, Stefano Zanero ∗^{*}, and Engin Kirda †^{\dagger}

  • Politecnico di Milano, Milan, Italy

† Northeastern University, Boston, MA, USA

Abstract. WebAssembly (Wasm) enables near-native performance for web applications through a portable and sandboxed execution model. However, its limited runtime protection mechanisms (e.g., the lack of stack canaries and address space layout randomization (ASLR)) leave Wasm applications vulnerable to traditional attacks.

We present WADE (WebAssembly Anomaly Detection Engine), a system that detects anomalous runtime behaviors in browser-executed WebAssembly applications. WADE monitors function-level execution traces collected under benign conditions and trains a Long Short-Term Memory (LSTM) network to learn the normal execution behavior of each application. At runtime, the model flags deviations from these learned patterns as potential attacks. Unlike signature-based approaches, WADE builds application-specific behavioral models, enabling detection of both known and previously unseen attacks without per-vulnerability signatures.

We evaluate WADE on a dataset of 67 WebAssembly applications spanning ten vulnerability classes, achieving zero false negatives and a 0.42% false positive rate.

Keywords: WebAssembly Security · Anomaly Detection · Runtime Monitoring

1 Introduction

WebAssembly (Wasm) has rapidly evolved into a key technology for high-performance web applications. It provides a portable, low-level binary format that enables near-native execution speeds in the browser, supporting a wide range of use cases (e.g., from 3D rendering and gaming to cryptographic computations and machine learning inference) directly on the client side. Its efficiency, combined with language-agnostic compilation support, has made WebAssembly an integral component of modern web platforms.

Although Wasm was designed with security in mind, it still exposes a non-negligible attack surface. Its sandboxing model enforces isolation between the executing module and the host environment, and its type-safe interface prevents certain classes of memory violations. However, several critical runtime protection mechanisms commonly available in native environments are absent. As a result, traditional memory-corruption attacks, including buffer overflows and format-string vulnerabilities, can still subvert a WebAssembly module's control flow and compromise its intended execution logic within the sandbox.

As WebAssembly gains adoption in performance-critical and security-sensitive contexts (e.g., browser-based cryptographic libraries, blockchain clients, and enterprise web tools), the lack of advanced runtime protection mechanisms becomes an increasingly pressing concern. Detecting and mitigating malicious behavior within Wasm applications thus represents an important and timely research challenge.

We address this gap with WADE (WebAssembly Anomaly Detection Engine), a system for detecting anomalous execution behaviors in browser-based WebAssembly applications. WADE monitors function-level execution traces and trains an LSTM model on benign sequences to learn the normal behavior of each application.

Signature- and rule-based defenses require manually specifying allowed behaviors. For modern Wasm applications, the space of legitimate execution paths is large and input-dependent, making comprehensive rule construction brittle and difficult to maintain. We instead adopt a learning-based approach that models normal function-level execution sequences from benign traces and flags unlikely deviations, enabling detection of previously unseen exploits without per-vulnerability signatures.