mirror of
https://github.com/openvk/chandler.git
synced 2025-02-02 04:25:25 +03:00
Fix CSRF vulnerability
This commit is contained in:
parent
52c05f2301
commit
5f29e67c56
1 changed files with 1 additions and 1 deletions
|
@ -85,7 +85,7 @@ class Router
|
|||
[$hash, $nonce] = $data;
|
||||
|
||||
if(sodium_memcmp($this->makeCSRFToken($route, hex2bin($nonce)), "$hash#$nonce") === 0)
|
||||
$GLOBALS["csrfCheck"] = true;
|
||||
$GLOBALS["csrfCheck"] = parse_url($_SERVER["HTTP_REFERER"], PHP_URL_HOST) === $_SERVER["HTTP_HOST"];
|
||||
} catch(\SodiumException $ex) {}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue