论文标题

Wasmati:WebAssembly的有效静态漏洞扫描仪

Wasmati: An Efficient Static Vulnerability Scanner for WebAssembly

论文作者

Brito, Tiago, Lopes, Pedro, Santos, Nuno, Santos, José Fragoso

论文摘要

WebAssembly是一种新的二进制指令格式,允许浏览器的JavaScript引擎以接近本地的速度执行有针对性的编译代码。但是,鉴于可以从C/C ++等不安全的语言中汇编Websembly二进制文件,因此可以将经典的代码漏洞(例如缓冲区溢出或格式字符串)从原始程序转移到交叉编译的二进制文件。结果,将漏洞纳入WebAssembly模块中的这种可能性扩大了现代Web应用程序的攻击表面。本文介绍了Wasmati,这是一种静态分析工具,用于在WebAssembly二进制文件中找到安全漏洞。它基于代码属性图(CPG)的生成,这是一种以前用于检测各种语言漏洞但迄今未应用于WebAssembly的程序表示形式。我们将CPG的定义定为WebAssembly,引入技术以生成CPG进行复杂的WebAssembly,并通过穿越程序的CPG来介绍四种不同的查询规范语言,以查找漏洞。我们实施了十个查询,这些查询捕获了不同的漏洞类型,并在四个异质数据集上对Wasmati进行了广泛测试。我们表明,Wasmati可以扩展大型现实应用程序的CPG的生成,并可以有效地找到所有查询类型的漏洞。我们还测试了我们在野外收集的WebAssembly二进制文件上测试了我们的工具,并确定了一些潜在的漏洞,除非封闭应用程序正确地消毒了与此类受影响的二进制文件的相互作用,否则我们已经手动确认了其中的一些漏洞。

WebAssembly is a new binary instruction format that allows targeted compiled code written in high-level languages to be executed with near-native speed by the browser's JavaScript engine. However, given that WebAssembly binaries can be compiled from unsafe languages like C/C++, classical code vulnerabilities such as buffer overflows or format strings can be transferred over from the original programs down to the cross-compiled binaries. As a result, this possibility of incorporating vulnerabilities in WebAssembly modules has widened the attack surface of modern web applications. This paper presents Wasmati, a static analysis tool for finding security vulnerabilities in WebAssembly binaries. It is based on the generation of a code property graph (CPG), a program representation previously adopted for detecting vulnerabilities in various languages but hitherto unapplied to WebAssembly. We formalize the definition of CPG for WebAssembly, introduce techniques to generate CPG for complex WebAssembly, and present four different query specification languages for finding vulnerabilities by traversing a program's CPG. We implemented ten queries capturing different vulnerability types and extensively tested Wasmati on four heterogeneous datasets. We show that Wasmati can scale the generation of CPGs for large real-world applications and can efficiently find vulnerabilities for all our query types. We have also tested our tool on WebAssembly binaries collected in the wild and identified several potential vulnerabilities, some of which we have manually confirmed to exist unless the enclosing application properly sanitizes the interaction with such affected binaries.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源