arXiv:2603.24167cs.CRcs.LG2026-03

用图像识别检测Wasm内存污染,防宿主攻击和代码篡改

Walma: Learning to See Memory Corruption in WebAssembly

  • 把内存快照转成灰度图,用CNN识别编译代码的行对齐结构
  • 在真实漏洞程序中,篡改需覆盖数百KB至数MB内存才能逃过检测
  • 适合关注Wasm安全的开发者和漏洞检测研究者

WebAssembly的单一线性内存使一个内存破坏漏洞成为双向威胁:被攻陷的模块可攻击宿主,恶意宿主也能篡改可信模块状态。现有防御需定制运行时或修改源码,且无法在对抗性宿主下验证运行时完整性。我们提出Walma,一种针对Wasm线性内存的证明框架,将内存快照转化为灰度图像,通过卷积神经网络分类。网络利用编译代码施加的行对齐结构,检测字节和纹理统计遗漏的污染。在结构化目标上,可识别非输入触发的篡改,如恶意宿主直接写内存。在真实漏洞应用中,隐藏污染需覆盖大比例内存(目标为数百KB至数MB)。对良性内存的香农熵分析界定了学习先验可检测的越界编辑范围。在WABench套件的53个二进制文件上,证明开销为宿主边界1.07倍至1.69倍,实现连续、以状态为中心的Wasm内存证明。

原文摘要 · Abstract (English)

WebAssembly's (Wasm) monolithic linear memory turns a single memory-corruption bug into a bidirectional threat: a compromised module can attack its embedding host, and a malicious host can tamper with a trusted module's state. Existing defenses require custom runtimes or source changes, and none can verify runtime integrity under an adversarial host. We present Walma, a framework for WebAssembly linear memory attestation that renders snapshots of linear memory as grayscale images and classifies them with a convolutional neural network. The network reads the row-aligned structure that compiled code imposes on memory and detects corruption that byte and texture statistics miss. On structured targets this extends to tampering that no program input triggers, such as direct memory writes by a malicious host. On real-world CVE-affected applications, hiding corruption from Walma's verdict requires overwriting a large fraction of memory, hundreds of kilobytes to megabytes on our targets. A Shannon-entropy analysis of benign memory bounds the class of out-of-band edits that the learned prior can detect. Across the 53 binaries of the WABench suite, attestation costs 1.07x--1.69x at the host boundary, making continuous, state-centric memory attestation for Wasm practical.

Wasm安全内存检测AI防御代码审计

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。