mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-17 01:54:49 +00:00
login - use parse_url to validate if the provided redirect string is actually parseable to prevent redirect. looks like https://github.com/opnsense/core/issues/4061 was incomplete
This commit is contained in:
parent
5d68f43d1f
commit
3c2f32ec8d
@ -187,14 +187,12 @@ function session_auth()
|
||||
}
|
||||
if (!empty($_GET['url'])) {
|
||||
$tmp_url_parts = parse_url($_GET['url']);
|
||||
if (!empty($tmp_url_parts['host'])) {
|
||||
if ($tmp_url_parts !== false) {
|
||||
$redir_uri = $tmp_url_parts['path'];
|
||||
$redir_uri .= !empty($tmp_url_parts['query']) ? "?" . $tmp_url_parts['query'] : "";
|
||||
$redir_uri .= !empty($tmp_url_parts['fragment']) ? "#" . $tmp_url_parts['fragment'] : "";
|
||||
} else {
|
||||
$redir_uri = $_GET['url'];
|
||||
header(url_safe("Location: {$redir_uri}"));
|
||||
}
|
||||
header(url_safe("Location: {$redir_uri}"));
|
||||
} elseif (!empty($_SESSION['user_shouldChangePassword'])) {
|
||||
header("Location: system_usermanager_passwordmg.php");
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user