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

Disallow absolute path at the raw WASI level #270

Merged
merged 1 commit into from
Jun 14, 2024
Merged

Conversation

yagehu
Copy link
Contributor

@yagehu yagehu commented Jun 11, 2024

This commit fixes a path_open behavior that allows opening absolute paths. Although the path normalization correctly resolves the path and enforces the sandbox, it's still a good idea to converge with other runtimes here.

fixes #269

This commit fixes a `path_open` behavior that allows opening absolute
paths. Although the path normalization correctly resolves the path and
enforces the sandbox, it's still a good idea to converge with other
runtimes here.

fixes nodejs#269

Signed-off-by: Yage Hu <[email protected]>
Comment on lines +190 to +191
pass("/bar", "/baz", "bar/test_path", "/baz/bar/test_path");
pass("/bar", "/baz", "bar/../bar/test_path", "/baz/bar/test_path");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two test cases were spec'd wrong to begin with.

Copy link
Contributor

@guybedford guybedford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick verification against the Wasmtime test suite and can confirm that this is the correct behaviour for Wasmtime.

Copy link
Member

@mhdawson mhdawson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mhdawson mhdawson merged commit 9811374 into nodejs:main Jun 14, 2024
7 checks passed
@yagehu yagehu deleted the abs-path branch October 19, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should not be able to path_open absolute path
3 participants