mirror of
https://github.com/bitwarden/browser
synced 2025-12-11 13:53:34 +00:00
validate proper duo hostnames (#12149)
This commit is contained in:
@@ -51,14 +51,12 @@ window.addEventListener("load", async () => {
|
|||||||
*/
|
*/
|
||||||
function redirectToDuoFrameless(redirectUrl: string) {
|
function redirectToDuoFrameless(redirectUrl: string) {
|
||||||
const validateUrl = new URL(redirectUrl);
|
const validateUrl = new URL(redirectUrl);
|
||||||
|
const validDuoUrl =
|
||||||
|
validateUrl.protocol === "https:" &&
|
||||||
|
(validateUrl.hostname.endsWith(".duosecurity.com") ||
|
||||||
|
validateUrl.hostname.endsWith(".duofederal.com"));
|
||||||
|
|
||||||
if (
|
if (!validDuoUrl) {
|
||||||
validateUrl.protocol !== "https:" ||
|
|
||||||
!(
|
|
||||||
validateUrl.hostname.endsWith("duosecurity.com") ||
|
|
||||||
validateUrl.hostname.endsWith("duofederal.com")
|
|
||||||
)
|
|
||||||
) {
|
|
||||||
throw new Error("Invalid redirect URL");
|
throw new Error("Invalid redirect URL");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user