diff --git a/pandora_agents/ChangeLog b/pandora_agents/ChangeLog index cc896ccbbe..cc84a14157 100644 --- a/pandora_agents/ChangeLog +++ b/pandora_agents/ChangeLog @@ -1,3 +1,7 @@ +2011-08-10 Vanessa Gil + + * unix/pandora_agent.php: Fixed error reading collections of the configuration file. + 2011-08-09 Miguel de Dios * DEBIAN/control: fixed the name of package and update version number. diff --git a/pandora_agents/unix/pandora_agent b/pandora_agents/unix/pandora_agent index 76fbf31c34..8713b98eed 100755 --- a/pandora_agents/unix/pandora_agent +++ b/pandora_agents/unix/pandora_agent @@ -420,6 +420,11 @@ sub parse_conf_modules($) { # Collection } elsif ($line =~ /^\s*file_collection\s+(.+)$/) { my $collection = $1; + + # Prevent path traversal attacks + if ($collection !~ m/(\.\.)|\//) { + $Collections{$collection} = 0; + } # Min critical } elsif ($line =~ /^\s*module_min_critical\s+(.*)\s*$/) { $module->{'min_critical'} = $1; @@ -516,7 +521,7 @@ sub read_config (;$) { # Remove trailing spaces $Conf{$1} =~ s/\s*$//; - } + } } # Module, plugin and collection definition