The vulnerability stems from the failure to persist the session context of outbound messages in the delivery queue. This session context is crucial for enforcing security policies, such as group tool policies and media restrictions. When OpenClaw restarts or recovers, it processes this queue to replay any pending outbound messages. The analysis of the patch commit 48aae82bbc19ba8b0741e61a08063eb0d1df464e reveals the exact points of failure.
The function deliverOutboundPayloads in src/infra/outbound/deliver.ts is the initial point where the session context was available but not passed down to the queuing mechanism. The core of the issue lies in enqueueDelivery in src/infra/outbound/delivery-queue-storage.ts, which was responsible for writing the message to the queue but omitted the session context. Consequently, upon recovery, the buildRecoveryDeliverParams function in src/infra/outbound/delivery-queue-recovery.ts had no session context to retrieve and apply to the replayed message. This allowed a previously queued message to be sent without the original security constraints, leading to a bypass of channel media restrictions. The fix involved passing the session context through this entire chain, ensuring it is persisted and available upon recovery.