Repository navigation
fix(ext/node): only require read permission for node:wasi preopens - #37266
Open
thebrownhuman wants to merge 1 commit into
Open
thebrownhuman wants to merge 1 commit into
thebrownhuman wants to merge 1 commit into
Conversation
Constructing WASI no longer needs write access to each preopened directory. Operations that change the filesystem still check write permission on the resolved path when they run. Fixes denoland#37263
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #37263
The WASI constructor checked read and write permission on every preopen, so a read only program needed --allow-write too. It now checks read only. Writes are still gated because every mutating op (path_open with write rights or O_CREAT/O_TRUNC, mkdir, rmdir, unlink, rename, symlink, link, set times) checks write permission on the resolved path when it runs.
Added a unit_node test that runs with read permission only, constructs WASI with a preopen, reads through it, and checks that path_create_directory still returns EACCES. It fails before this change and passes after.
AI disclosure: Claude Code helped write this change.