From a0e60116a33d6d31d2ce7410ed0df3ea3f1f10c6 Mon Sep 17 00:00:00 2001 From: LHMQ878 <72402929@cityu-dg.edu.cn> Date: Thu, 6 Aug 2026 19:54:52 +0800 Subject: [PATCH] fix(cli): stop leaking API keys to CLI app subprocesses Installed CLI apps were started with os.environ.copy(), so provider keys from the parent process were visible to untrusted binaries. Use a minimal allowlist env matching the shell tool. Fixes #4783 --- nanobot/apps/cli/service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nanobot/apps/cli/service.py b/nanobot/apps/cli/service.py index c4629f56a..165a8476a 100644 --- a/nanobot/apps/cli/service.py +++ b/nanobot/apps/cli/service.py @@ -1019,7 +1019,7 @@ class CliAppManager: "PYTHONUNBUFFERED": "1", } - def _run_argv(self, argv: list[str], *, timeout: int) -> subprocess.CompletedProcess[str]: + def _run_argv(self, argv: list[str], *, timeout: int) -> subprocess.CompletedProcess[str]: command = subprocess.list2cmdline(argv) logger.info("CLI Apps: running {}", command) result = subprocess.run(