mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-04 23:40:23 +00:00
fix(security): harden system.run companion command binding
This commit is contained in:
@@ -291,7 +291,6 @@ export async function handleSystemRunInvoke(opts: HandleSystemRunInvokeOptions):
|
||||
}
|
||||
|
||||
const argv = command.argv;
|
||||
const rawCommand = command.rawCommand ?? "";
|
||||
const shellCommand = command.shellCommand;
|
||||
const cmdText = command.cmdText;
|
||||
const agentId = opts.params.agentId?.trim() || undefined;
|
||||
@@ -388,7 +387,9 @@ export async function handleSystemRunInvoke(opts: HandleSystemRunInvokeOptions):
|
||||
if (useMacAppExec) {
|
||||
const execRequest: ExecHostRequest = {
|
||||
command: plannedAllowlistArgv ?? argv,
|
||||
rawCommand: rawCommand || shellCommand || null,
|
||||
// Forward canonical display text so companion approval/prompt surfaces bind to
|
||||
// the exact command context already validated on the node-host.
|
||||
rawCommand: cmdText || null,
|
||||
cwd: opts.params.cwd ?? null,
|
||||
env: envOverrides ?? null,
|
||||
timeoutMs: opts.params.timeoutMs ?? null,
|
||||
|
||||
Reference in New Issue
Block a user