fix(security): prevent path traversal via symlinks in File.read and File.list#8727
Open
Ashwinhegde19 wants to merge 13 commits intoanomalyco:devfrom
Open
fix(security): prevent path traversal via symlinks in File.read and File.list#8727Ashwinhegde19 wants to merge 13 commits intoanomalyco:devfrom
Ashwinhegde19 wants to merge 13 commits intoanomalyco:devfrom
Conversation
…ile.list Resolves a critical vulnerability where symlinks could be used to access files outside the project directory. Implemented `fs.promises.realpath` validation to ensure the actual target path is within the allowed scope. Added regression test in `packages/opencode/test/security/symlink.test.ts`.
…ile.list Resolves a critical vulnerability where symlinks could be used to access files outside the project directory. Implemented `fs.promises.realpath` validation to ensure the actual target path is within the allowed scope. Added regression test in `packages/opencode/test/security/symlink.test.ts`. Fixes anomalyco#101
fix(security): prevent path traversal via symlinks
Contributor
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate/Related PRs Found:
Recommendation: Check PR #8316 most urgently, as it appears to be addressing the exact same vulnerability (symlink path traversal). Verify which PR was opened first and if one supersedes the other, or if they should be consolidated. |
…lyco#4997) - Fix Ctrl+C behavior on Windows: copies selection if present, otherwise clears/exits. - Resolve Ctrl+A conflict: move `model_provider_list` to `ctrl+alt+m`. - Fix Navigation: map `ctrl+n`/`ctrl+p` to move down/up and history next/prev. - Fix Multiline: ensure `shift+return` is mapped to newline. - Fix Word Navigation: ensure `ctrl+left`/`ctrl+right` are mapped. - Fix Word Deletion: ensure `alt+d` and `option+delete` are mapped.
fix(tui): resolve keybind conflicts and missing defaults
This was referenced Jan 24, 2026
00637c0 to
71e0ba2
Compare
f1ae801 to
08fa7f7
Compare
This was referenced Jan 30, 2026
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.
This PR fixes a security issue where File.read and File.list could follow symlinks outside the project directory due to lexical path checks. This allows potential path traversal. The code now resolves real paths and verifies containment before access.
Fixes:
Fixes #8313
What changed:
Updated File.read to use fs.promises.realpath() before reading.
Updated File.list to resolve paths before listing.
Added regression tests under packages/opencode/test/security/symlink.test.ts.