diff --git a/pandora_console/extensions/grafana/query.php b/pandora_console/extensions/grafana/query.php index 3c7a843542..ac54d98161 100644 --- a/pandora_console/extensions/grafana/query.php +++ b/pandora_console/extensions/grafana/query.php @@ -23,6 +23,9 @@ if ($headers['Authorization']) { list($user, $password) = explode(':', base64_decode($headers['Authorization'])); + // Prevent sql injection. + $user = mysqli_real_escape_string($config['dbconnection'], $user); + // Check user login $user_in_db = process_user_login($user, $password, true); diff --git a/pandora_console/extensions/grafana/search.php b/pandora_console/extensions/grafana/search.php index 9193dd290e..82b670398b 100644 --- a/pandora_console/extensions/grafana/search.php +++ b/pandora_console/extensions/grafana/search.php @@ -24,6 +24,9 @@ if ($headers['Authorization']) { list($user, $password) = explode(':', base64_decode($headers['Authorization'])); + // Prevent sql injection. + $user = mysqli_real_escape_string($config['dbconnection'], $user); + // Check user login $user_in_db = process_user_login($user, $password, true); diff --git a/pandora_console/extras/mr/68.sql b/pandora_console/extras/mr/68.sql index db168d5c22..67ce78c9bc 100644 --- a/pandora_console/extras/mr/68.sql +++ b/pandora_console/extras/mr/68.sql @@ -56,5 +56,7 @@ ADD COLUMN `id_agent_data` int not null default 0 AFTER `script_type`; ALTER TABLE `tusuario` CHANGE COLUMN `metaconsole_data_section` `metaconsole_data_section` TEXT NOT NULL DEFAULT '' ; ALTER TABLE `tmensajes` ADD COLUMN `icon_notification` VARCHAR(250) NULL DEFAULT NULL AFTER `url`; +UPDATE `tncm_template` SET `vendors` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM vendors))), '"]'), `models` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM models))), '"]'); +UPDATE `tncm_agent_data_template` SET `vendors` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM vendors))), '"]'), `models` = CONCAT('["', TRIM(BOTH '"' FROM TRIM(BOTH ']' FROM TRIM(BOTH '[' FROM models))), '"]'); COMMIT; \ No newline at end of file diff --git a/pandora_console/general/header.php b/pandora_console/general/header.php index 5ad89d8d31..35b994fead 100644 --- a/pandora_console/general/header.php +++ b/pandora_console/general/header.php @@ -1021,11 +1021,14 @@ echo sprintf('