diff --git a/pandora_server/lib/PandoraFMS/Core.pm b/pandora_server/lib/PandoraFMS/Core.pm index 8e84a0c834..20f41873e4 100644 --- a/pandora_server/lib/PandoraFMS/Core.pm +++ b/pandora_server/lib/PandoraFMS/Core.pm @@ -3439,7 +3439,7 @@ sub pandora_select_combo_custom_field ($$) { sub pandora_update_agent_custom_field ($$$$) { my ($dbh, $token, $field, $id_agent) = @_; my $result = undef; - $result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', $token, $field, $id_agent); + $result = db_update ($dbh, 'UPDATE tagent_custom_data SET description = ? WHERE id_field = ? AND id_agent = ?', safe_input($token), $field, $id_agent); return $result; } diff --git a/pandora_server/util/pandora_manage.pl b/pandora_server/util/pandora_manage.pl index eff172553a..46c558c472 100755 --- a/pandora_server/util/pandora_manage.pl +++ b/pandora_server/util/pandora_manage.pl @@ -3078,7 +3078,7 @@ sub cli_agent_update_custom_fields() { my @fields = split(',',$exist_option); foreach my $combo (@fields) { - if($combo eq $new_value) { + if($combo eq safe_input($new_value)) { $found = 1; } } @@ -3090,7 +3090,7 @@ sub cli_agent_update_custom_fields() { print_log "\n[INFO] Updating field '$field' in agent with ID '$id_agent'\n\n"; - my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent); + my $result = pandora_update_agent_custom_field ($dbh, $new_value, $custom_field, $id_agent); if($result == "0E0"){ print_log "[ERROR] Error updating field '$field'\n\n";