Skip to content

Conversation

@T1mn
Copy link
Contributor

@T1mn T1mn commented Jan 9, 2026

What does this PR do?

  • Tightens Filesystem.contains by resolving real paths so symlinks and .. can’t escape the project root.
  • Adds path traversal tests, including a symlink escape case (skipped on Windows where symlinks may be restricted).

How did you verify your code works?

  • Ran cd packages/opencode && bun test file/path-traversal.test.ts (all tests passed).

@github-actions
Copy link
Contributor

github-actions bot commented Jan 9, 2026

The following comment was made by an LLM, it may be inaccurate:

Potential Duplicate Found:

Why it's related: This PR appears to address the exact same issue as the current PR (#7449). Both are focused on hardening the Filesystem.contains() method to prevent symlink escape attacks and path traversal vulnerabilities. The descriptions are nearly identical in scope.

Recommendation: Check if #6403 is still open/active or if #7449 is intended to supersede it. They should be consolidated to avoid duplicate work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants