The vulnerability lies in the OpenClaw ACP client's permission auto-approval mechanism. The root cause is that the client trusted untrusted data from the connected tool server and used weak heuristics to classify operations as 'safe' for auto-approval.
Specifically, the analysis of the patches reveals two main flaws:
-
Untrusted Metadata and Weak Heuristics: The function resolveToolKindForPermission would determine if an operation was safe (e.g., a 'read' or 'search'). It did this by first checking a kind property sent by the server, which a malicious server could easily spoof. If the kind was not present, it fell back to insecure string matching on the tool's name. This allowed a malicious tool with a name like fs_read_secrets to be misclassified as a safe 'read' operation, bypassing user approval.
-
Unscoped File Access: For 'read' operations that were auto-approved, there were no checks to ensure the file path was within the user's current working directory. This meant a malicious tool could request to read sensitive files outside the intended scope (e.g., ~/.ssh/id_rsa) and have it be auto-approved without a prompt.
The fix, implemented across two commits, addresses these issues comprehensively. The resolvePermissionRequest function was refactored to use a new, much stricter shouldAutoApproveToolCall function. This new function no longer trusts the kind property and instead verifies the tool's ID against a hardcoded allowlist of trusted core tools. Furthermore, for the read tool, it now performs strict path validation to ensure any file access is scoped to the current working directory, preventing directory traversal attacks. Finally, the validation for tool names themselves was hardened to prevent parsing-related bypasses.