Skip to content

[Bug] QQ bot token fetch still blocked by SSRF — RFC2544 benchmark range not allowed #88984

@Jensenwgd

Description

@Jensenwgd

Bug Description

The QQ bot plugin cannot obtain access tokens because fetchWithSsrFGuard in doFetchToken() is called without a policy parameter. When bots.qq.com resolves to a 198.18.x.x address (RFC 2544 benchmark range), the default SSRF policy blocks it.

Error Log

[security] blocked URL fetch (qqbot-token) target=https://bots.qq.com/app/getAppAccessToken reason=Blocked: resolves to private/internal/special-use IP address
[qqbot:token:1903616641] Connection failed: Network error getting access_token: Blocked: resolves to private/internal/special-use IP address

bots.qq.com resolves to 198.18.0.70 — an address in the RFC 2544 benchmark address range (198.18.0.0/15).

Root Cause

In the QQ bot plugin's bundled runtime JS (runtime-DWfbz21q.js), the doFetchToken() method calls fetchWithSsrFGuard() without passing a policy parameter:

const guarded = await fetchWithSsrFGuard({
    url: TOKEN_URL,
    auditContext: "qqbot-token",
    capture: false,
    // ❌ Missing: policy parameter — uses default strict SSRF policy
    init: { method: "POST", headers, body },
});

Meanwhile the media upload path already has the correct policy:

const QQBOT_MEDIA_SSRF_POLICY = {
    hostnameAllowlist: ["*.qpic.cn", "*.qq.com", ...],
    allowRfc2544BenchmarkRange: true  // ✅
};

The fix is to add policy: { allowRfc2544BenchmarkRange: true } to the token fetch call, exactly as the media path already does.

Environment

  • OpenClaw 2026.5.28 (gateway, latest stable)
  • QQ bot plugin 2026.5.28
  • Linux (WSL2), Node 22.22.2
  • DNS resolver returns 198.18.0.70 for bots.qq.com

Workaround

Patch the QQ bot plugin runtime JS file directly:

  • File: ~/.openclaw/npm/projects/openclaw-qqbot-*/node_modules/@openclaw/qqbot/dist/runtime-DWfbz21q.js
  • Target: doFetchToken() method's fetchWithSsrFGuard call
  • Change: inject policy: { allowRfc2544BenchmarkRange: true } between capture: false and init

A systemd ExecStartPre can re-apply the patch on every gateway start.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-security-reviewClawSweeper marked this issue as needing security-sensitive review.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:auth-providerAuth, provider routing, model choice, or SecretRef resolution may break.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions