Skip to content

fix(desktop): shell.openExternal called without URL protocol validation #30613

Closed as not planned

Description

@alper-dev

Description

The open-link IPC handler in packages/desktop/src/main/ipc.ts calls shell.openExternal(url) without validating the URL protocol. This allows arbitrary protocols (e.g., file:, javascript:, ms-msdt:, smb:) to be opened via the OS default handler.

The primary attack vector is the terminal component (packages/app/src/components/terminal.tsx:340), where getHoveredLinkText() reads URLs from xterm.js output and passes them directly to platform.openLink(). LLM-generated output could contain malicious URLs that a user opens via Shift+Click.

Steps to reproduce

  1. Open OpenCode desktop app
  2. Ask the LLM to output a file:// URL or craft terminal output containing one
  3. Shift+Click the link in the terminal
  4. The OS executes/opens the file:// URL without validation

Impact

  • Arbitrary application execution via file:///path/to/executable
  • NTLM hash leakage via smb:// URLs on Windows
  • Protocol handler abuse via ms-msdt:, ms-settings:, etc.

Activity

  1. ulises-jeremias commented on Jul 14, 2026

    @ulises-jeremias
    Contributor

    Reopened the fix PR after automated cleanup closure: #36862

    @Brendonovich could you please take a look when you get a chance? Thanks!

  2. github-actions commented on Sep 14, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 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

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions