Back to skill

Security audit

Discord Connect Wizard

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent Discord setup helper, but it handles bot credentials and local OpenClaw state with several real safety gaps that merit Review before installation.

Install only if you are comfortable with a local wizard that will handle a Discord bot token, change OpenClaw Discord configuration, restart the gateway, and approve pairing. Avoid pasting bot tokens into chat; prefer a secure local input path and rotate the token if it was exposed. Review existing OpenClaw Discord accounts first because this version may overwrite a colliding account ID.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wizard.mjs:286
Finding

Unauthenticated Localhost API Permits Cross-Site State-Changing Requests

Content
View full analysis
{ try { const u = new URL(req.url, `http://${req.headers.host}`); if (req.method === 'GET' && u.pathname === '/') { return text(res, 200, htmlPage(), 'text/html; charset=utf-8'); } if (u.pathname.startsWith('/api/')) { let body = ''; req.on('data', c => (body += c)); await new Promise(r => req.on('end', r)); const payload = body ? JSON.parse(body) : {}; ``` ```js if (req.method === 'POST' && u.pathname === '/api/finalize') { if (!state.accountId) return json(res, 400, { ok: false, error: 'set accountId first' }); if (!state.guildId) return json(res, 400, { ok: false, error: 'pick a guild first' }); if (!state.userId) return json(res, 400, { ok: false, error: 'pick your user first' }); await writeBaselineConfig(); await openclaw(['gateway', 'restart']); // Wait for pairing request for THIS account. const deadline = Date.now() + 5 * 60 * 1000; while (Date.now() < deadline) { const { stdout } = await openclaw(['pairing', 'list', 'discord', '--account', state.accountId, '--json']); let data; try { data = JSON.parse(stdout); } catch { data = null; } const reqs = data?.requests || data || []; if (Array.isArray(reqs) && reqs.length) { const code = reqs[0]?.code; if (code) { state.pairingCode = code; await openclaw(['pairing', 'approve', 'discord', code]); return json(res, 200, { ok: true, pairingApproved: true }); } } await wait(2000); } return json(res, 408, { ok: false, error: 'Timeout waiting for pairing. Ensure Discord allows DMs from server members, then DM the bot and retry.' }); } ``` ### Technical Analysis The service is ...[truncated 2130 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/wizard.mjs:262
Finding

Deterministic Account Identifier Can Overwrite Existing OpenClaw Accounts

Content
View full analysis
` already exists before multiple `openclaw config set` commands modify it. This contradicts the project's documented guarantee that the wizard creates a new account and “never overwrites existing bots.” This is a destructive configuration-collision flaw rather than command injection: `execFile` avoids shell interpretation, but ...[truncated 1074 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/wizard.mjs:250
Finding

Discord Bot Token Is Exposed in Child-Process Arguments

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/wizard.mjs:387
Finding

Pairing Approval Omits the Selected Account Scope

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (13)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 39)May include surrounding context.

md
node scripts/wizard.mjs

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 91)May include surrounding context.

md
node scripts/wizard.mjs

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill explicitly allows a fallback where the user pastes a Discord bot token into chat, creating a direct natural-language exfiltration path for a high-value secret. Even if the text says to avoid logging the token, sending it through chat exposes it to the agent context, transcripts, integrations, retention systems, or accidental disclosure, and a bot token can grant full bot impersonation until rotated.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The README explicitly advertises automated config writes and gateway restarts but does not clearly warn the user that the skill will make local system and service changes. In a one-machine onboarding flow, this can cause unexpected modification of OpenClaw configuration or interruption of running services, especially if the operator assumes the skill is advisory rather than state-changing.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill describes behavior requiring browser, network, and likely environment/config access, but it does not declare explicit tool scope or permissions boundaries. That mismatch can cause an agent runtime to execute sensitive actions with broader-than-expected capabilities, reducing transparency and informed consent for operations involving Discord setup, token handling, and local configuration changes.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

The skill directs the agent to autonomously drive the Developer Portal, self-recover, and minimize user involvement, which increases the chance of the agent taking sensitive external actions without granular confirmation. In context, this includes creating apps, configuring bot settings, generating invite flows, and potentially restarting local services, all of which are meaningful account and system changes.

Content

Scanner excerpt · SKILL.md (reported line 27)May include surrounding context.

md
### Conversation mode (recommended)
Use browser automation + chat prompts. No localhost UI required.

Hard requirement: **agent opens and drives the Developer Portal via browser tool** (do not ask user to open pages or click around).
Resilience rule: if the browser tool times out / disconnects, the agent must **self-recover** (restart gateway/browser as needed) and retry. Only ask the user to click if recovery is impossible.
UX rule: whenever the user must act (login/CAPTCHA/MFA/OAuth authorize), send a screenshot + **ONE** instruction line.
If you need a deterministic step list, run:

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs the wizard to store a Discord bot token in OpenClaw configuration and restart the gateway, but the description does not prominently warn about these sensitive side effects. This is dangerous because bot tokens are secrets whose storage location and persistence matter, and automatic service restarts can disrupt running systems or apply unreviewed configuration immediately.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction explicitly requires a specific Chinese phrasing and prohibits an alternative question form, which imposes a language choice on the interaction. This is a natural-language policy concern because the file does not indicate user opt-in or a justified locale-specific scope.

Content

No source excerpt is available for this finding.

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · references/conversation-mode.md (reported line 10)May include surrounding context.

md
## Flow

1) Agent opens https://discord.com/developers/applications (agent must do this; do NOT ask user to open it)
2) Agent creates new application (name auto-generated, must NOT contain "discord")
3) Agent navigates to Bot page, enables intents, saves
4) Agent triggers Reset Token (and clicks confirm)

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/conversation-checklist.mjs (reported line 46)May include surrounding context.

js
## Flow

1) Agent opens https://discord.com/developers/applications (agent must do this; do NOT ask user to open it)
2) Agent creates new application (name auto-generated, must NOT contain "discord")
3) Agent navigates to Bot page, enables intents, saves
4) Agent triggers Reset Token (and clicks confirm)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The checklist correctly instructs the agent not to log or echo the Discord bot token, but it also says that if the user pastes the token in chat the agent should proceed without first warning that chat may expose secrets to logs, transcripts, or other tooling. In a skill specifically handling bot credential setup, omission of an explicit 'do not paste secrets into chat' warning materially increases the chance of credential leakage through the agent interface.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code serves a user-facing HTML wizard whose headings, instructions, and status text are written in Chinese, but there is no indication that the skill is China-specific or that users can opt into another language. The policy explicitly flags skills that force a specific language or locale without user choice or justified documentation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The UX rule gives a fixed example of wording to avoid using Chinese text, which implies a language-specific interaction policy embedded in the skill. Because the file does not offer a language choice or document a justified locale constraint, this can violate the language/locale policy requirement.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
scripts/wizard.mjs:18