From b9513255fd67a9402ed7fb4ff44d90cd15c63f44 Mon Sep 17 00:00:00 2001 From: spooky360 Date: Wed, 5 Aug 2020 17:02:59 +0200 Subject: [PATCH] Fix for self XSS vuln (See https://www.huntr.dev/bounties/2-packagist-dolibarr). --- htdocs/core/lib/functions.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index eba330e5621..1ca594d58d8 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -3911,7 +3911,7 @@ function dol_print_error($db = '', $error = '', $errors = null) { $out .= "".$langs->trans("OS").": ".php_uname()."
\n"; } - $out .= "".$langs->trans("UserAgent").": ".$_SERVER["HTTP_USER_AGENT"]."
\n"; + $out .= "".$langs->trans("UserAgent").": ".dol_htmlentities($_SERVER["HTTP_USER_AGENT"], ENT_COMPAT, 'UTF-8)."
\n"; $out .= "
\n"; $out .= "".$langs->trans("RequestedUrl").": ".dol_htmlentities($_SERVER["REQUEST_URI"], ENT_COMPAT, 'UTF-8')."
\n"; $out .= "".$langs->trans("Referer").": ".(isset($_SERVER["HTTP_REFERER"]) ?dol_htmlentities($_SERVER["HTTP_REFERER"], ENT_COMPAT, 'UTF-8') : '')."
\n";