Back to skill

Security audit

Agent Teams

Security checks for vulnerabilities and agentic risk

Overview

This Teams skill is review-worthy because it silently extracts Teams session cookies, stores a usable token locally, and has inconsistent install guidance, even though its core Teams purpose is coherent.

Install only after reviewing the credential model. This skill can act as you in Teams, reads Teams desktop cookie storage, stores a plaintext token locally, may retain team/user/channel identifiers across sessions, and includes templates that save or print Teams data. Verify the intended package is agent-messenger, avoid the conflicting agent-teams install command, and do not use it on highly sensitive Teams accounts or shared/automated machines unless you accept those risks.

Vulnerability Patterns
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
Findings (4)

T08 · Insecure Dependencies

Error
Location
templates/monitor-channel.sh:171
Finding

Incorrect and Unpinned Package Installation Creates Dependency-Confusion Risk

Content
View full analysis
/dev/null; then echo -e "${RED}Error: agent-teams not found${NC}" echo "" echo "Install it with:" echo " bun install -g agent-teams" exit 1 fi ``` The same conflicting installation instruction appears in: ```bash echo " bun install -g agent-teams" ``` The project documentation itself states that `agent-teams` is not the npm package name and warns against installing it: ```markdown **`agent-teams` is NOT the npm package name.** The npm package is `agent-messenger`. **NEVER run `bunx agent-teams`** — it will fail or install a wrong package since `agent-teams` is not the npm package name. ``` ### Technical Analysis The templates contradict the package identity declared by the manifest and documented in `SKILL.md`. A user who runs a template without the expected executable installed is instructed to globally install `agent-teams`, even though the expected package is `agent-messenger`. This creates a dependency-confusion or package-substitution opportunity. The audit does not establish that any currently published package is malicious; the vulnerability is that an unintended package can occupy the recommended name and be executed as a trusted Teams client. Neither installation path pins a reviewed package version or integrit ...[truncated 1507 chars]
Remediation
View remediation
``` 2. Pin the dependency to a specific reviewed version rather than accepting the latest release. 3. Use lockfiles and registry integrity hashes where the runtime supports them. 4. Verify that the installed executable resolves to the expected package before requesting authentication. 5. Remove duplicated installation logic from templates and maintain one authoritative installation procedure. 6. Include the external CLI implementation in the security review, especially its cookie access, credential storage, and network destinations. 7. Prefer a signed release artifact or trusted package registry namespace with publisher verification. 8. Add an automated test that fails if templates reference a package name different from the manifest. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/authentication.md:40
Finding

Silent Extraction and Plaintext Storage of a Broadly Privileged Teams Session Token

Content
View full analysis
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:55
Finding

Mandatory Persistent Memory Stores Organizational Identifiers and Creates a Cross-Session Influence Channel

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
templates/team-summary.sh:199
Finding

Teams Messages, Member Data, and Channel Metadata Are Persisted or Logged in Plaintext

Content
View full analysis
&2 echo -e "Token age: ${TOKEN_AGE} minutes" >&2 SNAPSHOT=$(agent-teams snapshot 2>&1) # Handle token expiry during snapshot if echo "$SNAPSHOT" | grep -Eqi "expired|401|unauthorized" 2>/dev/null; then echo -e "${YELLOW}Token expired during snapshot, refreshing...${NC}" >&2 agent-teams auth extract >&2 SNAPSHOT=$(agent-teams snapshot 2>&1) fi if echo "$SNAPSHOT" | jq -e '.error' > /dev/null 2>&1; then echo -e "${RED}Failed to get snapshot${NC}" >&2 ERROR_MSG=$(echo "$SNAPSHOT" | jq -r '.error // "Unknown error"') echo -e "${RED}Error: $ERROR_MSG${NC}" >&2 exit 1 fi ``` It prints member email addresses and recent message content: ```bash echo -e "${BOLD}${CYAN}Sample Members:${NC}" echo "$MEMBERS" | jq -r ' .[0:10] | .[] | " \(.displayName) \(if .email then "(\(.email))" else "" end)" ' if [ "$MEMBER_COUNT" -gt 10 ]; then echo " ... and $((MEMBER_COUNT - 10)) more" fi echo "" echo -e "${BOLD}${CYAN}Recent Activity (${MESSAGE_COUNT} messages)${NC}" echo "" if [ "$MESSAGE_COUNT" -gt 0 ]; then echo -e "${BOLD}${CYAN}Latest Messages:${NC}" echo "$MESSAGES" | jq -r ' .[0:5] | .[] | " [#\(.channel_name)] \(.author): \(.content[0:50])\(if (.content | length) > 50 then "..." else "" end)" ' echo "" fi ``` It then writes the complete raw snapshot to the current directory without establishing restrictive permissions: ```bash SNAPSHOT_FILE="team-snapshot-$(date +%Y%m%d-%H%M%S).json" echo "$SNAPSHOT" > "$SNAPSHOT_FILE" ...[truncated 3841 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Output HandlingUnvalidated Output Injection, Cross-Context Output, Unbounded Output
Findings (27)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code is clearly Teams-related and does read channel/message data, so it partially aligns with the declared description. However, the declared purpose is a broad interaction summary focused on sending messages, reading channels, and managing reactions, while the actual code’s primary purpose is specifically long-running monitoring of a channel for new messages. It also performs authentication status inspection and automatic token refresh, which are undeclared capabilities. The commented-out auto-response example is not active and should not be counted. Overall, this is a meaningful description-behavior mismatch because the implemented behavior is narrower in some ways but also includes materially different operational capabilities not stated in the description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

