mirror of
https://github.com/pi-hole/web.git
synced 2026-04-25 11:19:59 +01:00
Prevent possible attacks via admin email setting
The admin email is now treated as a single string (surrounded by single quotes), and it is not allowed to contain its own single quotes. Signed-off-by: Mcat12 <newtoncat12@yahoo.com>
This commit is contained in:
@@ -476,13 +476,13 @@ function readAdlists()
|
||||
{
|
||||
$adminemail = 'noadminemail';
|
||||
}
|
||||
elseif(!filter_var($adminemail, FILTER_VALIDATE_EMAIL))
|
||||
elseif(!filter_var($adminemail, FILTER_VALIDATE_EMAIL) || strpos($adminemail, "'") !== false)
|
||||
{
|
||||
$error .= "Administrator email address (".htmlspecialchars($adminemail).") is invalid!<br>";
|
||||
}
|
||||
else
|
||||
{
|
||||
exec('sudo pihole -a -e '.$adminemail);
|
||||
exec('sudo pihole -a -e \''.$adminemail.'\'');
|
||||
}
|
||||
if(isset($_POST["boxedlayout"]))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user