T09 · Insecure Skill Coding Practices
- Location
scripts/discord-purge-tool.py:47- Finding
Privileged Discord Bot Token Stored in a Plaintext Project File
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is built for Discord message cleanup, but it warrants Review because it combines privileged deletion authority with broad triggers, plaintext token guidance, and a packaged legacy script without a dry-run safeguard.
Install only if you are comfortable giving a Discord bot message-management permissions. Prefer DISCORD_TOKEN or a secret manager instead of token.json, never commit or share the token, run the active script in dry-run mode first, confirm the exact channel ID and count before using --delete, and remove or ignore the backup no-dry-run files.
scripts/discord-purge-tool.py:47Privileged Discord Bot Token Stored in a Plaintext Project File
backup/discord-purge-tool_no_dry-run.py:60Packaged Backup Script Performs Destructive Deletion Without an Enforced Safety Gate
The trigger phrases are broad, everyday language such as "clear the chat" and "remove old messages," which can cause the skill to activate when the user did not explicitly intend to invoke a destructive bulk-deletion workflow. In this skill's context, unintended activation is more dangerous because the documented tool can permanently delete Discord messages, so misclassification can lead to accidental data loss or moderation actions.
The trigger guidance is overly broad for a destructive action: common phrases like 'clean up', 'remove old messages', or 'clear the chat' can be ambiguous and may cause unintended invocation. In this skill's context, that ambiguity is more dangerous because the referenced tool performs real deletions, so accidental activation can immediately produce irreversible data loss.
This is a real safety flaw because the skill documents a destructive live-delete tool while relying only on the operator to manually ask for confirmation, with no documented built-in confirmation gate, preview, or dry-run mode. In an agentic context, broad triggering plus immediate execution can lead to irreversible deletion of large numbers of Discord messages from the wrong channel or based on an ambiguous request.
The script performs an irreversible bulk deletion operation immediately after parsing arguments, with no confirmation prompt, no dry-run mode, and no explicit safeguard against accidental invocation. In a moderation/admin context, a mistyped channel ID or count can quickly destroy recent channel history, making this a real safety issue even though it is not a code-execution flaw.
Stating that the skill will "auto-detect intent" without explicit user opt-in encourages the agent to interpret ambiguous requests as authorization to use a destructive moderation capability. In the context of a bulk message deletion skill, this increases the chance of unintended destructive actions, though the impact is partially reduced because the documentation also mentions asking for confirmation and using dry-run mode first.
No suspicious patterns detected.