fix(security): wrap runServer SSH commands with shellQuote in DO and Hetzner (#2843)

DigitalOcean and Hetzner runServer() passed the command string directly
to SSH without shell-quoting, allowing metacharacters (;, |, $(), etc.)
to be interpreted by the remote shell. AWS and GCP already used
`bash -c ${shellQuote(fullCmd)}` — this applies the same pattern to the
two affected modules.

Fixes #2836

Agent: security-auditor

Co-authored-by: B <6723574+louisgv@users.noreply.github.com>
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
A 2026-03-20 17:34:43 -07:00 committed by GitHub
parent ffb4cbeb11
commit 62e5918078
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 22 additions and 2 deletions

View file

@ -753,7 +753,7 @@ export async function runServer(cmd: string, timeoutSecs?: number, ip?: string):
...SSH_BASE_OPTS,
...keyOpts,
`root@${serverIp}`,
fullCmd,
`bash -c ${shellQuote(fullCmd)}`,
],
{
stdio: [