A Novel Runtime Monitoring Framework for WebAssembly-Obfuscated Malicious JavaScript Classification

Authors:

Abstract
The rapid proliferation of malicious websites has significantly escalated cyber-attacks and data breaches, with JavaScript (JS) often used to exploit web browsers. Recently, attackers have begun leveraging WebAssembly not only as a direct vehicle for malicious behavior, but also as an advanced evasion technique-offloading or hiding parts of malicious logic in WebAssembly modules to bypass traditional JS-based detection systems. Despite this emerging trend, WebAssembly-based evasion on web pages remains underexplored in existing research. In this work, we introduce JSWasM, the first dynamic analysis framework specifically designed to uncover and analyze WebAssembly-based evasion techniques in JavaScript-driven attacks. Rather than focusing on detecting malicious WebAssembly code itself, JSWasM identifies how WebAssembly is misused to obfuscate JavaScript behavior and evade analysis techniques. The system employs a security reference monitor to track function calls and property accesses, including interactions between JavaScript and embedded WebAssembly modules, enabling fine-grained behavioral analysis of scripts regardless of structural complexity. Implemented as a pure JS library and deployed as a Chromium-based browser extension, JSWasM enables integration with the browser environment to capture and log runtime activities across both JS and WebAssembly contexts. It also allows security experts to configure which operations to monitor and different metrics, such as event accumulation vector or order sequence, to support various analysis approaches. Our evaluation confirms that JSWasM outperforms the state-of-the-art dynamic analysis approaches in two main areas: capturing WebAssembly-obfuscated malicious behaviors and performing maliciousness classifications. Specifically, our framework effectively identifies evasive techniques based on WebAssembly obfuscation, which static and JavaScript-only dynamic analysis methods fail to detect. Additionally, it achieves the highest accuracy in classifications compared to related methods, thanks to its capability to observe and correlate behaviors across both JavaScript and WebAssembly contexts in real-time. These results demonstrate that JSWasM is the first systematic solution in the literature addressing this emerging class of obfuscation techniques within the web ecosystem.