fix(macos-bar): launch dashboard without shell (#1549)

Launches the dashboard without going through a shell, avoiding unescaped-command exposure.
This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-06-16 08:28:31 -04:00
1 parent 8bd289bfae
commit 50f136a1f0
1 file changed
+8 -4
@@ -48,12 +48,16 @@ enum DashboardLauncher {
return
}
// Server isn't up. Start it via `ccs config`, fully detached (nohup) so it
// survives this app quitting; it opens the dashboard on its own.
// Server isn't up. Start it via `ccs config`; it opens the dashboard on its
// own. Avoid a shell here: candidate paths can include user-controlled
// components, and Process can pass the executable and arguments directly.
if let bin = ccsBinary() {
let proc = Process()
proc.executableURL = URL(fileURLWithPath: "/bin/sh")
proc.arguments = ["-c", "nohup \"\(bin)\" config >/dev/null 2>&1 &"]
proc.executableURL = URL(fileURLWithPath: bin)
proc.arguments = ["config"]
let null = FileHandle(forWritingAtPath: "/dev/null")
proc.standardOutput = null
proc.standardError = null
try? proc.run()
return
}