Skip to content

Commit 2feac76

Browse files
authored
Merge pull request #687 from superboy-zjc/main
fix(auth): sanitize authorization URL
2 parents e36f880 + b4d1bc7 commit 2feac76

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

client/src/lib/auth.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,12 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
134134
}
135135

136136
redirectToAuthorization(authorizationUrl: URL) {
137+
if (
138+
authorizationUrl.protocol !== "http:" &&
139+
authorizationUrl.protocol !== "https:"
140+
) {
141+
throw new Error("Authorization URL must be HTTP or HTTPS");
142+
}
137143
window.location.href = authorizationUrl.href;
138144
}
139145

0 commit comments

Comments
 (0)