From 3906a384898b0083acf0b5387d4afd67dee78c6d Mon Sep 17 00:00:00 2001 From: "tembo-io[bot]" <208362400+tembo-io[bot]@users.noreply.github.com> Date: Sun, 22 Jun 2025 09:05:11 +0000 Subject: [PATCH] fix: prevent command injection vulnerability in log tailing commands --- src/cli/log-widget.ts | 2 +- src/cli/tail-log.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cli/log-widget.ts b/src/cli/log-widget.ts index a18e1e893..9e2de9f51 100644 --- a/src/cli/log-widget.ts +++ b/src/cli/log-widget.ts @@ -43,4 +43,4 @@ let handleLog = line => { } let logPath = getLogFromScriptPath(scriptPath) -await execLog(`tail -f ${logPath}`, handleLog) +await execLog("tail", ["-f", logPath], handleLog) diff --git a/src/cli/tail-log.ts b/src/cli/tail-log.ts index 89c1d8719..27dcac8d8 100644 --- a/src/cli/tail-log.ts +++ b/src/cli/tail-log.ts @@ -4,4 +4,4 @@ import { getLogFromScriptPath } from "../core/utils.js" let scriptPath = await arg("Script Path") let logPath = getLogFromScriptPath(scriptPath) -await terminal(`tail -f ${logPath}`) +await terminal("tail", ["-f", logPath])