Restrict v-make-tmp-file to tmp folder

This commit is contained in:
Anton Reutov 2021-07-27 14:42:25 +03:00 committed by GitHub
commit ea1e22613e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -104,7 +104,7 @@ if (isset($_POST['user']) || isset($_POST['hash'])) {
// Check command
if ($cmd == "'v-make-tmp-file'") {
// Used in DNS Cluster
$fp = fopen($_POST['arg2'], 'w');
$fp = fopen('/tmp/'.basename($_POST['arg2']), 'w');
fwrite($fp, $_POST['arg1']."\n");
fclose($fp);
$return_var = 0;