2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

mnc: fix arbitrary execution via ../ traversal

This commit is contained in:
Helmut Grohne 2013-02-10 09:02:40 +01:00
parent 34b87128de
commit 55c20ee59b

View File

@ -102,6 +102,14 @@ int main(int argc, char *argv[]) {
strcmp(cmd, "fetch") == 0
) {
char cmdline[LINE_MAX];
if(arg == NULL) {
printf("# no plugin given\n");
continue;
}
if(arg[0] == '.' || strchr(arg, '/')) {
printf("# invalid plugin character");
continue;
}
sprintf(cmdline, "%s/%s", plugin_dir, arg);
if (access(cmdline, X_OK) == -1) {
printf("# unknown plugin: %s\n", arg);