The vulnerability in OpenClaw (CVE-2026-43566) allowed for an incorrect authorization scenario where untrusted webhook events could be processed with owner-level privileges. This was due to a flaw in the heartbeat owner downgrade logic, which missed checking for untrusted hook:wake system events.
The analysis of the patch commit 31281bc92f55796817a92bc43f722cba1e77ab42 reveals two key functions that were modified to address this vulnerability:
-
runHeartbeatOnce in src/infra/heartbeat-runner.ts: This function is the entry point for handling heartbeat events. The patch modifies it to explicitly check if any pending system events are marked as untrusted (event.trusted === false). If untrusted events are found, it sets a ForceSenderIsOwnerFalse flag. This is the primary mitigation at the event-handling layer.
-
runPreparedReply in src/auto-reply/reply/get-reply-run.ts: This function is responsible for constructing and running the final reply. It was modified to act on the information from the event handler. It now checks for untrusted content within the system event blocks using a regular expression (/^System \(untrusted\\):/m) and also respects the ForceSenderIsOwnerFalse flag passed down from runHeartbeatOnce. This ensures that the senderIsOwner property is correctly set to false before the reply is executed, effectively downgrading the privileges.
During an exploit, a specially crafted webhook would trigger a hook:wake event. The runHeartbeatOnce function would be called to process this event. In a vulnerable version, this function would fail to detect the untrusted nature of the event, allowing runPreparedReply to execute with senderIsOwner set to true. Both of these functions would therefore appear in a runtime profile or stack trace during exploitation.