fix(desktop): validate openExternal URLs by protocol#30666
fix(desktop): validate openExternal URLs by protocol#30666ulises-jeremias wants to merge 3 commits into
Conversation
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
|
The following comment was made by an LLM, it may be inaccurate: Potential Duplicate Found:
This appears to be addressing the same issue as PR #30666 - validating URLs/protocols for the |
|
Thanks for updating your PR! It now meets our contributing guidelines. 👍 |
|
Thanks for the duplicate signal. I intentionally kept this PR open because it adds two concrete pieces beyond the minimal inline guard:
So this PR contributes test coverage and a reusable boundary, not only the inline check. If maintainers prefer, I can also align protocol policy with #30614 (e.g. |
* upstream/dev: (454 commits) chore: update nix node_modules hashes feat(oauth): unify OAuth callback browser pages (anomalyco#34025) chore: generate refactor(app): replace tab drag handling with dndkit (anomalyco#33880) refactor(app): use dropdown for project selector (anomalyco#33984) chore: update nix node_modules hashes fix(app): bump ghostty-web to prevent terminal resize hangs (anomalyco#34020) chore: generate feat(sdk): expose active sessions (anomalyco#33991) fix(sdk): wake embedded session execution (anomalyco#33992) refactor(opencode): stop legacy v2 event emission (anomalyco#33993) fix(ui): normalize tooltip trigger layout (anomalyco#33979) fix(app): suspend hidden terminal renderer (anomalyco#33990) fix(app): enable auto-accept in session settings (anomalyco#33974) tweak: hide MCP access token prefix (anomalyco#33711) fix(core): refine small model defaults (anomalyco#33926) feat(core): split MCP timeout configuration (anomalyco#33977) fix(app): simplify question prompt (anomalyco#33968) feat(llm): pass strict through tool definitions for Codex parity (anomalyco#33392) chore: generate ...
|
@adamdotdevin @Hona @Brendonovich Rebased onto latest |
Issue for this PR
Closes #30613
Type of change
What does this PR do?
The desktop
open-linkIPC handler calledshell.openExternal(url)without validating the URL scheme.This PR adds a protocol allowlist guard and blocks non-web protocols before opening links externally.
Allowed protocols:
http:https:Blocked examples:
file:javascript:smb:ms-msdt:How did you verify your code works?
packages/desktop/src/main/external-link.test.ts:http/httpsbun test src/main/external-link.test.ts(frompackages/desktop)bun typecheck(frompackages/desktop)Screenshots / recordings
Not a UI change.
Checklist