Back to skill

Security audit

agent-teams

Security checks for vulnerabilities and agentic risk

Overview

This Teams skill is purpose-related but needs Review because it silently extracts Teams session tokens, stores sensitive data locally, and has inconsistent package installation instructions.

Install only if you are comfortable giving this skill user-equivalent Teams access through a desktop session token. Verify the npm package name and provenance before installing, avoid granting terminal Full Disk Access, inspect or disable local snapshot and memory files, and treat the credentials file as an account secret that can send/read Teams as you until the token expires or is revoked.

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/team-summary.sh:52
Finding

Conflicting and unpinned npm installation instructions create a dependency-substitution risk

Content
View full analysis
/dev/null; then echo -e "${RED}Error: agent-teams not found${NC}" >&2 echo "" >&2 echo "Install it with:" >&2 echo " bun install -g agent-teams" >&2 exit 1 fi ``` The same conflicting `bun install -g agent-teams` recommendation appears in `templates/monitor-channel.sh:171-178` and `templates/post-message.sh:155-162`. ### Technical Analysis The Skill manifest requests the npm package `agent-messenger`, but each runnable template tells users to install `agent-teams` globally. The Skill documentation expressly states that `agent-teams` is not the correct npm package name and may install the wrong package. This inconsistency creates a package-substitution or typosquatting opportunity. Neither installation path pins an exact package version or integrity digest. Consequently, the effective code can change after the Skill has been reviewed. npm-compatible package installations can also execute lifecycle scripts with the privileges of the invoking user. This is particularly dangerous here because the resulting CLI is expected to handle a reusable Microsoft Teams session token. The repository does not contain evid ...[truncated 1360 chars]
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
references/authentication.md:34
Finding

Automatic extraction and plaintext persistence of a user-equivalent Teams session token

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

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

Comprehensive Teams snapshots containing messages and email addresses are saved to plaintext files by default

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 if [ "$OUTPUT_JSON" = true ]; then echo "$SNAPSHOT" exit 0 fi TEAM_NAME=$(echo "$SNAPSHOT" | jq -r '.team.name // "Unknown"') TEAM_ID=$(echo "$SNAPSHOT" | jq -r '.team.id // "Unknown"') CHANNELS=$(echo "$SNAPSHOT" | jq '.channels // []') CHANNEL_COUNT=$(echo "$CHANNELS" | jq 'length') STANDARD_COUNT=$(echo "$CHANNELS" | jq '[.[] | select(.type == "standard")] | length') PRIVATE_COUNT=$(echo "$CHANNELS" | jq '[.[] | select(.type == "private")] | length') MEMBERS=$(echo "$SNAPSHOT" | jq '.members // []') MEMBER_COUNT=$(echo "$MEMBERS" | jq 'length') MESSAGES=$(echo "$SNAPSHOT" | jq '.recent_messages // []') MESSAGE_COUNT=$(echo "$MESSAGES" | jq 'length') ``` `templates/team-summary.sh:147-176`: ```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) ...[truncated 2417 chars]
Remediation
View remediation

T02 · Agent Memory Poisoning

Warning
Location
SKILL.md:51
Finding

Mandatory cross-session memory can persist poisoned or stale Teams destinations

Content
View full analysis
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
93% confidence
Finding

The manifest describes a narrow Teams interaction skill, but the documented behavior includes broader data collection, silent authentication/token refresh, and snapshotting of members and recent messages. This mismatch can cause operators or upstream policy systems to authorize a tool with more access and data-handling capability than expected, increasing the risk of over-privileged use and accidental exposure of organizational communications metadata.

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 and describes automatic extraction/refresh from the desktop app. Access to such a file can enable impersonation against Teams within the token lifetime, and normalizing this pattern in an agent skill materially increases credential exposure risk.

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

The guide instructs users to extract a live Teams authentication token directly from the desktop app's cookie database, which is credential harvesting from another application's session store. This bypasses normal OAuth-style consent flows and enables impersonation of the user for all Teams actions available to that session.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
98% confidence
Finding

The documentation describes saving an extracted Teams session token to a local credentials file. Persisting a bearer token obtained from cookie extraction creates a reusable credential that can be stolen from disk and used to impersonate the user until expiry or revocation.

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
96% confidence
Finding

Documenting a fixed path for a plaintext credentials file containing a Teams token makes discovery and theft easier for local malware, other compromised tooling, or careless handling. Because the token grants user-equivalent Teams access, compromise of this file can directly enable account misuse.

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
90% confidence
Finding

The best-practices section confirms the presence of a sensitive plaintext credential artifact and normalizes repeated re-extraction and handling of that file. While advisory in tone, it reinforces an insecure credential-management model that increases the chance of leakage, misuse, or accidental disclosure.

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 section instructs users to create a local JSON file containing a raw skypetoken_asm value. This directly operationalizes storing a live impersonation credential on disk in a copy-paste friendly format, increasing the likelihood of theft, backup leakage, or accidental commit.

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
95% confidence
Finding

Although chmod 600 is protective, this line is part of instructions for maintaining a plaintext file containing a live Teams token, so the underlying issue remains credential persistence. Restrictive file permissions mitigate but do not eliminate the risk from local compromise, backups, logs, or user mishandling.

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
98% confidence
Finding

The manifest does not disclose that the skill extracts authentication tokens from the local Teams desktop app. Credential acquisition from local application storage is highly sensitive behavior and must be declared clearly so users and policy engines understand the trust boundary and local-data access involved.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest does not disclose that the skill extracts authentication tokens from the local Teams desktop app. Credential acquisition from local application storage is highly sensitive behavior and must be declared clearly so users and policy engines understand the trust boundary and local-data access involved.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

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
96% confidence
Finding

The skill states that credentials are extracted automatically from the Teams desktop app and authentication happens silently in the background. Silent access to local tokens removes informed user consent and can normalize credential harvesting behavior, especially dangerous in an agent context where commands may be invoked indirectly.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
88% confidence
Finding

The skill mandates cross-session persistence through a local MEMORY.md file and encourages storing discovered identifiers and preferences. Session persistence is dangerous here because it accumulates internal organizational metadata over time, broadening the consequences of host compromise or unintended agent reuse across tasks.

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
90% confidence
Finding

The memory guidance directs storage of user and organizational metadata across sessions without an upfront privacy warning or consent flow. Persistent collection of people, channels, and preference data can create an unreviewed shadow directory of workplace relationships and collaboration structure.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation states the tool can upload/download files, access user information, and view member lists, which is broader than the declared skill description of messaging, channel reading, and reaction management. This scope mismatch can mislead reviewers and users, increasing the risk of overprivileged deployment and unexpected data access.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
95% confidence
Finding

The guide instructs users to persist a session token in a local credentials file for reuse across operations. Persisting session material outside the originating app extends the life and portability of that session, making unauthorized reuse easier if the host or file is compromised.

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.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The examples encourage polling channel messages and retrieving team snapshots that include recent messages and member data, but they do not explicitly warn that these operations access privacy-sensitive content. In an agent skill for Microsoft Teams, this can normalize broad collection of conversational and membership data and lead to accidental over-collection or misuse by downstream agents.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file upload example shows sending a local file to Teams without clearly warning that the specified local path will be transmitted to a remote service. This can cause users or autonomous agents to upload sensitive local artifacts such as reports, logs, or secrets-bearing files without sufficient awareness or confirmation.

Content

No source excerpt is available for this finding.

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

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script prints the full message body to the terminal before sending it, which can expose sensitive content such as credentials, internal links, incident details, or personal data to shell history captures, terminal logs, CI job logs, screen recordings, or other observers. In a messaging skill, users may reasonably pass confidential operational content, so echoing it without a clear warning or opt-in increases the likelihood of unintended disclosure.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The documentation states raw JSON is only output with --json, but the script also writes raw snapshot data to disk unconditionally in normal mode. This mismatch undermines user expectations and can cause operators to expose sensitive Teams data without informed consent or awareness.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script marketed as a summary tool writes the complete Teams snapshot JSON to a local file during normal execution. That snapshot likely contains sensitive team metadata, member details, and recent message content, so persisting it to disk increases exposure through local compromise, backups, shared workstations, or accidental inclusion in logs/repos.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

Saving a full Teams snapshot locally without prior warning creates unnecessary data-at-rest risk for potentially sensitive collaboration data. In the context of a Teams integration, snapshots may include channel names, member identities, and message excerpts, making silent persistence especially risky in enterprise environments.

Content

No source excerpt is available for this finding.