Back to skill

Security audit

Email Automation

Security checks for vulnerabilities and agentic risk

Overview

This email automation skill is purpose-aligned but asks for sensitive mailbox access and documents automatic mailbox changes without enough scoping, privacy guidance, or confirmation safeguards.

Review this skill carefully before installing. It may need access to your mailbox credentials or tokens and is designed to archive, label, and draft email. Use least-privilege OAuth where possible, avoid broad IMAP passwords if an app-specific password or scoped token is available, disable AUTO_ARCHIVE until you have reviewed behavior, and do not rely on the included test mode as a no-write dry run.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
Findings (11)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
description: Path to Gmail API credentials JSON
          required: false
        OUTLOOK_ACCESS_TOKEN:
          description: Outlook/Microsoft Graph access token
          required: false
        IMAP_SERVER:
          description: IMAP server address

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
description: Path to Gmail API credentials JSON
          required: false
        OUTLOOK_ACCESS_TOKEN:
          description: Outlook/Microsoft Graph access token
          required: false
        IMAP_SERVER:
          description: IMAP server address

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
export EMAIL_ADDRESS="your@email.com"

# Gmail API (if using Gmail)
export GMAIL_CREDENTIALS_FILE="/path/to/credentials.json"

# Outlook API (if using Outlook)
export OUTLOOK_ACCESS_TOKEN="your_access_token"

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

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

md
export EMAIL_ADDRESS="your@email.com"

# Gmail API (if using Gmail)
export GMAIL_CREDENTIALS_FILE="/path/to/credentials.json"

# Outlook API (if using Outlook)
export OUTLOOK_ACCESS_TOKEN="your_access_token"

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill advertises automation features such as auto-archive and inbox cleanup without clearly warning that it can modify the user's mailbox. Users may invoke it expecting analysis only, but the documented behavior includes state-changing operations that can move or hide messages and affect retention of important emails.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The example trigger phrase is broad and resembles normal user speech, which increases the chance the skill activates unintentionally during routine conversation. Because this skill can process, categorize, archive, and draft actions against a live mailbox, accidental invocation could cause unintended mailbox modifications or exposure of email-derived content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill requests high-sensitivity mailbox credentials and tokens, including Gmail credentials, Outlook access tokens, and IMAP passwords, but provides no privacy or data-handling warning. This is dangerous because users are encouraged to grant broad access to email contents and account actions without being told how secrets are stored, scoped, or protected.

Content

No source excerpt is available for this finding.

Tainted flow: 'history_file' from os.getenv (line 34, credential/environment) → open (file write)

Medium
Category
Data Flow
Confidence
85% confidence
Finding

The file write target is derived from EMAIL_AUTOMATION_DATA_DIR, an environment variable, and is written without validation or restriction. If an attacker can influence the environment when this script runs, they can redirect writes to unintended filesystem locations, causing clobbering of files accessible to the process or persistence in attacker-chosen paths.

Content

Scanner excerpt · scripts/email_processor.py (reported line 35)May include surrounding context.

python
"""Save history of processed emails"""
    ensure_data_dir()
    history_file = DATA_DIR / 'processed.json'
    with open(history_file, 'w') as f:
        json.dump(history, f, indent=2)

def simulate_fetch_emails():

Autonomous Decision Making

Medium
Category
Excessive Agency
Confidence
85% confidence
Finding

Skill enables autonomous high-impact decisions without human-in-the-loop verification. Critical operations (destructive commands, financial transactions, data deletion) should require explicit user confirmation.

Content

Scanner excerpt · scripts/email_processor.py (reported line 75)May include surrounding context.

python
},
        {
            'id': 'email_005',
            'from': 'auto-confirm@amazon.com',
            'subject': 'Your order has shipped',
            'snippet': 'Great news! Your order #12345 has been shipped...',
            'date': '2026-03-06T15:20:00Z',

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The program explicitly claims that test mode makes no changes, but it still calls process_emails(), which writes processed history to disk. This is a state-changing behavior that can mislead users, contaminate test runs, and undermine safe validation workflows, especially in automation contexts where dry-run semantics are relied upon.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The file is predominantly written in English, but the support section switches to Chinese without asking the user for a language preference or documenting a locale-specific reason. This can violate language/locale policy expectations where user-facing content should not force a language without opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.