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
This commit is contained in:
LHMQ878
2026-08-12 02:57:48 +09:00
committed by Xubin Ren
parent ec3dfb21ba
commit a0e60116a3
+1 -1
View File
@@ -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(