Skip to content

Commit

Permalink
Merge pull request pi-hole#866 from pi-hole/fix/admin-email-security
Browse files Browse the repository at this point in the history
Prevent possible attacks via admin email setting
  • Loading branch information
AzureMarker authored Dec 7, 2018
2 parents 48e65ee + 064e652 commit 00295ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/pi-hole/php/savesettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -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"]))
{
Expand Down

0 comments on commit 00295ba

Please sign in to comment.