Back to skill

Security audit

Mail Mcp

Security checks for vulnerabilities and agentic risk

Overview

This mail skill is purpose-aligned, but it installs mutable remote code and handles mailbox credentials and destructive mail actions without enough scoping or safety guidance.

Review this carefully before installing. Use only a trusted, pinned version of the mail-mcp server, avoid --break-system-packages, prefer an isolated virtual environment, use an app password or secret manager instead of a primary mailbox password in plaintext JSON, and require explicit confirmation before any send, delete, move, or folder-management action.

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

Unpinned Remote Repository Is Installed as Executable Code

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 insecure installation approach is recommended in `SKILL.md`, lines 24-31: ```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 current head of a remote Git repository. It does not pin a reviewed commit hash or immutable release, nor does it verify a cryptographic checksum or signature. Consequently, the effective code executed by the installation process can change after this Skill has been reviewed. A compromise of the upstream repository, maintainer account, Git hosting account, or dependency publication process could cause future installations to execute attacker-controlled build or installation logic. The use of `--break-system-packages` further weakens isolation by bypassing protections intended to prevent pip from modifying an externally managed Python installation. This can overwrite or conflict with system-managed packages and expand the consequences of a malicious or defective package. Fetching the external Mail MCP implementation is related to the declared functionality, but using a mutable source and bypassing package-management safeguards exceeds the minimum risk necessary to provide that functionality. ### Attack Path 1. An attacker compromises the upstream Gi ...[truncated 1363 chars]
Remediation
View remediation
" ``` 2. Prefer a versioned, signed release from a controlled package registry. Require hashes through a locked requirements file where supported: ```text mail-mcp== --hash=sha256: ``` 3. Verify release signatures or checksums before installation and document how the expected values are obtained through a trusted channel. 4. Remove `--break-system-packages`. Install into an isolated virtual environment or another sandboxed runtime: ```bash python3 -m venv "$HOME/.local/share/mail-mcp/venv" "$HOME/.local/share/mail-mcp/venv/bin/python" -m pip install \ "git+https://github.com/AdJIa/mail-mcp-server.git@" ``` 5. Review the pinned upstream source, its build backend, transitive dependencies, and runtime network behavior before distributing the Skill. 6. Fail closed if integrity verification fails rather than falling back to the repository's current default branch. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:48
Finding

Mailbox Password Is Documented for Plaintext Configuration Storage

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • YARA SignaturesMalware Match, Webshell Match, Cryptominer Match
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
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 recommends installing executable code directly from a GitHub repository via 'pip install git+https://...' and also describes automatic installation when absent. Pulling and executing remote code without pinning, integrity verification, or trust controls creates a software supply-chain risk that could allow 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
93% confidence
Finding

The trigger list includes broad, everyday terms such as '邮箱', 'email', 'mail', 'SMTP', and 'IMAP', which can cause the skill to activate in contexts where the user did not intend mailbox access or mail operations. Because this skill can lead to installation, mailbox queries, and destructive actions like delete or move, accidental invocation raises meaningful safety and privacy risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The feature description advertises automatic installation and powerful mail-management capabilities, including delete, move, and send, without warning the user that the skill may install third-party code or perform destructive mailbox actions. This omission can mislead users into invoking sensitive functionality without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The configuration section instructs users to place mailbox credentials, including EMAIL_PASSWORD, into configuration/environment values and describes connecting to external IMAP/SMTP services, but it does not warn about credential exposure, mailbox privacy, or third-party handling risks. This is dangerous because the skill processes highly sensitive data: account secrets, message content, contacts, and attachments.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The script installs a Python package directly from a remote GitHub repository using pip install git+... without pinning to a specific commit, tag, or verified release, and without meaningful user consent beyond a generic status message. This creates a supply-chain risk: if the repository is compromised, renamed, force-pushed, or its dependency chain becomes malicious, running the installer will fetch and execute attacker-controlled code on the host.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

The natural-language documentation is entirely in Chinese and does not indicate that other languages are supported or that the user may choose a preferred language. Under the stated policy, forcing a specific language without opt-in can be a locale/language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The comments and all user-visible output strings are in Chinese, and the file provides no option to select another language or indication that the skill is intended only for Chinese-speaking users. This can violate language/locale policy when a skill imposes a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.