mirror of
https://github.com/getgrav/grav.git
synced 2026-05-13 02:06:18 +02:00
Fix for user reported CVE path-based open redirect
This commit is contained in:
@@ -316,7 +316,10 @@ class Grav extends Container
|
||||
/** @var Uri $uri */
|
||||
$uri = $this['uri'];
|
||||
|
||||
//Check for code in route
|
||||
// Clean route for redirect
|
||||
$route = preg_replace("#^\/[\\\/]+\/#", '/', $route);
|
||||
|
||||
// Check for code in route
|
||||
$regex = '/.*(\[(30[1-7])\])$/';
|
||||
preg_match($regex, $route, $matches);
|
||||
if ($matches) {
|
||||
|
||||
Reference in New Issue
Block a user