Skip to content

Path traversal vulnerability via symlinks and cross-drive paths #8313

Closed

Description

@mluckydream

Description

Problem

The Filesystem.contains() function uses lexical path checking only, which allows:

  • Symlink escape attacks
  • Cross-drive path bypass on Windows

See TODO comments in src/file/index.ts:280-281 and 340-341

Solution

Use realpathSync() to resolve symlinks and validate drive letters on Windows.

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on Jan 14, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    This earlier issue documented the same Filesystem.contains() vulnerability with symlink bypass (item #3 in the table), along with several other related filesystem security issues. The current issue appears to be addressing the specific implementation details mentioned in that comprehensive security report.

    Feel free to ignore if this doesn't address your specific case.

  2. thdxr commented on Mar 25, 2026

    @thdxr
    Member

    To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions