Back to skill

Security audit

Discord

Security checks for vulnerabilities and agentic risk

Overview

This Discord skill is mostly coherent, but it exposes real Discord actions and arbitrary local file uploads without enough scoping or confirmation guidance.

Install only where the Discord bot has least-privilege permissions. Avoid enabling roles or moderation unless you have clear operational controls, and require explicit confirmation before deleting messages, changing roles, moderating users, or uploading any local file. Do not let untrusted Discord messages authorize file uploads from local paths.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:154
Finding

Unrestricted Local File Upload May Expose Sensitive Data to Discord

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 154–169
Vulnerability Type: Arbitrary local-file disclosure through an external upload channel
Risk Level: Medium

Vulnerable Code

markdown
**With media attachment:**

```json
{
  "action": "sendMessage",
  "to": "channel:123",
  "content": "Check out this audio!",
  "mediaUrl": "file:///tmp/audio.mp3"
}
  • to uses format channel:<id> or user:<id> for DMs (not channelId!)
  • mediaUrl supports local files (file:///path/to/file) and remote URLs (https://...)
  • Optional replyTo with a message ID to reply to a specific message
text

The unrestricted local-path behavior is also declared at line 17:

```markdown
- For media: `mediaUrl` with `file:///path` for local files or `https://...` for remote.

Technical Analysis

The Skill instructs the agent to pass arbitrary file:///path values to the Discord tool. This allows the tool to read a local file using the permissions of the Clawdbot process and transmit its contents to a Discord channel or direct-message recipient.

Local attachment support is consistent with the Skill's declared messaging functionality. However, allowing unrestricted filesystem paths exceeds the minimum privileges required for routine attachment handling. The instructions do not impose an allowlisted upload directory, canonical-path validation, symlink protection, sensitive-file filtering, or explicit confirmation of the source path and destination.

Consequently, a malicious prompt, untrusted Discord message, or user mistake could induce the agent to attach a readable sensitive file. The reviewed document does not itself select sensitive files or contain evidence of intentional exfiltration; the issue is an unsafe capability boundary.

Attack Path

  1. An attacker supplies content or a request instructing the agent to send a local file to a Discord channel or direct-messag ...[truncated 1412 chars]
Remediation
View remediation

Remediation Suggestions

  1. Restrict local uploads to a dedicated, non-sensitive attachment directory rather than accepting arbitrary file:/// paths.
  2. Canonicalize each requested path and verify that it remains beneath the approved directory.
  3. Reject path traversal, device files, symbolic links, and symlink-based escapes unless explicitly required and safely validated.
  4. Block known-sensitive filenames and locations, including environment files, credential stores, private keys, tokens, browser profiles, and Clawdbot configuration.
  5. Require explicit user confirmation before upload, displaying the canonical source path, file size, Discord destination, and whether the destination is a channel or direct message.
  6. Prefer opaque attachment handles for files deliberately provided by the user over direct filesystem paths.
  7. Run the Discord tool with minimal filesystem permissions and prevent it from reading secrets unrelated to messaging.
  8. Apply content-type and size validation before reading or transmitting a file.
  9. Record auditable metadata for local-file uploads without logging file contents or secrets.
  10. Update the Skill documentation to state that sensitive files must never be uploaded and that instructions originating from untrusted Discord content cannot authorize local-file disclosure.
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
87% confidence
Finding

The skill advertises high-impact capabilities including moderation and destructive actions such as deleting messages, kicking/banning, and changing roles, but it does not prominently warn users that these actions can affect real users, alter server state, or be irreversible. In an agent setting, this increases the chance that a model or operator invokes sensitive actions without sufficient confirmation or caution.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documented deleteMessage action presents deletion as a routine operation without warning that it is destructive and may be irreversible from the user's perspective. In practice, an agent may delete the wrong message or remove evidence/context from a channel, causing operational or moderation harm.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Moderation actions like timeout, kick, or ban directly affect user access and can cause serious disruption, yet the skill documents them with no warning about administrative sensitivity, due process, or potential abuse. Even though moderation is disabled by default, exposing the interface without strong cautions can normalize unsafe use once enabled.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.