Repository navigation
fix(cli): skip file symlinks in legacy directory uploads - #1922
Merged
Merged
Conversation
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Signed-off-by: phernandez <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
phernandez
changed the base branch from
codex/security-project-root-ancestry
to
main
October 28, 2026 22:16
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.
Why
A directory selected for legacy cloud upload includes file symlinks, and opening them uploads their targets. A regression with only temporary files reproduced disclosure of an outside file to an in-process HTTP receiver. Fixes #1898.
What Changed
Exclude discovered file symlinks before file sizing and upload. Verbose scanning identifies skipped links. Broken symlinks no longer abort otherwise valid directory uploads.
Implementation Details
Use
Path.is_symlink()during discovery, complementingos.walk's existing exclusion of directory-symlink traversal. Both internal and external file links are skipped. The tests run the real discovery, asynchronous reads, HTTP client, and a FastAPI receiver via ASGITransport, without mock objects.Stacked on #1921, which is stacked on #1920. Only the upload discovery change and its tests are new here.
Testing
uv run pytest tests/cli/cloud/test_upload_symlinks.py tests/cli/cloud/test_upload_path.py tests/cli/test_upload.py -q --no-cov: 25 passed.just fast-check: passed, including repository type checking.just doctor: passed sandboxed write/index/search self-test.git diff --check: passed.Risks / Follow-ups
The scope is links discovered inside a directory upload. Explicitly selected input paths retain existing resolution behavior. This does not protect against a concurrent local process replacing files after discovery. Symlink tests skip Windows because link creation can require privileges. Legacy upload path authorization remains separate in #1905.