The vulnerability, identified as GHSA-49cg-279w-m73x, allowed an empty list of approvers in OpenClaw to be interpreted as explicit approval authorization. This could permit an unauthorized sender to resolve pending approvals. The analysis of the patch commit 0a105c0900de701d2ee9f1abc96b017afbd0afdd reveals the root cause and the affected functions.
The core of the issue lies in two functions:
-
createResolvedApproverActionAuthAdapter in src/plugin-sdk/approval-auth-helpers.ts: This function is responsible for creating an authorization adapter. In the vulnerable version, if the list of approvers was empty, it would return a generic { authorized: true } object. This did not carry enough information to distinguish it from a case where a sender was explicitly listed as an approver.
-
resolveApprovalCommandAuthorization in src/infra/channel-approval-auth.ts: This function consumes the result from the authorization adapter. It incorrectly interpreted the generic { authorized: true } from an empty approver list as an explicit authorization, setting an explicit: true flag. This bypasses further security checks, such as verifying if the sender is an authorized user for the channel.
The patch rectifies this by introducing a mechanism to mark authorizations derived from an empty approver list as 'implicit'.
- The
createResolvedApproverActionAuthAdapter function is updated to use a new markImplicitSameChatApprovalAuthorization helper. This adds a non-enumerable symbol to the authorization result, effectively tagging it as implicit without changing its structure for most consumers.
- The
resolveApprovalCommandAuthorization function is updated to use a corresponding isImplicitSameChatApprovalAuthorization helper to check for this tag. If the tag is present, it ensures the explicit flag is set to false, thereby preventing the authorization bypass.
By identifying these two functions, createResolvedApproverActionAuthAdapter and resolveApprovalCommandAuthorization, we can pinpoint the exact locations in the code that would be exercised during an exploit of this vulnerability. These functions would appear in a runtime profile when an approval command is processed under the vulnerable conditions.