Repository navigation
Conversation
openAsBlob() and openAsBlobSync() stored the caller path and reopened it on every read. A relative path was resolved against the cwd again, so process.chdir() could read a different file of the same size and mtime, or fail the read. Pin the directory the path was opened against when the blob is created, without lexically collapsing ".." so symlink traversal stays the same. Signed-off-by: Ihar Ivaniuk <ihar.o.ivaniuk@gmail.com>
Contributor
|
Welcome to Node.js, and thank you for your first contribution! Before review, please take a moment to read:
Please make sure every commit is signed off. For a first pull request, GitHub Actions require collaborator approval and Jenkins CI must be started by a collaborator or triager, so an initial wait is normal. |
jazelly
reviewed
Nov 9, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #67346 +/- ##
==========================================
+ Coverage 90.68% 90.69% +0.01%
==========================================
Files 797 797
Lines 279574 279605 +31
Branches 53778 53790 +12
==========================================
+ Hits 253525 253593 +68
+ Misses 16344 16297 -47
- Partials 9705 9715 +10
🚀 New features to boost your workflow:
|
Keep the path produced by ToNamespacedPath() on Windows. On POSIX, anchor a relative path to the cwd from uv_cwd() without removing "..", and copy the bytes into a Buffer so a non-UTF-8 name is preserved. Skip the chdir regression in workers, use common/tmpdir, and treat EILSEQ only when creating the non-UTF-8 fixture. Signed-off-by: Ihar Ivaniuk <ihar.o.ivaniuk@gmail.com> Assisted-by: a coding agent
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.
openAsBlob() and openAsBlobSync() stored the caller path and reopened it on every read. A relative path was resolved against the cwd again, so process.chdir() could read a different file of the same size and mtime, or fail the read. Pin the directory the path was opened against when the blob is created, without lexically collapsing ".." so symlink traversal stays the same.
Verified on Linux x64 by building this tree. The new test failed on the
unfixed binary (
'from-b' !== 'from-a') and passed after the rebuild.Also passed:
test-blob-file-backed,test-fs-openAsBlobSync,test-vfs-fs-openAsBlob,test-blob-file-webidl,test-permission-fs-read, andtest-permission-fs-supported.cpplint, the include check, clang-format, and ESLint were clean.
Windows and macOS were not run.
A coding agent prepared the change. The build and the test results above
were run locally.
Fixes: #67282