This repository was archived by the owner on Mar 3, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 396
fix: Implement path containment to prevent traversal attacks #2654
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
38cf2c9
fix: Implement path containment to prevent traversal attacks
thiyaguk09 48b415a
fix: Use path.relative for robust path traversal check
thiyaguk09 3cc8036
fix: Enforce GCS standard '/' for directory marker detection
thiyaguk09 ccd5636
fix: Secure destination path against traversal
thiyaguk09 e345f4b
add error message
thiyaguk09 5ea1e73
fix: Correct download destination logic and ensure recursive director…
thiyaguk09 befca63
fix: Optimize fsp.mkdir calls using a Set in downloadManyFiles
thiyaguk09 70beb2f
refactor: Extract base directory initialization/validation
thiyaguk09 70ff889
fix
thiyaguk09 bec1845
refactor: Remove explicit .code assignment from RequestError
thiyaguk09 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need a separate variable to track which directories have been created?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
mkdircall is now performed on every iteration for every file, which could introduce a slight performance overhead due to redundantfscalls, especially if many files are in the same directory. Whilefsp.mkdirwithrecursive: truehandles existing directories gracefully, you could optimize this by tracking created directories in aSetto avoid repeated calls for the same directory.