mirror of
https://github.com/pi-hole/web.git
synced 2024-12-06 19:36:21 +01:00
Merge pull request #2115 from pi-hole/sanitise-docker-tag
Prevent potential execution of arbitrary code through the PIHOLE_DOCKER_TAG variable
This commit is contained in:
@@ -73,7 +73,7 @@ function check_cors() {
|
||||
$server_host = str_replace(array("[","]"), array("",""), $server_host);
|
||||
|
||||
if(isset($_SERVER['HTTP_HOST']) && !in_array($server_host, $AUTHORIZED_HOSTNAMES)) {
|
||||
log_and_die("Failed Host Check: " . $server_host .' vs '. join(', ', $AUTHORIZED_HOSTNAMES));
|
||||
log_and_die("Failed Host Check: " . $server_host .' vs '. htmlspecialchars(join(', ', $AUTHORIZED_HOSTNAMES)));
|
||||
}
|
||||
|
||||
if(isset($_SERVER['HTTP_ORIGIN'])) {
|
||||
@@ -88,7 +88,7 @@ function check_cors() {
|
||||
$server_origin = str_replace(array("[","]","http://","https://"), array("","","",""), $server_origin);
|
||||
|
||||
if(!in_array($server_origin, $AUTHORIZED_HOSTNAMES)) {
|
||||
log_and_die("Failed CORS: " . htmlspecialchars($server_origin) .' vs '. join(', ', $AUTHORIZED_HOSTNAMES));
|
||||
log_and_die("Failed CORS: " . htmlspecialchars($server_origin) .' vs '. htmlspecialchars(join(', ', $AUTHORIZED_HOSTNAMES)));
|
||||
}
|
||||
header("Access-Control-Allow-Origin: ${_SERVER['HTTP_ORIGIN']}");
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
$coreVersionStr = $core_current . (isset($core_commit) ? " (" . $core_branch . ", " . $core_commit . ")" : "");
|
||||
$ftlVersionStr = $FTL_current . (isset($FTL_commit) ? " (" . $FTL_branch . ", " . $FTL_commit . ")" : "");
|
||||
$webVersionStr = $web_current . (isset($web_commit) ? " (" . $web_branch . ", " . $web_commit . ")" : "");
|
||||
$dockerTag = getenv('PIHOLE_DOCKER_TAG');
|
||||
$dockerTag = htmlspecialchars(getenv('PIHOLE_DOCKER_TAG'));
|
||||
|
||||
$githubBaseUrl = "https://github.com/pi-hole";
|
||||
$coreUrl = $githubBaseUrl . "/pi-hole";
|
||||
|
||||
Reference in New Issue
Block a user