Escape shell arg to remove potential malicious injection

This commit is contained in:
Rob Vella
2020-01-06 17:10:50 -08:00
parent b32f2f0da5
commit 7108f4ed3b
+1 -1
View File
@@ -15,7 +15,7 @@
* auto_prepend_file="/usr/local/emhttp/webGui/include/local_prepend.php"
*/
function csrf_terminate($reason) {
shell_exec("logger error: {$_SERVER['REQUEST_URI']}: $reason csrf_token");
shell_exec("logger error: " . escapeshellarg($_SERVER['REQUEST_URI']) . ": $reason csrf_token");
exit;
}
putenv('PATH=.:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin');