Skip to content

Commit 4e6df92

Browse files
committed
fix(auth): sanitize authorization URL
1 parent aa6a98a commit 4e6df92

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client/src/lib/auth.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
129129
}
130130

131131
redirectToAuthorization(authorizationUrl: URL) {
132+
if (authorizationUrl.protocol !== "http:" && authorizationUrl.protocol !== "https:") {
133+
throw new Error("Authorization URL must be HTTP or HTTPS");
134+
}
132135
window.location.href = authorizationUrl.href;
133136
}
134137

0 commit comments

Comments
 (0)