The code clearly interacts with Microsoft Teams, so the general domain is accurate. However, the declared description suggests a broader capability set: send messages, read channels, and manage reactions. This code chunk only posts messages and, secondarily, lists channels to resolve a channel name to an ID. It does not implement reaction management at all. It also performs authentication status checks and token refresh operations, which are material operational capabilities not reflected in the description. Because the declared description overstates some implemented functions (reaction management) and omits the authentication/token-handling behavior, this is a description-behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
92% confidence
Finding

The declared description suggests a general Teams interaction skill focused on sending messages, reading channels, and managing reactions. The code instead implements a reporting/export utility: it checks authentication, refreshes tokens, retrieves a comprehensive team snapshot, summarizes channels/members/recent activity, and writes the raw snapshot to disk. While reading Teams data is consistent in a broad sense, the primary purpose is team summarization rather than interactive messaging. Also, key declared capabilities are absent in the code: it does not actually send messages or manage reactions; those appear only as printed example commands. The undeclared local snapshot export and auth-refresh behavior are additional capabilities beyond the description.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

The skill documents storage of a live Teams token in a local credentials file, which represents credential material that can be stolen by local compromise, logs, backups, or overly broad tooling access. Even with 0600 permissions, plaintext bearer tokens on disk materially raise account takeover risk on multi-tool agent systems.

Content

Scanner excerpt · SKILL.md (reported line 341)May include surrounding context.

Configuration

Credentials stored in: ~/.config/agent-messenger/teams-credentials.json

Format:

json

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

Accessing local Teams cookies to recover authentication tokens is a credential-access behavior not justified by the stated messaging functionality. It bypasses normal consent and token issuance controls, and if abused gives the skill the same effective access as the signed-in user.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The guide describes extracting a live Teams session token and storing it in ~/.config/agent-messenger/teams-credentials.json. Persisting a bearer token in plaintext creates a reusable credential target for malware, local attackers, or accidental disclosure, and the token grants direct access as the user until expiry.

Content

Scanner excerpt · references/authentication.md (reported line 60)May include surrounding context.

md
4. Extracts `skypetoken_asm` cookie value
5. Validates token against Teams API before saving
6. Discovers ALL joined teams
7. Stores credentials securely in `~/.config/agent-messenger/teams-credentials.json`

### Platform-Specific Paths

Credential Access

High
Category
Privilege Escalation
Confidence
95% confidence
Finding

This section documents the location of a plaintext credential store containing the Teams token. Publicly documenting the path and structure lowers the barrier for theft by other local processes or users and normalizes insecure storage of a sensitive session credential.

Content

Scanner excerpt · references/authentication.md (reported line 139)May include surrounding context.

Credentials are stored in:

text
~/.config/agent-messenger/teams-credentials.json

Format

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

The best-practices section confirms the existence of credentials.json as a sensitive artifact and instructs users to protect it, which indirectly acknowledges the skill relies on a locally stored reusable secret. While the line itself is advisory, in context it reinforces an insecure credential model based on harvested bearer tokens.

Content

Scanner excerpt · references/authentication.md (reported line 335)May include surrounding context.

md
### Best Practices

1. **Protect credentials.json**: Never commit to version control
2. **Use team switching**: Keep different contexts separate
3. **Handle token expiry**: Build refresh logic into all scripts
4. **Re-extract frequently**: Tokens expire in 60-90 minutes

Credential Access

High
Category
Privilege Escalation
Confidence
97% confidence
Finding

The manual token management instructions tell users to create a JSON file containing YOUR_SKYPETOKEN_ASM_HERE, which is direct handling of a live bearer credential. Encouraging manual placement of a session token into a file substantially increases the chance of leakage, misuse, or copying into unsafe environments.

Content

Scanner excerpt · references/authentication.md (reported line 350)May include surrounding context.

md
mkdir -p ~/.config/agent-messenger

