mirror of
https://github.com/langgenius/dify-plugin-daemon.git
synced 2026-08-25 13:19:40 -04:00
a00091320c
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.