Skip to content

Commit 604777e

Browse files
authored
fix(qqbot): enforce media storage boundary for all outbound local file paths [AI] (#63271)
* fix: address issue * fix: address review-pr skill feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address review feedback * fix: address PR review feedback * fix: address PR review feedback * fix: address PR review feedback * docs: add changelog entry for PR merge
1 parent 414b7b5 commit 604777e

4 files changed

Lines changed: 612 additions & 16 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Docs: https://docs.openclaw.ai
1010

1111
### Fixes
1212

13+
- fix(qqbot): enforce media storage boundary for all outbound local file paths [AI]. (#63271) Thanks @pgondhi987.
1314
- iMessage/self-chat: distinguish normal DM outbound rows from true self-chat using `destination_caller_id` plus chat participants, while preserving multi-handle self-chat aliases so outbound DM replies stop looping back as inbound messages. (#61619) Thanks @neeravmakwana.
1415
- fix(browser): auto-generate browser control auth token for none/trusted-proxy modes [AI]. (#63280) Thanks @pgondhi987.
1516
- fix(exec): replace TOCTOU check-then-read with atomic pinned-fd open in script preflight [AI]. (#62333) Thanks @pgondhi987.

extensions/qqbot/index.ts

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ type MediaTargetContext = {
1717
account: QQBotAccount;
1818
logPrefix: string;
1919
};
20+
type SendDocumentOptions = {
21+
allowQQBotDataDownloads?: boolean;
22+
};
2023

2124
type QQBotFrameworkCommandResult =
2225
| string
@@ -44,14 +47,22 @@ function resolveQQBotAccount(config: unknown, accountId?: string): QQBotAccount
4447
return resolve(config, accountId);
4548
}
4649

47-
function sendDocument(context: MediaTargetContext, filePath: string) {
50+
function sendDocument(
51+
context: MediaTargetContext,
52+
filePath: string,
53+
options?: SendDocumentOptions,
54+
) {
4855
const send = loadBundledEntryExportSync<
49-
(context: MediaTargetContext, filePath: string) => Promise<unknown>
56+
(
57+
context: MediaTargetContext,
58+
filePath: string,
59+
options?: SendDocumentOptions,
60+
) => Promise<unknown>
5061
>(import.meta.url, {
5162
specifier: "./api.js",
5263
exportName: "sendDocument",
5364
});
54-
return send(context, filePath);
65+
return send(context, filePath, options);
5566
}
5667

5768
function getFrameworkCommands(): QQBotFrameworkCommand[] {
@@ -173,7 +184,9 @@ export default defineBundledChannelEntry({
173184
account,
174185
logPrefix: `[qqbot:${account.accountId}]`,
175186
};
176-
await sendDocument(mediaCtx, String(result.filePath));
187+
await sendDocument(mediaCtx, String(result.filePath), {
188+
allowQQBotDataDownloads: true,
189+
});
177190
} catch {
178191
// File send failed; the text summary is still returned below.
179192
}

0 commit comments

Comments
 (0)