validate proper duo hostnames (#12149)
This commit is contained in:
parent
cf52c6030e
commit
f65a39d6d8
|
@ -51,14 +51,12 @@ window.addEventListener("load", async () => {
|
|||
*/
|
||||
function redirectToDuoFrameless(redirectUrl: string) {
|
||||
const validateUrl = new URL(redirectUrl);
|
||||
const validDuoUrl =
|
||||
validateUrl.protocol === "https:" &&
|
||||
(validateUrl.hostname.endsWith(".duosecurity.com") ||
|
||||
validateUrl.hostname.endsWith(".duofederal.com"));
|
||||
|
||||
if (
|
||||
validateUrl.protocol !== "https:" ||
|
||||
!(
|
||||
validateUrl.hostname.endsWith("duosecurity.com") ||
|
||||
validateUrl.hostname.endsWith("duofederal.com")
|
||||
)
|
||||
) {
|
||||
if (!validDuoUrl) {
|
||||
throw new Error("Invalid redirect URL");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue