T09 · Insecure Skill Coding Practices
- Location
scripts/config_manager.py:21- Finding
Discord User Token Stored in Plaintext Without Enforced File Permissions
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent Discord digest tool, but it asks for and persists a full Discord user token in ways that can expose the account and private server content.
Install only if you are comfortable giving this skill a Discord user session token and having Discord message content summarized locally. Avoid typing tokens into shell commands, avoid plaintext config storage, restrict configured channels to non-sensitive spaces, and do not forward digests to Telegram or other services without permission from affected communities. A bot or OAuth flow with limited permissions would be safer.
scripts/config_manager.py:21Discord User Token Stored in Plaintext Without Enforced File Permissions
scripts/discord_api.py:165Discord Token Accepted Through Command-Line Arguments
scripts/discord_api.py:13Full Discord User Session Token Exceeds Least Privilege Required for Read-Only Digests
The documented behavior claims sensitive token use, Discord API access, token validation, and multi-server digesting, but the analyzed artifact does not substantiate those capabilities. This mismatch is dangerous because users may be induced to provide a Discord user token and trust data-handling or validation behaviors that are not actually implemented or auditable in the presented skill file.
The setup explicitly instructs users to extract a Discord user token from browser developer tools and store it locally, without a strong warning that this is a highly sensitive account credential. This can lead to account compromise, policy violations, and unsafe long-term storage of a reusable secret in a local config file.
The README instructs users to extract a Discord user token from browser developer tools and store it for later use, but does not provide strong credential-handling warnings or safer alternatives. A Discord user token is a highly sensitive credential that can grant full account access, so normalizing manual extraction and local storage materially increases the risk of account compromise, especially in an automation context.
The cron example instructs users to send generated Discord digest output to Telegram without warning that message content, links, and potentially sensitive server information will be transmitted to a third-party service. This creates a real risk of unintended data exfiltration from private Discord servers or threads, particularly because the feature is framed as routine automation.
The skill advertises and documents network access, token handling, and local config writes, but it does not declare any explicit tool scope such as permissions or allowed-tools. That omission weakens least-privilege controls and can cause the agent to invoke broader file, network, or environment capabilities than a reviewer or user would expect.
The manifest description says to use the skill for 'monitoring Discord channels' and 'creating Discord activity reports' without defining clear trigger phrases, scope limits, or exclusion conditions. These broad natural-language cues could overlap with ordinary user requests and cause unintended invocation.
The skill describes generating digests from Discord channels but does not clearly disclose the privacy implications of reading message content and transmitting authenticated account data to Discord APIs. Users may enable the skill without understanding that private or sensitive channel content will be processed and summarized.
Data from a source is assigned to a variable that is later passed to a sink, creating a variable-mediated taint flow.
def save_config(config: dict):
"""Save config to file."""
os.makedirs(CONFIG_DIR, exist_ok=True)
with open(CONFIG_FILE, 'w') as f:
json.dump(config, f, indent=2, ensure_ascii=False)
print(f"✅ Config saved to {CONFIG_FILE}")
The script stores a Discord user token in plaintext JSON on disk, which creates credential exposure risk if the host is shared, backed up, indexed, or has weak filesystem permissions. In this skill's context, the token is especially sensitive because it grants access to Discord account data across selected servers and channels, so theft could enable unauthorized monitoring or account misuse.
The CLI accepts a Discord user token as a positional argument, which can expose the credential through shell history, process listings, audit logs, or job runners. In this skill's context, that is especially sensitive because the token is a user token with broad account access, not a narrowly scoped API key, so accidental disclosure could let an attacker impersonate the user and access Discord data.
The function docstring says it gets active threads in a channel, but L101 calls the archived public threads endpoint and L114 explicitly notes that the active threads endpoint is actually on guild, not channel. This is an intent/documentation contradiction rather than a mere omission, because the function advertises one behavior while performing another.
No suspicious patterns detected.