-
Notifications
You must be signed in to change notification settings - Fork 845
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running *.wasm
files directly doesn't sandbox the filesystem
#4267
Comments
Hey @yagehu! Are you sure you're not mounting the directory via |
@yagehu never mind, I just ran it and it does indeed mount the cwd. |
I have a feeling the issue comes from the way we set up the preopens here: wasmer/lib/cli/src/commands/run/wasi.rs Lines 193 to 226 in 9127dde
|
*.wasm
files directly doesn't sandbox the filesystem
This was resolved in #4301 . |
@theduke Will you publish the security advisory? |
@yagehu which version of wasmer are you on, and which operating system? Because this does not reproduce on wasmer |
@theduke you have to compile to |
never mind, it just doesn't happen with |
This reproduces with v4.2.3 Wasmer on Fedora 39 Linux. It does NOT reproduce with v4.2.4 Wasmer, so I'm assuming your commit fixed it. I'm just wondering if you will publish the security advisory since it impacts people running plain WASI (non WASIX) workloads. |
@yagehu we ran into a bit of a hiccup with publishing the crates. That's been resolved and the advisory will be published soon. Tagging @syrusakbary |
@yagehu the advisory is now published. I will close this issue. |
In wasmtime or other Wasm runtimes with WASI support, you have to explicit preopen a directory to have access to the host filesystem. With wasmer, it seems the cwd is opened by default.
For example, given this small Rust program:
Running it as
wasmer run test.wasm
will just create a file namedabc
in cwd. Is it possible to disable this behavior. I only want host fs access if I explicitly enable it.The above program is compiled with
cargo build --target wasm32-wasi
.The text was updated successfully, but these errors were encountered: