T09 · Insecure Skill Coding Practices
- Location
discord-admin.sh:33- Finding
Discord bot token exposed through process command-line arguments in discord-admin.sh
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a Discord administration CLI with real destructive server powers, but it lacks safety confirmations and handles bot credentials in ways that can expose them locally.
Install only if you are comfortable giving a shell script broad Discord bot authority. Use a least-privileged bot, avoid the --token option, run it only on a trusted machine with restricted process visibility, and manually review destructive commands before use because the scripts do not require confirmation.
discord-admin.sh:33Discord bot token exposed through process command-line arguments in discord-admin.sh
discord-ctrl.sh:56Discord bot token exposed through curl process arguments in discord-ctrl.sh
The documented behavior materially expands beyond the declared description, including message manipulation and other high-impact moderation actions. This mismatch undermines trust and reviewability, increasing the chance that operators grant the skill access for 'server administration' while overlooking broader capabilities that can alter content, remove evidence, or impersonate workflow-approved actions.
The documented behavior materially expands beyond the declared description, including message manipulation and other high-impact moderation actions. This mismatch undermines trust and reviewability, increasing the chance that operators grant the skill access for 'server administration' while overlooking broader capabilities that can alter content, remove evidence, or impersonate workflow-approved actions.
The help text explicitly documents stage-create, stage-edit, and stage-close as stage instance operations. In code, stage-create posts to /channels/$1/threads with type:13, and stage-close patches a channel with {"archived":true}, which are thread semantics rather than stage-instance management. This is an active contradiction between documentation and behavior.
The skill documents shell-based administration capabilities but does not declare any explicit tool scope or allowed-tools boundary. In an agent environment, missing scope declarations can cause overbroad shell access and make it easier for downstream prompts or users to invoke powerful administrative actions without clear containment.
The skill instructs users to export a Discord bot token but provides no warning about secrecy, least privilege, storage hygiene, or rotation. Because this token likely grants broad server administration powers, disclosure through shell history, logs, screenshots, or shared environments could lead to full compromise of Discord servers managed by the bot.
The documentation normalizes destructive administrative operations such as channel deletion, pruning, bans, and bulk actions without any warning, dry-run guidance, or confirmation pattern. In the context of a full-power Discord admin skill, this meaningfully increases the risk of accidental or socially engineered destructive actions against real communities.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Check deps
check_deps() {
command -v curl &> /dev/null || { log_error "curl required"; }
command -v jq &> /dev/null || { log_error "jq required (sudo apt install jq)"; }
}
validate_token() { [[ -z "$BOT_TOKEN" ]] && log_error "DISCORD_BOT_TOKEN not set"; }
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# API wrapper
api() {
local method=$1 endpoint=$2 data=$3
local response=$(curl -s -w "\n%{http_code}" -X "$method" \
"$API_BASE$endpoint" \
-H "Authorization: Bot $BOT_TOKEN" \
-H "Content-Type: application/json" \
The skill exposes irreversible or high-impact actions such as kicking, banning, pruning members, deleting messages, and bulk deletion, but provides no confirmation prompt or warning text before execution. Although administration is the script's purpose, the file does not disclose the destructive nature of these commands to users in help text, comments, or runtime prompts.
The manifest and help text present this as a complete A-Z Discord administration CLI, including msg-search. However, the code implements search via /guilds/.../messages/search, which is not a normal bot-admin API pattern and does not align with the claimed robust server-control functionality. This is a semantic mismatch between advertised capability and actual implemented behavior.
The help section describes modlog-set/get/disable as managing a dedicated moderation log channel. The implementation simply reads and writes system_channel_id on the guild, which controls Discord's system channel and is not the same as a moderation log configuration. This directly contradicts the documented intent of the feature.
Allowing the bot token to be passed as a command-line argument exposes the credential through process listings, shell history, CI logs, and telemetry on multi-user or monitored systems. In this skill's context, the token grants broad Discord administrative control, so disclosure can lead to full server compromise through the bot's permissions.
The script exposes destructive operations such as channel deletion, role deletion, kicking, banning, and message deletion with no confirmation prompt, dry-run mode, or safeguard. In a full-server administration skill, this increases the chance of accidental or automated misuse causing immediate integrity and availability damage to a Discord server.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
local endpoint="$2"
local data="$3"
curl -s -X "$method" \
"https://discord.com/api/v10$endpoint" \
-H "Authorization: Bot $BOT_TOKEN" \
-H "Content-Type: application/json" \
The webhook embed example contains Chinese text ("内容") even though the rest of the skill is documented in English, and the skill does not explain any locale-specific behavior or provide a user language choice. This can be read as an unexplained language preference in user-facing content examples.
The manifest describes 'Complete A-Z Discord server administration' including AutoMod, webhooks, templates, audit logs, scheduled events, threads, and full server control via CLI. The help text and implemented commands only cover a narrower subset: channels, roles, member kick/ban, basic message send/delete, server info, and emoji listing, with no support for the other advertised capabilities.
No suspicious patterns detected.