Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/PLSysSec/veriwasm
SFI verifier of Wasm binaries
https://github.com/PLSysSec/veriwasm
Last synced: 3 months ago
JSON representation
SFI verifier of Wasm binaries
- Host: GitHub
- URL: https://github.com/PLSysSec/veriwasm
- Owner: PLSysSec
- License: other
- Created: 2020-08-15T16:55:39.000Z (about 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-22T19:41:00.000Z (over 1 year ago)
- Last Synced: 2024-05-22T20:32:47.237Z (6 months ago)
- Language: Rust
- Homepage:
- Size: 590 KB
- Stars: 78
- Watchers: 13
- Forks: 7
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-rust-formalized-reasoning - VeriWasm - SFI verifier of Wasm binaries. (Projects / Verification)
README
# VeriWasm: SFI safety for native-compiled Wasm
This repository contains all the code and data necessary for building VeriWasm and reproducing the results presented in our NDSS'21 paper [Доверя́й, но проверя́й: SFI safety for native-compiled Wasm](http://cseweb.ucsd.edu/~dstefan/pubs/johnson:2021:veriwasm.pdf).
## Abstract
WebAssembly (Wasm) is a platform-independent bytecode that offers both good performance and runtime isolation. To implement isolation, the compiler inserts safety checks when it compiles Wasm to native machine code. While this approach is cheap, it also requires trust in the compiler's correctness—trust that the compiler has inserted each necessary check, correctly formed, in each proper place. Unfortunately, subtle bugs in the Wasm compiler can break—and have broken—isolation guarantees. To address this problem, we propose verifying memory isolation of Wasm binaries post-compilation. We implement this approach in VeriWasm, a static offline verifier for native x86-64 binaries compiled from Wasm; we prove the verifier's soundness, and find that it can detect bugs with no false positives. Finally, we describe our deployment of VeriWasm at Fastly.## Build VeriWasm
You first need to install several dependencies:
- git
- Rust
- nasm (to compile test cases)
- gcc (to compile test cases)
- python3 (for scripts)Once you have these, you can build VeriWasm:
```bash
git submodule update --init --recursive
cargo build --release
```## Run VeriWasm
To run VeriWasm on your own binaries, you just need to point it to the module you want to check:
```bash
cargo run --release -- -i
```Usage:
```
VeriWasm 0.1.0
Validates safety of native Wasm codeUSAGE:
veriwasm [FLAGS] [OPTIONS] -iFLAGS:
-h, --help Prints help information
-q, --quiet
-V, --version Prints version informationOPTIONS:
-j, --jobs Number of parallel threads (default 1)
-i path to native Wasm module to validate
-o, --output Path to output stats file
```## Reproducing evaluation results
This repo contains all the infrastructure necessary for reproducing the results described in the paper. Once you build VeriWasm you can run our tests and and performance benchmarks.
### Running the evaluation suite
To verify all the binaries described in the paper, except the SPEC CPU 2006 binaries (they are proprietary) and the Fastly production binaries, run:
```bash
git clone https://github.com/PLSysSec/veriwasm_public_data.git
cd veriwasm_public_data && sh setup.sh && sh build_negative_tests.sh && cd ..
cargo test --release
```To get get the performance statistics for the binaries, run:
```bash
make compute_stats
python3 graph_stats.py stats/*
```### Fuzzing VeriWasm
To fuzz VeriWasm, you'll need to install `cmake` and then build the fuzzers (and the tooling they rely on):
```bash
make build_fuzzers
```Then, either run the [Csmith](https://embed.cs.utah.edu/csmith/)-based fuzzer:
```bash
cd veriwasm_fuzzing
make csmith_fuzz
```or the Wasm-based fuzzer:
```bash
cd veriwasm_fuzzing
make wasm_fuzz
```By default, `make` will use four cores; you may want to change this.
## Related repos
- **Binaries used for evaluation**: The binaries we verified as part of our evaluation are [here](https://github.com/PLSysSec/veriwasm_public_data.git).
- **Fuzzing scripts**: The scripts we used to fuzz VeriWasm are [here](https://github.com/PLSysSec/veriwasm_fuzzing).
- **Mechanized proofs**: The proofs from our paper are [here](https://github.com/PLSysSec/veriwasm-verification).