Skip to content

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

@mluckydream

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions