T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:12- Finding
Overprivileged Discord Message Management with Ambiguous Deletion Scope
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 12–16 and 31
Vulnerability Type: Excessive Discord permissions and insufficiently constrained message deletion
Risk Level: MediumVulnerable Code
markdown - Uses OpenClaw's built-in `message` tool for all Discord operations (`channel-list`, `read`, `send`, `delete`, `edit`) - Bot must have "View Channel" permission in the guild to list channels - Bot must have "Send Messages" + "Manage Messages" in the guide channel to post/deletemarkdown 4. **If changes found:** Delete old guide messages and post fresh guideTechnical Analysis
The Skill explicitly requests Discord's
Manage Messagespermission and directs the Agent to delete “old guide messages.” This permission permits deletion of messages authored by other users within every channel where the permission is effective. It is broader than is ordinarily necessary if the guide consists only of messages previously posted by the bot, because a bot can edit or delete its own messages without receiving general authority to manage other users' messages.The deletion instructions do not define a safe target-selection mechanism. In particular, they do not require the Agent to:
- Retain and use the IDs of guide messages created by the Skill.
- Verify that each targeted message was authored by the bot.
- Distinguish guide content from administrator or user messages.
- Exclude pinned messages.
- Request confirmation when ownership or purpose is uncertain.
- Prefer editing existing guide messages over deleting and recreating them.
The combination of an overbroad permission and an ambiguous deletion rule violates least-privilege principles. Natural-language interpretation errors, unexpected guide-channel content, or misleading messages could cause the Agent to delete content unrelated to the generated guide.
The Skill's Discord network activity is otherwise consistent with its de ...[truncated 1775 chars]
- Remediation
View remediation
Remediation Suggestions
- Remove
Manage Messagesfrom the default requirements when the Skill only manages bot-authored guide messages. - Prefer
editoperations against known bot-owned messages instead of deleting and reposting the guide. - Persist the exact Discord message IDs created by the Skill and permit mutation only when a target ID matches that allowlist.
- Before editing or deleting a message, verify that its author ID equals the configured bot identity.
- Never delete pinned messages or messages authored by users, moderators, webhooks, or other bots.
- If stored message IDs are missing or ownership cannot be verified, stop and request explicit administrator confirmation rather than scanning and deleting messages heuristically.
- If
Manage Messagesis operationally unavoidable, grant it through a channel-specific override limited exclusively to the guide channel. Do not grant it at the guild or category level. - Add an explicit deletion limit and fail closed if more messages than expected would be affected.
- Log target message IDs, authorship checks, and planned changes before mutation, while avoiding storage of unrelated message content.
- For scheduled silent runs, use a dry-run comparison first and only apply changes when every target passes the ownership and scope checks.
- Remove
