Skip to content

Disallow malformed path with null byte#266

Merged
mhdawson merged 1 commit intonodejs:mainfrom
yagehu:yagehu/malformed-path-open
Jun 3, 2024
Merged

Disallow malformed path with null byte#266
mhdawson merged 1 commit intonodejs:mainfrom
yagehu:yagehu/malformed-path-open

Conversation

@yagehu
Copy link
Contributor

@yagehu yagehu commented May 28, 2024

This commit adds a check when resolving path such that any null bytes in the input path causes errno inval. This is consistent with other runtimes like Wasmtime, Wasmer, Wazero, WasmEdge, and WAMR.

fixes #265

This commit adds a check when resolving path such that any null bytes in
the input path causes errno `inval`.  This is consistent with other
runtimes like Wasmtime, Wasmer, Wazero, WasmEdge, and WAMR.

fixes nodejs#265

Signed-off-by: Yage Hu <me@huyage.dev>
@yagehu
Copy link
Contributor Author

yagehu commented May 31, 2024

@mhdawson can you take a look? Fairly straightforward change. Thanks!

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 7aaa0b4 into nodejs:main Jun 3, 2024
@yagehu yagehu deleted the yagehu/malformed-path-open branch June 3, 2024 23:46
@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.

uvwasi accepts malformed path containing null byte

3 participants