WebAssembly's (Wasm) monolithic linear memory model facilitates memory corruption attacks that can escalate to cross-site scripting in browsers or go undetected when a malicious host tampers with a module's state. Existing defenses rely on invasive binary instrumentation or custom runtimes, and do not address runtime integrity verification under an adversarial host model. We present Walma, a framework for WebAssembly Linear Memory Attestation that leverages machine learning to detect memory corruption and external tampering by classifying memory snapshots. We evaluate Walma on six real-world CVE-affected applications across three verification backends (cpu-wasm, cpu-tch, gpu) and three instrumentation policies. Our results demonstrate that CNN-based classification can effectively detect memory corruption in applications with structured memory layouts, with coarse-grained boundary checks incurring as low as 1.07x overhead, while fine-grained monitoring introduces higher (1.5x--1.8x) but predictable costs. Our evaluation quantifies the accuracy and overhead trade-offs across deployment configurations, demonstrating the practical feasibility of ML-based memory attestation for WebAssembly.
翻译:WebAssembly(Wasm)的单块线性内存模型助长了内存损坏攻击,这类攻击可能在浏览器中升级为跨站脚本攻击,或在恶意主机篡改模块状态时未被检测到。现有防御措施依赖侵入式二进制插桩或定制化运行时,且未解决在对抗性主机模型下的运行时完整性验证问题。我们提出Walma,一个利用机器学习通过分类内存快照来检测内存损坏和外部篡改的WebAssembly线性内存证明框架。我们在六个实际受CVE影响的应用程序上,使用三个验证后端(cpu-wasm、cpu-tch、gpu)和三种插桩策略对Walma进行评估。结果表明,基于CNN的分类能够有效检测具有结构化内存布局的应用程序中的内存损坏,粗粒度边界检查的开销低至1.07倍,而细粒度监控虽然引入更高(1.5倍至1.8倍)但可预测的成本。我们的评估量化了不同部署配置下准确率与开销的权衡,证明了基于ML的WebAssembly内存证明的实际可行性。