Skip to content

Error if creating symlink to absolute path#272

Merged
mhdawson merged 1 commit intonodejs:mainfrom
yagehu:symlink-abs-path
Jul 3, 2024
Merged

Error if creating symlink to absolute path#272
mhdawson merged 1 commit intonodejs:mainfrom
yagehu:symlink-abs-path

Conversation

@yagehu
Copy link
Contributor

@yagehu yagehu commented Jun 12, 2024

This commit adds an absolute path check to path_symlink. This behavior is specified by WASI.

fixes #271

@yagehu yagehu force-pushed the symlink-abs-path branch from c7a1fd4 to d633344 Compare June 12, 2024 18:21
This commit adds an absolute path check to `path_symlink`. This behavior
is specified by [WASI][1].

[1]: https://github.com/WebAssembly/wasi-filesystem/blob/main/path-resolution.md#symlinks

fixes nodejs#271

Signed-off-by: Yage Hu <me@huyage.dev>
@yagehu yagehu force-pushed the symlink-abs-path branch from d633344 to 0ffc7c8 Compare June 12, 2024 18:23
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 c8d4f01 into nodejs:main Jul 3, 2024
@yagehu yagehu deleted the symlink-abs-path branch October 19, 2024 14:57
@aduh95 aduh95 mentioned this pull request Aug 16, 2025
aduh95 added a commit that referenced this pull request Sep 2, 2025
Notable changes:

- Disallow malformed path with null byte (#266) (7aaa0b4)
- Preserve trailing slash in file path (#268) (afffaaa)
- Disallow absolute path at the raw WASI level (#270) (9811374)
- Error if creating symlink to absolute path (#272) (c8d4f01)
- Add cflite and document normalize path (#280) (6eeddba)
- Resolve old_path in uvwasi_path_symlink() (#303) (98da5ad)
- Use index rather than `telldir`/`seekdir` to represent `fd_readdir` cookie (#298) (392e1f1)
- fix: static library name (#305) (146e516)
- fix: do not put header files in a subfolders (#302) (ec28b58)
- fix: explicitly export symbols (#308) (4e9b4e0)
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 create a symlink to absolute path

2 participants