fix: Possible XSS via email test functionality

This commit is contained in:
Tom Mortensen
2025-12-17 07:56:11 -08:00
parent e90c7005da
commit e8b0f569bd

View File

@@ -40,7 +40,7 @@ function PsKill($pid) {
if (PsExecute("$docroot/webGui/scripts/notify -s 'Unraid SMTP Test' -d 'Test message received!' -i 'alert' -l '/Settings/Notifications' -t")) {
$result = exec("tail -3 /var/log/syslog|awk '/sSMTP/ {getline;print}'|cut -d']' -f2|cut -d'(' -f1");
$color = strpos($result, 'Sent mail') ? 'green' : 'red';
echo _("Test result")."<span class='$color'>$result</span>";
echo _("Test result")."<span class='$color'>".htmlspecialchars($result)."</span>";
} else {
echo _("Test result")."<span class='red'>: "._('No reply from mail server')."</span>";
}