The vulnerability lies in how OpenClaw's QQ Bot extension handles structured media payloads that reference local files. The functions handleImagePayload, handleVideoPayload, and handleFilePayload in extensions/qqbot/src/reply-dispatcher.ts were responsible for processing these payloads.
Before the patch, these functions used the resolveQQBotLocalMediaPath utility to resolve the file path provided in the payload. This utility did not adequately restrict the path to the intended media directory. As a result, a malicious user could craft a payload with a path that used directory traversal sequences (e.g., ../../..) to point to arbitrary files on the host filesystem.
The vulnerable functions would then proceed to read the file at this attacker-controlled path using readFileAsync, exfiltrating its contents. The fix, introduced in commit 2c45b06afdd6f7c621038b5419d8e661cff34a7f, replaces the insecure path resolution with a new function, resolveQQBotPayloadLocalFilePath. This new function canonicalizes the path and strictly ensures it is within the designated QQ Bot media storage directory before allowing it to be used, thus mitigating the path traversal vulnerability. The main dispatcher, handleStructuredPayload, would be the initial function called in an exploit stack trace.