Wasmati: An Efficient Static Vulnerability Scanner for WebAssembly

Tiago Brito, Pedro Lopes, Nuno Santos, José Fragoso Santos
4/26/2022
cs.CR

Official code: darkmacheken/wasmati (33 stars, C++, Apache-2.0, last commit 2024-08-16).

Abstract

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.

Show full abstract

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.

View on arXivView PDF

Code Implementations(1)

Apache-2.0

A Generic and Efficient Code Property Graph Infrastructure forScanning Vulnerabilities in WebAssembly Code

338C++, PythonFeb 5, 20212 years agoApache-2.0

Similar Papers

Cite this paper

@article{brito2022wasmati,
  title  = {Wasmati: An Efficient Static Vulnerability Scanner for WebAssembly},
  author = {Tiago Brito and Pedro Lopes and Nuno Santos and José Fragoso Santos},
  year   = {2022},
  eprint = {2204.12575},
  archivePrefix = {arXiv},
  url    = {https://arxiv.org/abs/2204.12575}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2204.12575.svg)](https://codeofpaper.com/paper/2204.12575)

Discussion