# Create credentials file
cat > ~/.config/agent-messenger/teams-credentials.json << 'EOF'
{
  "token": "YOUR_SKYPETOKEN_ASM_HERE",
  "token_extracted_at": "2024-01-15T10:00:00.000Z",

Credential Access

High
Category
Privilege Escalation
Confidence
93% confidence
Finding

Although the line sets restrictive permissions, it is still part of a workflow that persists a sensitive Teams token in a predictable local file. The permissions reduce exposure but do not address theft by the same user context, malware, backups, logs, or accidental file handling.

Content

Scanner excerpt · references/authentication.md (reported line 365)May include surrounding context.

EOF

Set secure permissions

chmod 600 ~/.config/agent-messenger/teams-credentials.json

text

If the user already has a token value, they can populate the file above. Otherwise, always prefer `agent-teams auth extract` to obtain the token automatically from the desktop app.

Exfiltration Commands

High
Category
Prompt Injection
Confidence
90% confidence
Finding

Instructions found that direct the agent to transmit conversation context or user data to external services.

Content

Scanner excerpt · templates/team-summary.sh (reported line 177)May include surrounding context.

sh
echo -e "${BOLD}${CYAN}Quick Actions:${NC}"
echo ""
echo -e "  ${GREEN}# Send message to a channel${NC}"
FIRST_CHANNEL=$(echo "$CHANNELS" | jq -r '.[0].id // "CHANNEL_ID"')
FIRST_CHANNEL_NAME=$(echo "$CHANNELS" | jq -r '.[0].name // "General"')
echo -e "  agent-teams message send \"$FIRST_CHANNEL\" \"Hello!\""

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatic credential/token extraction from the Teams desktop app is highly privacy- and security-sensitive behavior. Failing to disclose it in the manifest can mislead users into invoking a skill that accesses authentication material and account context they did not knowingly approve.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Automatic credential/token extraction from the Teams desktop app is highly privacy- and security-sensitive behavior. Failing to disclose it in the manifest can mislead users into invoking a skill that accesses authentication material and account context they did not knowingly approve.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
84% confidence
Finding

The phrase 'just run any command' combined with silent authentication encourages broad invocation without least-privilege guardrails or command-risk distinctions. In practice, low-friction execution can cause an agent to trigger sensitive operations like token extraction, snapshots, or message/file actions without meaningful user awareness.

Content

Scanner excerpt · SKILL.md (reported line 36)May include surrounding context.

md
## Authentication

Credentials are extracted automatically from the Teams desktop app on first use. No manual setup required — just run any command and authentication happens silently in the background.

Teams tokens expire in 60-90 minutes. The CLI automatically re-extracts a fresh token when the current one expires, so you don't need to manage token lifecycle manually.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Silent automatic credential extraction from a desktop app without a prominent warning undermines informed consent and can lead to unexpected access to a user's Teams account. In an agent setting, this is particularly dangerous because simply running a seemingly harmless command can trigger access to authentication artifacts and account data.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
86% confidence
Finding

Cross-session persistence of discovered teams, channels, users, and preferences creates a durable knowledge base that may outlive the user's intent and expand the blast radius of later compromise. In agent contexts, persistent memory can also silently influence future actions using stale or sensitive workspace metadata.

Content

Scanner excerpt · SKILL.md (reported line 71)May include surrounding context.

md
## 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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The instructions encourage persistent storage of team IDs, channel IDs, user IDs, names, and preferences across sessions without an explicit privacy warning or retention policy. Persistent identity/workspace mapping can become sensitive organizational metadata and may be misused or exposed later.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The snapshot feature aggregates recent messages, member identities, and emails into machine-consumable JSON without an explicit privacy warning. This materially increases the risk of bulk collection, oversharing, or downstream exfiltration of organizational communications and directory data.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The documentation explicitly instructs the tool to locate the local Teams desktop data directory, read the Cookies SQLite database, and extract the skypetoken_asm session token. That is credential harvesting from another application's local storage and materially expands capability beyond ordinary Teams messaging, enabling account access as the user if the token is obtained or mishandled.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file states the skill can upload/download files, access user information, and view team member lists, which exceeds the narrow manifest description of sending messages, reading channels, and managing reactions. Capability expansion increases the blast radius of compromise and suggests the skill may process more data than users expect.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The manual credential-file workflow establishes local session persistence by storing the token and metadata for reuse across operations. Persistent storage of a user session token increases the window for unauthorized reuse and makes compromise more durable than in-memory-only handling.

Content

Scanner excerpt · references/authentication.md (reported line 343)May include surrounding context.

Manual Token Management (Advanced)

If automatic extraction fails, you can manually create the credentials file:

bash
# Create config directory

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · references/authentication.md (reported line 365)May include surrounding context.

EOF

Set secure permissions

chmod 600 ~/.config/agent-messenger/teams-credentials.json

text

If the user already has a token value, they can populate the file above. Otherwise, always prefer `agent-teams auth extract` to obtain the token automatically from the desktop app.

Unbounded Output

Medium
Category
Output Handling
Confidence
80% confidence
Finding

Output size or generation rate is not bounded. Unbounded output enables denial-of-service through resource exhaustion, log flooding, or context-window stuffing.

Content

Scanner excerpt · references/common-patterns.md (reported line 591)May include surrounding context.

fi

text

### Don't Spam Channels

```bash
# Bad - sends 100 messages

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The header and usage text describe the script as generating a summary, but its behavior also includes exporting the complete raw snapshot to disk. This mismatch can mislead users into running a broader data export than expected, undermining informed consent around sensitive Teams data handling.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script marketed as a summary tool writes the full Teams snapshot to a local JSON file, which can include channel metadata, member identities, and recent message content. Persisting this raw dataset increases exposure beyond the immediate terminal output and creates a recoverable local artifact that may be accessed by other users, backups, or malware.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.