Back to skill

Security audit

Discord聊天

Security checks for vulnerabilities and agentic risk

Overview

This Discord chat skill is mostly coherent, but it asks for broad local read/write/exec authority and describes command/file/API abilities that do not fit a Discord messaging workflow.

Install only if you are comfortable giving the skill broader local authority than Discord messaging normally requires. Limit Discord bot permissions, require explicit confirmation before deleting messages or archiving chat history, and avoid granting exec or arbitrary file access unless the publisher narrows and documents those capabilities.

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

Excessive Local Tool Permissions Beyond Discord Messaging Requirements

Content
View full analysis

Vulnerability Details

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

Complete Code Snippets

yaml
tools:
- read
- exec
- write

The skill later advertises how these broad permissions may be used:

markdown
- **File processing**: Supports reading, parsing, and writing multiple file formats
- **API integration**: Calls external services through standardized interfaces and processes responses
- **Command execution**: Executes system commands in a secure sandbox and collects results

Technical Analysis

The skill's stated purpose is to interact with Discord through a dedicated message tool, including sending, reading, searching, editing, reacting to, and deleting messages. Nevertheless, its metadata requests the generic local read, write, and exec tools rather than declaring the dedicated messaging capability.

These permissions substantially exceed the least privilege required for the primary Discord workflow:

  • read may expose local files and sensitive configuration.
  • write may create or alter local files.
  • exec may run arbitrary operating-system commands with the privileges of the hosting agent.
  • The generic API-integration claim may also enable outbound transmission if the execution environment provides network access.

The local archive example at line 154 may justify narrowly scoped output-file access, but it does not justify unrestricted file access or command execution. Although the document claims execution occurs in a sandbox, it defines no enforceable path, command, process, environment-variable, or network restrictions.

No explicit malicious command, credential-theft instruction, persistence mechanism, remote payload, or obfuscated executable content was found. The issue is the unnecessary privilege surface and the potential for those capabilities to be misused.

Attack Path

  1. An agent loads the ...[truncated 1360 chars]
Remediation
View remediation

Remediation Suggestions

  1. Remove generic capabilities that are not essential:

    yaml
    tools:
    - message
    
  2. Remove the generic file-processing, API-integration, and command-execution claims unless those functions are genuine, necessary, and protected by explicit controls.

  3. If local archival is required, replace unrestricted file access with a narrowly scoped capability that:

    • Writes only to a user-approved directory.
    • Rejects absolute paths and path traversal.
    • Prevents overwriting existing files unless the user explicitly confirms it.
    • Does not permit reads from arbitrary local paths.
    • Applies restrictive file permissions.
  4. Do not grant shell execution for Discord messaging or archival. If a separate workflow genuinely requires execution, isolate it into another skill with:

    • An explicit command allowlist.
    • Fixed argument schemas.
    • No shell interpolation.
    • Minimal environment-variable exposure.
    • Disabled network access by default.
    • Resource and execution-time limits.
    • User confirmation before execution.
  5. Validate Discord channel IDs, message IDs, limits, and other parameters using strict schemas. Require confirmation for destructive operations such as deleting messages.

  6. Apply least-privilege Discord permissions. Avoid recommending MANAGE_MESSAGES unless deletion of other users' messages is an explicit and approved requirement.

  7. Add tests or policy checks that reject undeclared tool use and verify that the skill cannot access local files or execute commands during ordinary Discord operations.

Vulnerability Patterns
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (6)

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The activation language is overly broad, covering generic communication, notifications, and integrations rather than narrowly scoping Discord chat actions. Broad trigger phrases increase the likelihood that an agent will select this skill in unrelated contexts, potentially granting it access to read/write/exec tools and message-modification features when a safer, more specific skill should have been used.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill documents destructive and data-moving behaviors—message deletion and writing archived content to a local file—without a prominent warning or consent requirement. In an agent context, that omission can lead to silent deletion of chat history or local persistence of potentially sensitive Discord content, increasing both integrity and confidentiality risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill is labeled both as MD+EXEC and as pure Markdown, creating ambiguity about whether command execution is an intended part of operation. In agent environments, such ambiguity is dangerous because capability classification often drives tool selection and trust decisions; an over-broad label may permit unnecessary exec access for a skill that should be limited to message operations.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill is presented primarily as a Discord messaging integration, but this section advertises broad file handling, API integration, and command execution capabilities. That mismatch can cause an agent or user to over-trust the skill and invoke unnecessary high-risk tools such as exec or write in situations where only Discord messaging should be needed, increasing the chance of unintended command execution or local data access.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Troubleshooting guidance tells the operator to rely on command-line execution and exec capability even though the skill is otherwise described as a Markdown-driven Discord messaging skill. This inconsistency can normalize use of privileged execution paths during failure handling, making it easier for an agent to escalate from chat operations into host command execution without a clear need.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

These benchmark rows evaluate capabilities such as file parsing, multi-file batch processing, API response parsing, and command execution. Those are unrelated to the stated Discord chat purpose and conflict with the rest of the documentation, suggesting templated content that misrepresents the skill's actual intent.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.