Skip to content

Commit 8c5c3e3

Browse files
committed
fix(qqbot): scope token ssrf policy
1 parent 959b6af commit 8c5c3e3

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

extensions/qqbot/src/engine/api/token.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ describe("QQBot token manager", () => {
4242
url: "https://bots.qq.com/app/getAppAccessToken",
4343
auditContext: "qqbot-token",
4444
capture: false,
45-
policy: { allowRfc2544BenchmarkRange: true },
45+
policy: {
46+
hostnameAllowlist: ["bots.qq.com"],
47+
allowRfc2544BenchmarkRange: true,
48+
},
4649
init: {
4750
method: "POST",
4851
headers: {
@@ -66,7 +69,10 @@ describe("QQBot token manager", () => {
6669
expect.objectContaining({
6770
url: "https://bots.qq.com/app/getAppAccessToken",
6871
auditContext: "qqbot-token",
69-
policy: { allowRfc2544BenchmarkRange: true },
72+
policy: {
73+
hostnameAllowlist: ["bots.qq.com"],
74+
allowRfc2544BenchmarkRange: true,
75+
},
7076
}),
7177
);
7278
});

extensions/qqbot/src/engine/api/token.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ const DEFAULT_TOKEN_EXPIRES_IN_SECONDS = 7200;
3333
* See https://github.com/openclaw/openclaw/issues/88984.
3434
*/
3535
const QQBOT_TOKEN_SSRF_POLICY: SsrFPolicy = {
36+
hostnameAllowlist: ["bots.qq.com"],
3637
allowRfc2544BenchmarkRange: true,
3738
};
3839

0 commit comments

Comments
 (0)