T09 · Insecure Skill Coding Practices
- Location
scripts/build_hub.py:167- Finding
Discord Bot Token Exposed Through Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is purpose-aligned for building a Discord hub, but it needs Review because it can make persistent server changes with a bot token while overstating permission setup and handling the token unsafely.
Install only if you are comfortable giving the script a Discord bot token with server-management permissions. Use a test or empty guild first, verify the guild ID, avoid passing the token on the command line, rotate the token if it has been exposed in shell history or logs, and manually verify channel permissions before putting sensitive agent outputs or personal content in the server.
scripts/build_hub.py:167Discord Bot Token Exposed Through Command-Line Arguments
scripts/build_hub.py:48Dry-Run Mode Performs an Undisclosed Authenticated Network Request
The skill claims it builds a complete Discord server including permissions, but the documented behavior admits that channel-specific permissions and access controls are not actually implemented. This mismatch can cause users to deploy channels they believe are owner-only or read-only when they are not, leading to unintended exposure or misuse of operational channels.
The skill explicitly performs networked actions against the Discord REST API and requires a bot token, but it declares no tool scope or allowed-tools restrictions. Missing scope declarations weaken policy enforcement and reviewability, making it easier for an agent runtime to invoke network-capable behavior without clear authorization boundaries.
This code performs outbound HTTP requests authenticated with a Discord bot token and sends guild structure data to Discord's API. While the script's purpose is to build a Discord server, the file itself provides no inline warning, confirmation, or comment reminding users that credentials and server metadata will be transmitted to an external service.
The skill claims to set up a Discord command center with roles, permissions, and owner-only/restricted areas, but it never creates permission overwrites or assigns roles to enforce those controls. As a result, channels labeled as owner-only or read-only are created with default server permissions, which can expose sensitive agent outputs or allow unauthorized users to post in supposedly restricted channels.
The script performs bulk creation of roles, categories, channels, messages, and pins immediately when run without a confirmation gate. In a high-privilege Discord administration context, a mistyped guild ID, accidental execution, or misuse by another operator can rapidly alter a production server in ways that are disruptive and difficult to clean up.
Channel metadata such as readonly_humans, owner_only_send, and topics like 'Owner only' imply access restrictions, but these flags are only descriptive and are never enforced in API calls. This creates a dangerous mismatch between operator expectations and actual Discord ACLs, increasing the chance of sensitive content being visible or writable by unintended members.
Skill requests more permissions than appear necessary for its stated functionality. Review if elevated access is justified.
Before running, confirm the user has:
1. **A Discord bot** — created at https://discord.com/developers/applications
2. **Bot permissions:** `Manage Channels`, `Manage Roles`, `Send Messages`, `Manage Messages` (for pinning)
3. **Bot invited to the server** — use OAuth2 URL with `bot` scope + above permissions
4. **Guild ID** — right-click server name → Copy Server ID (Developer Mode must be on)
5. **Bot token** — from the Bot tab in developer portal
No suspicious patterns detected.