Skip to content

Commit d21e51e

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

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
@@ -129,6 +129,12 @@ export class InspectorOAuthClientProvider implements OAuthClientProvider {
129129
}
130130

131131
redirectToAuthorization(authorizationUrl: URL) {
132+
if (
133+
authorizationUrl.protocol !== "http:" &&
134+
authorizationUrl.protocol !== "https:"
135+
) {
136+
throw new Error("Authorization URL must be HTTP or HTTPS");
137+
}
132138
window.location.href = authorizationUrl.href;
133139
}
134140

0 commit comments

Comments
 (0)