Skip to content
This repository was archived by the owner on May 20, 2026. It is now read-only.

Security: Unvalidated URI schemes passed to VS Code opener - #5054

Open
tuanaiseo wants to merge 1 commit into
microsoft:mainfrom
tuanaiseo:contribai/fix/security/unvalidated-uri-schemes-passed-to-vs-cod
Open

Security: Unvalidated URI schemes passed to VS Code opener#5054
tuanaiseo wants to merge 1 commit into
microsoft:mainfrom
tuanaiseo:contribai/fix/security/unvalidated-uri-schemes-passed-to-vs-cod

Conversation

@tuanaiseo

Copy link
Copy Markdown

Problem

The open method accepts an arbitrary string and directly passes vscode.Uri.parse(target) into vscode.open without validating scheme or destination. If target can be influenced by untrusted input (e.g., chat/tool output), this may allow opening dangerous URI schemes (including command-like or external handlers), enabling phishing flows or unintended command execution paths in the host environment.

Severity: medium
File: src/platform/open/vscode/opener.ts

Solution

Enforce an allowlist of safe schemes (for example https and optionally http), reject or sanitize all others, and consider explicit user confirmation for external links. Also validate hostnames when opening security-sensitive URLs.

Changes

  • src/platform/open/vscode/opener.ts (modified)

Testing

  • Existing tests pass
  • Manual review completed
  • No new warnings/errors introduced

…ener

The `open` method accepts an arbitrary string and directly passes `vscode.Uri.parse(target)` into `vscode.open` without validating scheme or destination. If `target` can be influenced by untrusted input (e.g., chat/tool output), this may allow opening dangerous URI schemes (including command-like or external handlers), enabling phishing flows or unintended command execution paths in the host environment.

Affected files: opener.ts

Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
@alexdima

Copy link
Copy Markdown
Member

Thanks for the contribution! This repository has been archived because the project has moved into the main VS Code repository.

Could you please reopen/recreate this PR against:
https://github.com/microsoft/vscode/tree/main/extensions/copilot

We’ll continue reviewing contributions there. Thanks!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants