EotvosCollegium / mars

Audit required: Function may be vulnerable to arbitrary commands execution PHP-A1009
Security
Critical
4 months ago2 years old
exec() can be vulnerable to arbitrary command execution
85        } else {
86            $command = config('commands.pdflatex') . " " . "-interaction=nonstopmode -output-dir " . $outputDir . " " . $path . " 2>&1";
87            Log::info($command);
88            $result = exec($command);89            Log::info($result);
90        }
91        return $result;
exec() can be vulnerable to arbitrary command execution
73        } else {
74            // This happens too often to log.
75            $command = config('commands.ping') . " " . $router->ip . " -c 1 | grep 'error\|unreachable'";
76            $result = exec($command);77        }
78        return $result;
79    }
exec() can be vulnerable to arbitrary command execution
60        if (self::isDebugMode()) {
61            $result = rand(1, 10);
62        } else {
63            $result = exec($command);64        }
65        Log::info([$command, $result]);
66        return $result;
exec() can be vulnerable to arbitrary command execution
47            // cancel(1) exits with status code 0 if it succeeds
48            $result = ['output' => '', 'exit_code' => 0];
49        } else {
50            $output = exec($command, $result, $exit_code);51            $result = ['output' => $output, 'exit_code' => $exit_code];
52        }
53        Log::info([$command, $result]);
exec() can be vulnerable to arbitrary command execution
34            $job_id = 0;
35            $result = "request id is " . config('print.printer_name') . "-" . $job_id . " (1 file(s))";
36        } else {
37            $result = exec($command);38        }
39        Log::info([$command, $result]);
40        return $result;