T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:13- Finding
Deliberate Bypass of Session Visibility and Credential Access Controls
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill needs Review because it deliberately gives agents a raw Discord bot token to bypass OpenClaw message-visibility limits.
Review carefully before installing. This skill is transparent about what it does, but its design gives the agent broad Discord authority through a raw bot token. Use only a dedicated least-privileged bot restricted to the smallest set of channels, avoid write/admin permissions, rotate any token already exposed this way, and prefer a constrained read-only broker or native OpenClaw tool instead of giving agents the bearer token.
SKILL.md:13Deliberate Bypass of Session Visibility and Credential Access Controls
SKILL.md:23Persistent Plaintext Storage and Agent Discoverability of a Long-Lived Bot Credential
The description explicitly frames reading messages from conversations the agent 'wasn't part of' as an intended use case. In context, this is not incidental; it is a deliberate access-control bypass that expands the agent's visibility into historical Discord conversations without normal participation-based constraints.
The skill tells the agent to access a separately stored bot token and use it to read Discord message history outside the agent's normal visibility boundaries. This directly defeats the platform's access model and enables collection of potentially sensitive communications from channels or threads the agent was not intended to access.
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
DISCORD_TOKEN=$(cat ~/.openclaw/.discord-bot-token)
# Read recent messages from a channel or thread (threads are channels in Discord)
curl -s -H "Authorization: Bot $DISCORD_TOKEN" \
"https://discord.com/api/v10/channels/{channel_or_thread_id}/messages?limit=50" \
| python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| python3 -m json.tool
# Read messages before a specific message ID (pagination)
curl -s -H "Authorization: Bot $DISCORD_TOKEN" \
"https://discord.com/api/v10/channels/{channel_id}/messages?limit=50&before={message_id}" \
| python3 -m json.tool
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
| python3 -m json.tool
curl -s -H "Authorization: Bot $DISCORD_TOKEN"
"https://discord.com/api/v10/channels/{parent_channel_id}/threads/active"
| python3 -m json.tool
The trigger phrases are broad and conversational, increasing the chance that the skill activates in routine discussion without the user understanding that it will access out-of-session Discord history using privileged credentials. In this context, accidental invocation is more dangerous because the skill performs sensitive cross-conversation data access, not a harmless local transformation.
The skill explicitly instructs the agent to read a bot token from a local secrets file so it can bypass the platform's intended token redaction and session visibility controls. That introduces credential access and secret-handling behavior beyond simple message retrieval, and gives the agent a reusable bearer credential with broader privileges than the immediate task requires.
The operational steps direct the agent to load a stored bot token and query Discord history directly, but they do not require an explicit user-facing consent or warning at the point of use. Because the stated purpose is to access conversations the agent normally cannot see, the absence of a clear privacy notice materially increases the risk of unauthorized data access.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# Store your bot token in a file outside the workspace (won't be git-committed)
echo 'YOUR_DISCORD_BOT_TOKEN' > ~/.openclaw/.discord-bot-token
chmod 600 ~/.openclaw/.discord-bot-token
Record the path in TOOLS.md so the agent knows where to find it across sessions.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
### Security Considerations
- The token file is `chmod 600` and outside the git-tracked workspace
- The bot token grants read/write access to all channels the bot is in — treat it like a password
- Prefer read-only API calls; do not use this for sending messages (use OpenClaw's native routing instead)
- If the token is rotated in Discord Developer Portal, update both `openclaw config` and the token file
The document acknowledges that the token grants read/write access to all channels the bot can access, while relying only on a non-enforceable instruction to 'prefer read-only' use. This is dangerous because once the agent can read the token, it can make arbitrary Discord API calls, including message sends or other state-changing operations, regardless of the documentation's stated preference.
No suspicious patterns detected.