T02 · Agent Memory Poisoning
- Location
SKILL.md:111- Finding
Persistent Storage of Attacker-Influenced Discord Metadata
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly coherent for Discord bot use, but it combines Discord posting/reading authority with mandatory cross-session metadata memory and an unpinned third-party CLI install.
Install only if you are comfortable giving this skill a Discord bot token and Discord posting/reading authority. Use a dedicated low-permission bot, pin and audit the agent-messenger package where possible, avoid ad-hoc latest/bunx execution for sensitive work, protect and rotate the token if exposed, and limit or disable the MEMORY.md behavior unless you want Discord IDs and names retained across sessions. Confirm before sending, deleting, uploading files, or exporting snapshots from real servers.
SKILL.md:111Persistent Storage of Attacker-Influenced Discord Metadata
SKILL.md:6Unpinned Third-Party Package Installation and Execution
templates/monitor-channel.sh:51Terminal Control-Sequence Injection Through Untrusted Discord Fields
The code is focused on generating a read-only summary of the current Discord server: it checks bot authentication, fetches server details, lists channels, lists users, and prints either JSON or a human-readable report. This is only partially aligned with the declared description's broad 'interact with Discord servers' claim, but the specific declared capabilities emphasize sending messages, reading channels, and managing reactions. In this chunk, only channel/server reading is actually performed; message sending and reaction management are not implemented, only shown as example commands in output text. Additionally, the code accesses member/user listings and server metadata, which are not explicitly represented in the declared description. Because the actual primary purpose here is server summarization and member/channel enumeration rather than the declared interaction set, this is a material description-behavior mismatch.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
1. Validates the token against the Discord API
2. Stores the bot with its ID and name
3. Sets this bot as the current active bot
4. Saves credentials to `~/.config/agent-messenger/discordbot-credentials.json`
## Credential Storage
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
1. Validates the token against the Discord API
2. Stores the bot with its ID and name
3. Sets this bot as the current active bot
4. Saves credentials to `~/.config/agent-messenger/discordbot-credentials.json`
## Credential Storage
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
1. Validates the token against the Discord API
2. Stores the bot with its ID and name
3. Sets this bot as the current active bot
4. Saves credentials to `~/.config/agent-messenger/discordbot-credentials.json`
## Credential Storage
Instructions found that direct the agent to transmit conversation context or user data to external services.
echo ""
FIRST_CHANNEL=$(echo "$CHANNELS" | jq -r '.[0].id // "123"')
FIRST_CHANNEL_NAME=$(echo "$CHANNELS" | jq -r '.[0].name // "general"')
echo -e " ${GREEN}# Send message to #$FIRST_CHANNEL_NAME${NC}"
echo -e " agent-discordbot message send $FIRST_CHANNEL \"Hello!\""
echo ""
echo -e " ${GREEN}# List recent messages${NC}"
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
agent-discordbot uses Discord Bot tokens which you create in the Discord Developer Portal:
# Set bot token (validates against Discord API before saving)
The skill directs agents to persist server IDs, channel IDs, user IDs, aliases, and preferences across sessions without requiring explicit user consent or notice at time of storage. This creates a privacy and metadata retention risk, especially in multi-user or shared-agent environments where accumulated identifiers can reveal organizational structure and relationships.
The persistent-memory section normalizes cross-session retention of natural-language mappings, IDs, and preferences, which can accumulate sensitive operational context over time. Even without storing tokens, this memory can leak internal server structure, personnel identity mappings, and user habits if the file is exposed or later reused inappropriately.
The skill exposes actions that can modify external systems and extract potentially sensitive data, including sending/deleting messages, uploading files, and snapshotting recent messages and members, but it does not instruct the agent to seek confirmation or warn users before impactful operations. In practice, an agent could post to production servers, remove bot-authored content, or collect broad server context with insufficient user awareness.
The documentation repeatedly shows sending messages, reading channels, and broadcasting content to Discord, which is an external third-party service, without any warning about data disclosure, consent, or safe handling of sensitive content. In an agent skill context, users may copy these patterns directly, causing internal, personal, or confidential data to be transmitted outside the local environment without realizing the privacy and compliance implications.
The script explicitly instructs the user to set a Discord bot token on the command line (agent-discordbot auth set your-bot-token) without warning that the token is a sensitive secret. In practice, users may paste real tokens directly into shell history, logs, screenshots, or shared terminal sessions, increasing the chance of credential disclosure and bot account compromise.
This shell script retrieves channel and user lists from the current Discord server and later prints member identifiers and names. Although it logs that it is fetching server data, it does not warn the user that potentially sensitive server membership information will be collected and output, including when redirected to a file via the documented JSON mode.
No suspicious patterns detected.