From 646e71a9be070a8b8e05cf4fde7ddbad6ffa7fec Mon Sep 17 00:00:00 2001 From: kshitij <82637225+kshitijk4poor@users.noreply.github.com> Date: Tue, 21 Jul 2026 11:46:29 +0530 Subject: [PATCH] fix: sanitize subprocess env for DDGS worker os.environ.copy() passes all Hermes secrets (gateway tokens, API keys, dashboard session tokens) into the DDGS child process. Use _sanitize_subprocess_env() to strip Hermes-managed secrets before spawning the worker. --- plugins/web/ddgs/provider.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/web/ddgs/provider.py b/plugins/web/ddgs/provider.py index 28e4762bec7e..44a3aca6c8c3 100644 --- a/plugins/web/ddgs/provider.py +++ b/plugins/web/ddgs/provider.py @@ -156,7 +156,9 @@ def _run_ddgs_search_bounded(query: str, safe_limit: int) -> list[dict[str, Any] if _test_hook: request["test_hook"] = _test_hook - env = os.environ.copy() + from tools.environments.local import _sanitize_subprocess_env + + env = _sanitize_subprocess_env(dict(os.environ)) if _test_hook: env["HERMES_DDGS_ALLOW_TEST_HOOKS"] = "1"