diff --git a/scripts/pi-hole/php/update_checker.php b/scripts/pi-hole/php/update_checker.php index fe133073..95c5d610 100644 --- a/scripts/pi-hole/php/update_checker.php +++ b/scripts/pi-hole/php/update_checker.php @@ -105,28 +105,28 @@ $webUrl = 'https://github.com/pi-hole/AdminLTE/releases'; $ftlUrl = 'https://github.com/pi-hole/FTL/releases'; $dockerUrl = 'https://github.com/pi-hole/docker-pi-hole/releases'; -// Version strings +// Version strings (encoded to avoid code execution) // If "vDev" show branch/commit, else show link if (isset($core_commit)) { - $coreVersionStr = $core_current.' ('.$core_branch.', '.$core_commit.')'; + $coreVersionStr = htmlentities($core_current.' ('.$core_branch.', '.$core_commit.')'); } else { - $coreVersionStr = ''.$core_current.''; + $coreVersionStr = ''.htmlentities($core_current).''; } if (isset($web_commit)) { - $webVersionStr = $web_current.' ('.$web_branch.', '.$web_commit.')'; + $webVersionStr = htmlentities($web_current.' ('.$web_branch.', '.$web_commit.')'); } else { - $webVersionStr = ''.$web_current.''; + $webVersionStr = ''.htmlentities($web_current).''; } if (isset($FTL_commit)) { - $ftlVersionStr = $FTL_current.' ('.$FTL_branch.', '.$FTL_commit.')'; + $ftlVersionStr = htmlentities($FTL_current.' ('.$FTL_branch.', '.$FTL_commit.')'); } else { - $ftlVersionStr = ''.$FTL_current.''; + $ftlVersionStr = ''.htmlentities($FTL_current).''; } if ($docker_current) { - $dockerVersionStr = ''.$docker_current.''; + $dockerVersionStr = ''.htmlentities($docker_current).''; } else { $dockerVersionStr = ''; }