Skip to content

Commit

Permalink
Sanitize email address in case of security issues (pi-hole#3254)
Browse files Browse the repository at this point in the history
* Sanitize email address in case of security issues

Signed-off-by: bash-c <aboultraman@gmail.com>
  • Loading branch information
bash-c committed Apr 5, 2020
1 parent a2d2639 commit 2de5362
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions advanced/Scripts/webpage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,13 @@ Options:
fi

if [[ -n "${args[2]}" ]]; then

# Sanitize email address in case of security issues
if [[ ! "${args[2]}" =~ ^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$ ]]; then
echo -e " ${CROSS} Invalid email address"
exit 0
fi

change_setting "ADMIN_EMAIL" "${args[2]}"
echo -e " ${TICK} Setting admin contact to ${args[2]}"
else
Expand Down

0 comments on commit 2de5362

Please sign in to comment.