-
Notifications
You must be signed in to change notification settings - Fork 923
Disallow mounting folders on the guest's root for WASIX modules #5475
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
base: main
Are you sure you want to change the base?
Conversation
|
📝 Documentation updates detected! A separate PR for documentation updates has been made here: wasmerio/docs.wasmer.io#122 |
|
Also, Tested-by: Charalampos Mitrodimas [email protected] |
|
This PR might have some implications, that we don't want. I remember other programs using |
|
@syrusakbary in fact, that's exactly what this PR is trying to prevent. Mounting things on
|
|
@Arshia001 The PR seems to be pretty close to be merged, can you rebase it? |
3d9591b to
e83e944
Compare
e83e944 to
db04d04
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds validation to prevent mounting folders on the guest's root directory ("/") for WASIX modules, addressing a security and filesystem organization concern. The restriction is enforced at multiple levels of the stack to ensure comprehensive coverage.
- Added
is_wasixparameter throughout the call chain to differentiate WASIX from regular WASI modules - Implemented validation checks in package loading, filesystem mounting, and CLI argument processing
- Created a new error type
MountOnRootfor clear error reporting
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
lib/wasix/src/runtime/package_loader/load_package_tree.rs |
Added validation in filesystem_v3 and filesystem_v2 to reject mounts at "/"; removed unused sorting code |
lib/package/src/package/package.rs |
Added MountOnRoot error variant and validation check in Package construction for wasmer.toml files |
lib/cli/src/commands/run/wasi.rs |
Added is_wasix parameter to build_mapped_directories with validation for --dir=/ and --mapdir /:<HOST_PATH> flags; adjusted default guest paths based on module type |
lib/cli/src/commands/run/mod.rs |
Added is_wasix parameter to build_wasi_runner and updated all call sites to pass appropriate value (hardcoded true for webcs, dynamically determined for modules) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.