Skip to content
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

Renaming a file unexpectedly places it outside of pre-opened directory #1759

Closed
nr6000000 opened this issue Oct 24, 2020 · 1 comment · Fixed by #1764
Closed

Renaming a file unexpectedly places it outside of pre-opened directory #1759

nr6000000 opened this issue Oct 24, 2020 · 1 comment · Fixed by #1764
Labels
🏖️ sandbox A bug related to sandboxing bug Something isn't working 📦 lib-wasi About wasmer-wasi

Comments

@nr6000000
Copy link

Describe the bug

Whenever a file is renamed it's placed outside of pre-opened directory. It happens only if the file isn't in a subdirectory.

echo "`wasmer -V` | `rustc -V` | `uname -m`"
wasmer 1.0.0-alpha4 | rustc 1.47.0 (18bf6b4f0 2020-10-07) | x86_64

Steps to reproduce

  1. Download uutils.wasm from WAPM
  2. Create directory dir with a sample file foo in it
  3. Run wasmer --dir=./dir uutils.wasm -- mv dir/foo dir/bar

Expected behavior

File ./dir/foo is renamed to ./dir/bar

Actual behavior

File ./dir/foo is renamed to ./bar

Additional context

wasmer --dir=./dir uutils.wasm -- mv dir/dir2/foo dir/dir2/bar works correctly

@nr6000000 nr6000000 added the bug Something isn't working label Oct 24, 2020
@MarkMcCaskey
Copy link
Contributor

Thanks for the bug report! That seems like a fairly important bug (breaking the filesystem sandbox), I'll make sure we stress test our sandboxing more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏖️ sandbox A bug related to sandboxing bug Something isn't working 📦 lib-wasi About wasmer-wasi
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants