T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:5- Finding
Unnecessary General-Purpose Command Execution Permission
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md:5
Vulnerability Type: Excessive tool permission and violation of least privilege
Risk Level: MediumVulnerable Code
yaml allowed-tools: read execThe excessive permission is also corroborated by the runtime classification at
SKILL.md:248and the recommendation to execute operating-system network diagnostics atSKILL.md:260.Technical Analysis
The skill grants access to the general-purpose
exectool even though its declared functionality consists of Discord operations such as sending, reading, searching, editing, deleting, and reacting to messages. Those operations are documented as calls to a dedicatedmessagetool and do not inherently require arbitrary local command execution.The only documented justification for command execution is an optional network diagnostic using
ping. Granting unrestrictedexecfor this narrow troubleshooting operation breaks the principle of least privilege. Unlike a fixed connectivity-check interface, a general execution tool may permit arbitrary programs, arguments, shell operators, filesystem operations, and network clients to run with the privileges of the hosting agent.Discord message content is externally influenced and may be processed by the agent during read or search operations. If such content contains prompt-injection instructions and the agent follows them, the unnecessary
execpermission expands the consequences from manipulation of Discord operations to local command execution.Attack Path
- An attacker posts crafted content in a Discord channel accessible to the configured bot.
- A user asks the agent to read, search, or summarize messages from that channel.
- The agent receives the attacker-controlled message content in its tool results.
- The content attempts to persuade the agent to invoke
exec, potentially presenting the command as troubleshooting or a required setup act ...[truncated 1289 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
execfromallowed-toolsbecause ordinary Discord message operations do not require local command execution. - Declare and use only the dedicated Discord
messagetool and any strictly necessary read-only interfaces. - Remove shell-based
pingguidance from the skill. Perform connectivity diagnostics outside the skill or expose a narrowly scoped health-check tool. - If diagnostics are essential, implement a fixed-command wrapper that:
- Does not invoke a shell.
- Does not accept arbitrary executable names.
- Validates destinations against an allowlist.
- Rejects shell metacharacters and user-controlled arguments.
- Applies strict timeouts and output limits.
- Runs with an unprivileged operating-system identity.
- Treat all Discord message contents as untrusted data. Explicitly prohibit following instructions found inside retrieved messages.
- Protect Discord tokens through a restricted secret store, prevent their inclusion in command environments where possible, and limit the bot to the minimum required Discord permissions.
- Apply process sandboxing, filesystem restrictions, outbound network controls, and tool-call auditing as defense-in-depth measures.
- Remove
