Uh oh!
There was an error while loading. Please reload this page.
fix: prevent path traversal via symlinks and cross-drive paths - #8316
fix: prevent path traversal via symlinks and cross-drive paths#8316mluckydream wants to merge 2 commits into
Conversation
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found several related PRs that address similar security concerns with symlinks and filesystem containment checks. However, none of these are duplicates of PR #8316. Here are the related PRs: Previously merged/closed security improvements:
These PRs appear to be earlier iterations or related security work on the same vulnerability area, but PR #8316 represents a more comprehensive fix addressing both symlinks AND Windows cross-drive path traversal attacks. No open duplicate PRs found - PR #8316 is the current attempt to address issue #8313 with enhanced protections. |
f1ae801 to
08fa7f7CompareClosing this pull request because it has had no updates for more than 60 days. If you plan to continue working on it, feel free to reopen or open a new PR. |
Fixes#8313
Summary
Enhanced
Filesystem.contains()to prevent directory escape attacks via symlinks and cross-drive paths on Windows.Changes
src/util/filesystem.ts: Enhancedcontains()functionrealpathSync()to resolve symlinks to canonical pathssrc/file/index.ts: Removed resolved TODO comments (4 lines)Security Improvements
Prevents symlink escape attacks
Prevents Windows cross-drive path bypass
Maintains backward compatibility
Testing
Tested on macOS (darwin-arm64):
contains()correctly rejects escaped pathsTest scenario