From 49b5c081d68b3caf3cb4fe094f09dcf50c816e34 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 25 Jan 2024 17:51:09 +0100 Subject: [PATCH] FIX HTML injection vulnerability in Dolibarr Application Home Page FIX #GHSA-7947-48q7-cp5m --- htdocs/filefunc.inc.php | 2 +- htdocs/main.inc.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/filefunc.inc.php b/htdocs/filefunc.inc.php index c3fd4705b6d..cba47566c2b 100644 --- a/htdocs/filefunc.inc.php +++ b/htdocs/filefunc.inc.php @@ -34,7 +34,7 @@ if (!defined('DOL_APPLICATION_TITLE')) { define('DOL_APPLICATION_TITLE', 'Dolibarr'); } if (!defined('DOL_VERSION')) { - define('DOL_VERSION', '18.0.4'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c + define('DOL_VERSION', '18.0.5'); // a.b.c-alpha, a.b.c-beta, a.b.c-rcX or a.b.c } if (!defined('EURO')) { diff --git a/htdocs/main.inc.php b/htdocs/main.inc.php index ab78b4bd5f7..0c6ecd25933 100644 --- a/htdocs/main.inc.php +++ b/htdocs/main.inc.php @@ -2164,6 +2164,7 @@ function top_menu($head, $title = '', $target = '', $disablejs = 0, $disablehead if (isset($_POST) && is_array($_POST)) { foreach ($_POST as $key => $value) { + $key = preg_replace('/[^a-z0-9_\-\[\]/i', '', $key); if (in_array($key, array('action', 'massaction', 'password'))) { continue; }