Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

Merge branch 'main' into feat/application-run-command

Stuart Rowlandsd7d948caf631
diff --cc app/Http/Livewire/Project/Application/Command.php
index 933e94c210,5fea572ee3..86d40ab7b3
--- a/app/Http/Livewire/Project/Application/Command.php
+++ b/app/Http/Livewire/Project/Application/Command.php
@@@ -90,14 -92,10 +92,13 @@@ class Command extends Componen
{
$this->validate();
try {
+ // Wrap command to prevent escaped execution in the host.
+ $cmd = 'sh -c "' . str_replace('"', '\"', $this->command) . '"';
+
- if (!empty($this->dir)) {
- $exec = "docker exec -w {$this->dir} {$this->container} {$cmd}";
- }
- else {
+ if (!empty($this->workDir)) {
- $exec = "docker exec -w {$this->workDir} {$this->container} {$this->command}";
++ $exec = "docker exec -w {$this->workDir} {$this->container} {$cmd}";
+ } else {
- $exec = "docker exec {$this->container} {$this->command}";
+ $exec = "docker exec {$this->container} {$cmd}";
}
$activity = remote_process([$exec], $this->server, ignore_errors: true);
$this->emit('newMonitorActivity', $activity->id);