The vulnerability lies in an authorization mismatch where OpenClaw's gateway did not correctly differentiate between write-scoped (operator.write) and admin-scoped (operator.admin) tokens for agent runs. This allowed authenticated users with only write permissions to access and execute owner-only tools, leading to privilege escalation.
The analysis of the security patch (commit 58659b931b823397cae9884292a05ba9d4ad97af) reveals the root cause and the fix. The core of the vulnerability was in the agent:run handler within src/gateway/server-methods/agent.ts, which failed to verify if the caller was a true owner. Deeper in the call stack, the runAgentAttempt function in src/commands/agent.ts unconditionally executed agent runs with owner privileges by hardcoding a senderIsOwner flag to true.
The fix introduces a senderIsOwner flag that is now determined by checking for the operator.admin scope in the caller's token. This flag is propagated from the gateway's agent:run handler down to the runAgentAttempt function, ensuring that only callers with the appropriate administrative privileges can execute owner-only tools. Additional hardening was applied to other paths that can trigger agent runs, such as handleNodeEvent, to explicitly set senderIsOwner to false, further securing the system against this type of privilege escalation.