Skip to content

Commit 6771283

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 72e822c commit 6771283

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
@@ -176,7 +176,10 @@ export class IDEFrontendService implements IDEFrontendDashboardService.IServer {
176176
let redirect = false;
177177
try {
178178
const desktopLink = new URL(url);
179-
redirect = desktopLink.protocol !== "http:" && desktopLink.protocol !== "https:";
179+
// allow to redirect only for whitelisted trusted protocols
180+
// IDE-69
181+
const trustedProtocols = ["vscode:", "vscode-insiders:", "jetbrains-gateway:"];
182+
redirect = trustedProtocols.includes(desktopLink.protocol);
180183
} catch (e) {
181184
console.error("invalid desktop link:", e);
182185
}

0 commit comments

Comments
 (0)