Files
Sash a00091320c fix(local-runtime): stop inheriting daemon environment in plugin subprocesses (#799)
getInstanceCmd built plugin processes with cmd.Environ(), copying the
daemon's full environment (DB_PASSWORD, SERVER_KEY, DIFY_INNER_API_KEY,
Redis and cloud storage credentials) into every plugin subprocess, where
any installed plugin could read and exfiltrate it over the network.

Replace inheritance with an explicit allowlist builder,
BuildPluginCommandEnv, mirroring the existing buildUVCommandEnv pattern
used for the uv installer child process. The allowlist passes through
what plugins legitimately need (PATH, HOME, locale variables, temp
directories, TZ, CA bundle and proxy variables), daemon config proxy
settings take precedence over inherited ones, and INSTALL_METHOD=local
is set as before. The slim CLI local mode used the same os.Environ()
pattern for marketplace-downloaded plugins and now shares the builder.
2026-08-24 17:07:33 +08:00
..