The analysis of the provided patches reveals two main vulnerabilities within the exec tool of OpenClaw, both leading to a bypass of security controls.
The first vulnerability, addressed in commit 235ad7ec956513c632c20eedd68bfbedc8cc3ea8, is in the createExecTool function in src/agents/bash-tools.exec.ts. This function was incorrectly calculating the security level for the exec tool by using minSecurity to combine the operator-configured security level with a security parameter that could be supplied by the model. This allowed a malicious or compromised model to request a lower security level (e.g., allowlist instead of full) and bypass the intended security policy, leading to unauthorized command execution. The fix makes the configured security level authoritative, ignoring the model-supplied parameter.
The second vulnerability, addressed in commit a8a34c92f397b55f81ca09cbacc3bc2469a2d427, is a path traversal-like issue in the validateScriptFileForShellBleed function, also in src/agents/bash-tools.exec.ts. This function, responsible for pre-flight checks on scripts to be executed, did not properly handle paths containing a tilde (~). The naive normalization of such paths could be exploited to make the application read and execute a script from outside the intended workspace directory. The patch introduces a dedicated function, readLiteralTildePreflightScript, to securely handle these paths by resolving their real path and ensuring they are within the workspace root before reading them.
Both of these functions are critical to the security of the exec tool. During an exploit, createExecTool would have been called to create a misconfigured tool, and then the tool's execute method would be called, which in turn calls validateScriptFileForShellBleed for script execution, triggering the vulnerabilities. Therefore, these two functions are the root cause and would be indicators of the vulnerability being present or exploited.