Back to skill

Security audit

Discord 基础控制

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its Discord bot-control purpose, but it asks for broad command and file authority while enabling message deletion, local archiving, and callback URLs without enough scoping or safety guidance.

Review before installing. Use it only in a constrained agent environment, grant Discord bot permissions narrowly, avoid using untrusted callback URLs, require explicit approval before deleting messages, and protect any local archives because they may contain private Discord content. Removing general exec access would materially reduce risk.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Warning
Location
SKILL.md:25
Finding

Unnecessary General-Purpose Command Execution Permission

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 25–28
Vulnerability Type: Excessive tool permissions violating least privilege
Risk Level: Medium

yaml
tools:
  - read
  - exec
  - write

Related execution-oriented configuration at lines 174–180:

markdown
### Availability Classification
- **Classification**: MD+EXEC()

**API Key Configuration**:
```bash
export API_KEY=${API_KEY:?Please set the environment variable}

After configuration, restart the session or open a new terminal for it to take effect. API keys should be properly protected and must not be committed to version control.

text

### Technical Analysis

The skill declares access to the general-purpose `exec` tool even though its documented functionality consists of structured Discord operations such as sending, reading, editing, deleting, reacting to, and pinning messages. These operations do not inherently require arbitrary local command execution.

The only documented shell operation checks whether a generic environment variable exists. This does not justify granting unrestricted command execution to the skill. A platform-managed secret configuration mechanism or a narrowly scoped validation tool would provide the required functionality without exposing a shell.

Granting `exec` expands the skill's authority beyond its stated purpose and violates the principle of least privilege. If attacker-controlled Discord content, user input, or another untrusted instruction influences the agent, the unnecessarily available execution tool could be invoked for operations unrelated to Discord management.

No directly malicious command, automatic execution flow, or embedded executable payload was identified. Exploitation therefore depends on the host agent granting the declared tool and allowing untrusted content to influence tool invocation.

### Attack Path

1. The host loads the skill and grants the tools declared in its metad
...[truncated 1086 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove exec from the declared tool list because the documented Discord operations do not require arbitrary shell access:

    yaml
    tools:
      - read
      - write
    
  2. Prefer narrowly scoped Discord APIs and purpose-specific tools for message, reaction, pin, and permission operations.

  3. Replace the shell-based API_KEY check with the agent platform's managed secret configuration and validation mechanism. Use a Discord-specific variable name where configuration documentation is necessary.

  4. If command execution is genuinely required in a future version, expose only an allowlisted wrapper that accepts fixed operations and validated arguments rather than a general-purpose shell.

  5. Require explicit user approval for any local process execution and run the skill in a sandbox with minimal filesystem, environment-variable, and network access.

  6. Treat Discord messages and other externally sourced text as untrusted data. Do not interpret their contents as agent instructions or executable commands.

Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The documented callback_url enables transmission of operation results to an external endpoint, but the skill provides no warning about sending potentially sensitive Discord data off-platform. This can expose message contents, metadata, or bot activity to unintended third parties if users supply an insecure, untrusted, or misconfigured URL.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill explicitly supports destructive deletion and local archiving of Discord messages, but it does not warn users about irreversible data loss, retention implications, or the sensitivity of archived message contents. In a messaging/admin context, omission of these warnings can lead to accidental deletion of important records or insecure storage of exported conversation data.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The '消息写作风格' section prescribes how messages should be written, and the entire skill is presented only in Chinese without any indication that users may choose another language. This can be read as forcing a specific language/locale behavior without explicit opt-in or a documented region-specific justification.

Content

No source excerpt is available for this finding.