mirror of
https://git.code.sf.net/p/seeddms/code
synced 2026-05-08 21:41:23 +00:00
check for valid referer uri when logging in
This commit is contained in:
parent
8cc8e74fa1
commit
378a960b82
|
|
@ -4,6 +4,7 @@
|
|||
- output and check for reasonable values of upload_max_filesize, post_max_size and memory_limit
|
||||
- remove null bytes from login
|
||||
- remove null bytes from password when authenticating by ldap
|
||||
- check for valid referer uri when logging in
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Changes in version 5.1.46
|
||||
|
|
|
|||
|
|
@ -71,15 +71,15 @@ if(isset($_REQUEST["lang"]) && strlen($_REQUEST["lang"])>0 && is_numeric(array_s
|
|||
|
||||
$session = new Session($db);
|
||||
|
||||
// TODO: by the PHP manual: The superglobals $_GET and $_REQUEST are already decoded.
|
||||
// Using urldecode() on an element in $_GET or $_REQUEST could have unexpected and dangerous results.
|
||||
|
||||
$referuri = '';
|
||||
if (isset($_POST["referuri"]) && strlen($_POST["referuri"])>0) {
|
||||
$referuri = trim(urldecode($_POST["referuri"]));
|
||||
$referuri = trim($_POST["referuri"]);
|
||||
}
|
||||
else if (isset($_GET["referuri"]) && strlen($_GET["referuri"])>0) {
|
||||
$referuri = trim(urldecode($_GET["referuri"]));
|
||||
$referuri = trim($_GET["referuri"]);
|
||||
}
|
||||
if ($referuri !== '' && !preg_match('#^/[A-Za-z0-9/_\-.?=&]*$#', $referuri)) {
|
||||
$referuri = '';
|
||||
}
|
||||
|
||||
add_log_line();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user