Skip to content

Commit 0dc1761

Browse files
authored
Merge pull request #722 from nextcloud/fix-hardening-setup-wizard
Quote paths when invoking notify_push binary
2 parents 3b9ab37 + 4a4cc47 commit 0dc1761

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/SetupWizard.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function testBinary(): bool {
5656
$path = $this->getBinaryPath();
5757
@chmod($path, 0755);
5858
$output = [];
59-
exec("$path --version", $output);
59+
exec(escapeshellarg($path) . ' --version', $output);
6060
return count($output) === 1 && strpos($output[0], 'notify_push') === 0;
6161
}
6262

@@ -113,7 +113,7 @@ public function testAutoConfig(bool $selfSigned) {
113113
2 => ['pipe', 'w'],
114114
];
115115
$pipes = [];
116-
$proc = proc_open("exec $path $config", $descriptorSpec, $pipes, null, [
116+
$proc = proc_open('exec ' . escapeshellarg($path) . ' ' . escapeshellarg($config), $descriptorSpec, $pipes, null, [
117117
'PORT' => 7867,
118118
'ALLOW_SELF_SIGNED' => $selfSigned ? 'true' : 'false',
119119
'LOG' => 'notify_push=info',

0 commit comments

Comments
 (0)