Skip to content

BUG: Symlink attack in filepicker path navigation #803

@andrinoff

Description

@andrinoff

Describe the bug
Filepicker at tui/filepicker.go:94 uses os.Stat() without checking symlinks. Attacker could create symlinks to read arbitrary directories.

To reproduce

  1. Create symlink: ln -s /etc/passwd ~/.config/matcha/link
  2. Navigate to symlink path via filepicker
  3. Contents of /etc exposed

Expected behavior
Use os.Lstat() to detect symlinks, or explicitly follow only safe links

Matcha version
master

OS
Unix-like

Additional context
File: tui/filepicker.go line 94
Security: symlink directory traversal

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions