The vulnerability, GHSA-7wv4-cc7p-jhxc, allows for the injection of runtime-control variables through a workspace's .env file in OpenClaw. The analysis of the fixing commit dbfcef319618158fa40b31cdac386ea34c392c0c reveals that the core of the issue lies in the insufficient filtering of environment variables when loading a .env file.
The file src/infra/dotenv.ts was modified to expand the blocklists of sensitive keys. The function loadWorkspaceDotEnvFile is identified as the primary function for loading these .env files, as demonstrated by its use in the new test cases within src/infra/dotenv.test.ts. This function processes the potentially malicious file.
Inside this process, the function shouldBlockWorkspaceRuntimeDotEnvKey is used to determine if a specific key should be blocked. The vulnerability was a bypass of this check due to incomplete blocklists. The patch addresses this by adding numerous runtime-control variables (e.g., OPENCLAW_GATEWAY_URL, BROWSER_EXECUTABLE_PATH) and key prefixes (e.g., OPENCLAW_SKIP_, OPENCLAW_UPDATE_) to the blocklists used by this function.
Therefore, during exploitation, the loadWorkspaceDotEnvFile function would be called to read the malicious .env file, and the shouldBlockWorkspaceRuntimeDotEnvKey function would fail to block the malicious keys, leading to their injection into the application's environment. Both functions would appear in a runtime profile of the exploitation.