mirror of
https://github.com/0rangebananaspy/authelia.git
synced 2024-09-14 22:47:21 +07:00
In order to redirect the user after authentication, Authelia uses rd query parameter provided by the proxy. However an attacker could use phishing to make the user be redirected to a bad domain. In order to avoid the user to be redirected to a bad location, Authelia now verifies the redirection URL is under the protected domain.
12 lines
616 B
TypeScript
12 lines
616 B
TypeScript
import VisitPage from "./visit-page";
|
|
import FillLoginPageWithUserAndPasswordAndClick from "./fill-login-page-and-click";
|
|
import ValidateTotp from "./validate-totp";
|
|
import WaitRedirected from "./wait-redirected";
|
|
|
|
// Validate the two factors!
|
|
export default function(driver: any, url: string, user: string, secret: string) {
|
|
return VisitPage(driver, `https://login.example.com:8080/?rd=${url}`)
|
|
.then(() => FillLoginPageWithUserAndPasswordAndClick(driver, user, 'password'))
|
|
.then(() => ValidateTotp(driver, secret))
|
|
.then(() => WaitRedirected(driver, "https://admin.example.com:8080/secret.html"));
|
|
} |