T02 · Agent Memory Poisoning
- Location
SKILL.md:123- Finding
Automatic Cross-Session Memory Loading and Modification
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Slack bot skill is coherent, but it needs Review because it recommends broad Slack permissions, stores bot tokens locally in plaintext, and directs automatic cross-session memory use.
Install only if a Slack administrator is comfortable with the exact scopes granted. Prefer a least-privilege Slack app, avoid private-channel and email scopes unless required, protect or avoid the plaintext credential file, keep it out of backups and shared environments, pin or verify the npm package where possible, and periodically clear or review the memory file for stale or incorrect channel/user aliases.
SKILL.md:123Automatic Cross-Session Memory Loading and Modification
SKILL.md:97Default Scope Set Grants Unnecessary Access to Private Data
SKILL.md:9Executable npm Dependency Is Not Version or Integrity Pinned
The declared description presents a broader Slack integration skill that can send messages, read channels, and manage reactions. However, this specific code chunk only posts a message to a Slack channel after checking CLI availability and bot authentication, then retrying on failure. There is no functionality for reading channel contents, listing channels, or adding/removing reactions. This is a description-to-behavior mismatch because the declared purpose materially overstates the implemented capabilities of the supplied code chunk.
The skill documents local storage of Slack bot tokens in a JSON credentials file, which is credential material granting API access to one or more workspaces. Even with 0600 permissions, persistent plaintext token storage materially increases exposure from local compromise, accidental backup leakage, or unsafe file handling by other tools.
Credentials stored in: ~/.config/agent-messenger/slackbot-credentials.json
Format:
The document explicitly states that bot credentials are saved locally in a JSON file containing plaintext tokens. Because this skill requests broad Slack scopes including private channel history and user email access, compromise of that file can give an attacker substantial access to workspace data and bot actions.
2. Calls `auth.test` to verify the token against Slack API
3. Stores the bot under the workspace with its bot ID and name
4. Sets this bot as the current active bot
5. Saves credentials to `~/.config/agent-messenger/slackbot-credentials.json`
## Credential Storage
The documentation discloses a fixed credential file location and then describes storing sensitive bot tokens there in plaintext. In the context of a Slack bot with read access to public and private channels plus user information, theft of this file could enable unauthorized surveillance, impersonation, and data access within the workspace.
~/.config/agent-messenger/slackbot-credentials.json
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 // "C123"')
FIRST_CHANNEL_NAME=$(echo "$CHANNELS" | jq -r '.[0].name // "general"')
echo -e " ${GREEN}# Send message to #$FIRST_CHANNEL_NAME${NC}"
echo -e " agent-slackbot message send $FIRST_CHANNEL \"Hello!\""
echo ""
echo -e " ${GREEN}# List recent messages${NC}"
The skill directs the agent to automatically read and write a persistent memory file at the start of every task, enabling cross-session retention of operational context and user-related metadata. This can lead to unintended data carryover, privacy leakage between tasks, and reliance on stale or sensitive state without fresh user approval.
## Memory
The agent maintains a `~/.config/agent-messenger/MEMORY.md` file as persistent memory across sessions. This is agent-managed — the CLI does not read or write this file. Use the `Read` and `Write` tools to manage your memory file.
### Reading Memory
The skill explicitly instructs persistent storage of workspace IDs, channel IDs, user IDs, aliases, and user preferences across sessions without requiring user notice or consent. This creates a privacy and data-retention risk because identifiers and behavioral preferences can accumulate in a local memory file and be reused outside the user's immediate expectation.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### Creating a Slack App
1. Go to [api.slack.com/apps](https://api.slack.com/apps)
2. Click **Create New App** > **From scratch**
3. Enter app name and select workspace
4. Go to **OAuth & Permissions**
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### Creating a Slack App
1. Go to [api.slack.com/apps](https://api.slack.com/apps)
2. Click **Create New App** > **From scratch**
3. Enter app name and select workspace
4. Go to **OAuth & Permissions**
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### Creating a Slack App
1. Go to [api.slack.com/apps](https://api.slack.com/apps)
2. Click **Create New App** > **From scratch**
3. Enter app name and select workspace
4. Go to **OAuth & Permissions**
The documentation encourages use of environment variables for Slack bot tokens but does not warn that secrets can leak through shell history, process inspection, CI logs, debug output, or inherited environments. In this skill context, the token grants real bot access to Slack workspaces, so accidental exposure can let an attacker read channels, access user metadata, and post or react as the bot.
The documentation demonstrates reading from and sending to Slack channels using a bot token, but it does not warn users that channel content and outbound messages are being transmitted through Slack APIs under the bot's credentials. In an agent setting, this can normalize handling potentially sensitive workspace data without user awareness or consent checks, increasing the risk of unintended data exposure or privacy violations.
The script silently enumerates channels and users and can emit the raw JSON, but provides no warning that it is collecting potentially sensitive workspace metadata. In a Slack bot skill, this makes accidental over-collection and onward sharing more dangerous because operators may run it without realizing the breadth of data being surfaced.
The script enumerates all workspace users and includes them in JSON output and console summaries, which expands data access beyond a narrow channel/message/reaction interaction use case. Even if intended for convenience, bulk user listing increases exposure of directory information such as usernames, real names, and IDs that may be sensitive in some environments.
The script counts private channels by processing the full channel list, revealing the existence and number of private channels in the workspace. While it does not dump private channel contents here, metadata about private collaboration spaces can still disclose organizational structure or sensitive activity patterns.
No suspicious patterns detected.