Back to skill

Security audit

Mail Skill

Security checks for vulnerabilities and agentic risk

Overview

This mail skill is coherent, but it asks for powerful mailbox access and installs mutable remote code with weak safeguards.

Review carefully before installing. Use an isolated environment, pin and inspect the mail-mcp-server source before installation, avoid --break-system-packages, use an app password or scoped credential instead of a primary mailbox password, protect the mcporter config file, and require explicit confirmation before sending, deleting, moving, or changing mailbox folders.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • 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
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
install.sh:4
Finding

Installation Executes Unpinned Code from a Mutable Remote Repository

Content
View full analysis
/dev/null; then echo "✅ mail-mcp 已安装: $(which mail-mcp)" else echo "📦 正在安装 mail-mcp..." pip install git+$REPO_URL --break-system-packages -q ``` The same unsafe installation method is recommended in `SKILL.md:24-36`: ```bash pip install git+https://github.com/AdJIa/mail-mcp-server.git ``` ```bash git clone https://github.com/AdJIa/mail-mcp-server.git cd mail-mcp-server pip install -e . ``` ### Technical Analysis The installer retrieves and installs Python code directly from the default branch of an external Git repository. It does not pin the dependency to an audited commit, verify a cryptographic hash, or validate a signed release. Consequently, the code executed during installation can change after this Skill has been reviewed. Python package installation can execute attacker-controlled build backend or packaging logic. If the upstream repository, maintainer account, release process, or network trust assumptions are compromised, a subsequent invocation can execute a payload that was not present during the audit. The `--break-system-packages` option additionally bypasses protections intended to prevent pip from modifying a system-managed Python environment. This can overwrite or conflict with operating-system packages, expanding the potential impact beyond an isolated application environment. ### Attack Path 1. An attacker compromises the upstream repository, a maintainer account, or its default branch. 2. The attacker adds malicious packaging or runtime code to the remote project. 3. A user runs `install.sh` or follows the installation command in `SKIL ...[truncated 1023 chars]
Remediation
View remediation
" ``` 2. Prefer a versioned, signed release from a trusted package registry. Require hash verification through a locked requirements file: ```text mail-mcp== --hash=sha256: ``` 3. Verify release signatures or repository commit signatures before installation. 4. Remove `--break-system-packages`. Install into a dedicated virtual environment or another isolated runtime: ```bash python3 -m venv "$HOME/.local/share/mail-mcp/venv" "$HOME/.local/share/mail-mcp/venv/bin/python" -m pip install \ --require-hashes -r requirements.lock ``` 5. Display the exact version or commit being installed and require explicit user confirmation before downloading and executing external code. 6. Review and lock all transitive dependencies. Use automated dependency and provenance checks in the release process. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:49
Finding

Documentation Directs Users to Store Mailbox Credentials in Plaintext Configuration

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (7)

YARA rule 'agent_skill_remote_bootstrap_execution': Remote script or code download followed by execution/bootstrap installation [agent_skills]

High
Category
YARA Match
Confidence
97% confidence
Finding

The skill explicitly recommends installing and auto-installing code directly from a GitHub repository using 'pip install git+https://...', which is a remote bootstrap pattern. This is dangerous because it pulls and executes unpinned third-party code at install time, increasing supply-chain risk and enabling malicious or compromised upstream code to run in the user's environment.

Content

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

�安装**: 检查 mail-mcp 是否已安装,未安装则自动从 GitHub 安装 2. 发送邮件: 支持纯文本、HTML、附件 3. 搜索邮件: 按 folder、条件搜索邮件 4. 管理文件夹: 列出、创建、删除、重命名文件夹 5. 邮件操作: 标记已读/未读、星标、移动、复制、删除

安装检查

方式一:pip 安装(推荐)

bash
pip install git+https://github.com/AdJIa/mail-mcp-server.git

方式二:本地安装

bash
git clone https://github.com/AdJIa/mail-mcp-server.git
cd mail-mcp-server
pip install -e .

验证安装

bash
which mail-mcp
# 应输出: /home/xxx/.local/bin/mail-mcp

配置

mcporter 配置

在 ~/.mcporter/mcporter.json 中添加:

json
{
  "mcpServers": {
    "mail-mcp": {
      "command": "mail-mcp",
      "env": {
        "IMAP_HOST": "your-imap-server.com",
        "IMAP_PORT": "993",
        "EMAIL_USER": "your-email@example.com",
        "EMAIL_PASSWOR

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger list includes broad generic terms such as 'mail', 'email', '附件', and '邮箱', which can cause the skill to activate in many unrelated contexts. In an agent setting, overbroad activation increases the chance of unintended invocation of mail-related capabilities, including access to sensitive mailbox data or sending actions without the user specifically intending to use this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill instructs users to place raw email credentials, including EMAIL_PASSWORD, into configuration without prominent security warnings, secret-handling guidance, or notice that mailbox contents may be transmitted through the MCP service. This creates a real risk of credential exposure, insecure storage, and unintended processing of highly sensitive email data.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The script performs a direct pip install from a Git repository and uses --break-system-packages, which can modify the host Python environment in intrusive ways without obtaining explicit user consent or explaining the risks. In an agent-skill installation context, this is more dangerous because users may run the script as-is, trusting it to be routine setup, while it fetches and installs remote code with system-level side effects.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

The skill instructions and operational guidance are presented entirely in Chinese, which can impose a language requirement on users without opt-in. The file does not indicate that the skill is intentionally limited to a Chinese-speaking or region-specific audience, nor does it offer alternative language support.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

The skill documents destructive operations such as deleting folders and deleting emails without any explicit warning, safeguard, or confirmation requirement. In an agent-driven workflow, this can lead to accidental irreversible mailbox changes if the skill is invoked incorrectly or misinterprets user intent.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's user-facing comments and output messages are written in Chinese throughout, with no option to select another language or indication that the skill is intentionally region-specific. This can violate language/locale policy when a skill imposes a language choice without user opt-in or documented justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.