MCPcopy Index your code
hub / github.com/PLSysSec/wave

github.com/PLSysSec/wave @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
807 symbols 1,972 edges 92 files 197 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

WaVe: a verifiably secure WebAssembly sandboxing runtime

This repository contains all the code and data necessary for building WaVe and reproducing the results presented in our paper WaVe: a verifiably secure WebAssembly sandboxing runtime).

Abstract

The promise of software sandboxing is flexible, fast and portable isolation; capturing the benefits of hardware-based memory protection without requiring operating system involvement. This promise is reified in WebAssembly (Wasm), a popular portable bytecode whose compilers automatically insert runtime checks to ensure that data and control flow are constrained to a single memory segment. Indeed, modern compiled Wasm implementations have advanced to the point where these checks can themselves be verified, removing the compiler from the trusted computing base. However, the resulting integrity properties are only valid for code executing strictly inside the Wasm sandbox. Any interactions with the runtime system, which manages sandboxes and exposes the WebAssembly System Interface (WASI) used to access operating system resources, operate outside this contract. The resulting conundrum is how to maintain Wasm’s strong isolation properties while still allowing such programs to interact with the outside world (i.e., with the file system, the network, etc.). Our paper presents a solution to this problem, via WaVe, a verified secure runtime system that implements WASI. We mechanically verify that interactions with WaVe (including OS side effects) not only maintain Wasm’s memory safety guarantees, but also maintain access isolation for the host OS’s storage and network resources. Finally, in spite of completely removing the runtime from the trusted computing base, we show that WaVe offers performance competitive with existing industrial (yet unsafe) Wasm runtimes.

Install dependencies

apt-get install -y curl git unzip build-essential pkg-config libssl-dev cmake ninja-build clang

Additionally, ensure you have https://rustup.rs/ installed, and install additional Rust dependencies:
cargo install --force cbindgen

To build and verify:

make bootstrap # Setup build the first time. This will take 15-20 minutes.
make build     # Build WaVe. This should take < 1 minute. 
cargo test     # Run all compliance tests. This should take < 1 minute
make verify    # Verify correctness of WaVe. This will take 30-60 minutes.

To run an example application using WaVe

cd examples/cat # enter example directory  
make            # build  
make run        # execute cat example  

You can examine the makefile to see the exact commands

Related documentation

Interface for WASI calls: WASI API

Extension points exported contracts — how you extend this code

EncodeTypeCheck (Interface)
A trait for encoding the statements for type-checking the spec. [5 implementers]
tools/fuzz-gen/src/specifications/untyped.rs
AssignExpressionId (Interface)
(no doc) [9 implementers]
tools/fuzz-gen/src/specifications/untyped.rs
EncodeQuickCheck (Interface)
Encodes the specification as a boolean expression for quick checking... [2 implementers]
tools/fuzz-gen/src/qc_rewriter.rs

Core symbols most depended-on inside this repo

len
called by 71
src/types/mod.rs
push
called by 51
src/tcb/sbox_mem.rs
start_timer
called by 49
src/stats/timing.rs
stop_timer
called by 49
src/stats/timing.rs
ptr_to_ref
called by 46
src/tcb/ffi.rs
push_hostcall_result
called by 45
src/stats/timing.rs
to_raw
called by 40
src/types/mod.rs
wasm2c_marshal
called by 24
src/writeback.rs

Shape

Function 487
Method 208
Class 84
Enum 25
Interface 3

Languages

Rust94%
C6%
C++1%

Modules by API surface

src/types/mod.rs81 symbols
tools/fuzz-gen/out.rs80 symbols
src/wasm2c_frontend.rs52 symbols
src/lucet_frontend.rs50 symbols
src/wrappers.rs46 symbols
tools/fuzz-gen/src/specifications/preparser.rs41 symbols
tools/fuzz-gen/src/specifications/common.rs38 symbols
src/os/mod.rs35 symbols
tools/fuzz-gen/src/main.rs29 symbols
src/tcb/misc.rs25 symbols
src/tests/integration_tests.rs22 symbols
src/runtime.rs19 symbols

For agents

$ claude mcp add wave \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact