The vulnerability exists in the Feishu card action handling logic within OpenClaw. The root cause is the incorrect assumption that the presence of a chat_id in a Feishu event context implies a 'group' chat. This logic was present in multiple functions, most notably buildSyntheticMessageEvent and handleFeishuCardAction. When a user in a Direct Message (DM) triggered a card action, the application would misclassify the DM as a group chat. This classification error caused the system to skip the dmPolicy enforcement, which should have blocked certain actions in a DM context. An attacker could exploit this to perform actions in a DM that would otherwise be restricted.
The patch addresses this by introducing a new function, resolveCardActionChatType, which explicitly fetches the chat type from the Feishu API when it's not available in the event context. This ensures that DMs are correctly identified, and the appropriate security policies, like dmPolicy, are enforced. The vulnerable functions (handleFeishuCardAction, dispatchSyntheticCommand, and buildSyntheticMessageEvent) were all modified to use this new, more reliable method of determining the chat type.