Skip to content

Commit

Permalink
mnc: fix arbitrary execution via ../ traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
helmutg committed Feb 10, 2013
1 parent 34b8712 commit 55c20ee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tools/munin-node-c/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 55c20ee

Please sign in to comment.