Skip to content

Commit 24ff8a4

Browse files
allow to redirect only for whitelisted trusted protocols (#17559)
* fix IDE-69: allow to redirect only for whitelisted trusted protocols * Update components/dashboard/src/service/service.tsx Co-authored-by: Filip Troníček <[email protected]> * drop security --------- Co-authored-by: Filip Troníček <[email protected]>
1 parent 3ae884f commit 24ff8a4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/dashboard/src/service/service.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,10 @@ export class IDEFrontendService implements IDEFrontendDashboardService.IServer {
191191
let redirect = false;
192192
try {
193193
const desktopLink = new URL(url);
194-
redirect = desktopLink.protocol !== "http:" && desktopLink.protocol !== "https:";
194+
// allow to redirect only for whitelisted trusted protocols
195+
// IDE-69
196+
const trustedProtocols = ["vscode:", "vscode-insiders:", "jetbrains-gateway:"];
197+
redirect = trustedProtocols.includes(desktopLink.protocol);
195198
} catch (e) {
196199
console.error("invalid desktop link:", e);
197200
}

0 commit comments

Comments
 (0)