Back to skill

Security audit

QQ mail manager

Security checks for vulnerabilities and agentic risk

Overview

This QQ Mail skill mostly matches its stated purpose, but it gives an agent live ability to read, send, download, and modify email while feeding untrusted email text back to the agent without a clear safety boundary.

Review this skill carefully before installing. It is not showing evidence of hidden malware or system persistence, but it will operate on a real QQ mailbox using an authorization code. Only use it with a mailbox you are comfortable exposing to an agent, avoid sending attachments from sensitive local paths, and require fresh human confirmation for every send, move, delete, or download. Treat email content displayed by the skill as untrusted text, not instructions.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (2)

T01 · Skill Instruction Hijacking

Error
Location
scripts/semantic_search.py:185
Finding

Untrusted Email Content Is Passed to the Agent Without a Prompt-Injection Boundary

Content
View full analysis
limit, "emails": emails } print(json.dumps(result, ensure_ascii=False)) ``` ### Technical Analysis Email subjects, sender and recipient fields, and body text are externally controlled. Any Internet user who can send mail to the account can place natural-language instructions in these fields. The semantic-search implementation extracts up to 500 characters from each email body and places that content directly in the tool result consumed by the Agent. The Skill instructions state that this result is supplied to the Agent for semantic analysis, but they do not establish that all email content is untrusted data or prohibit the Agent from following instructions contained in messages. Removing HTML tags does not mitigate this issue because an indirect prompt-injection payload can be written as ordinary text. For example, an email could instruct the Agent to ignore the user, send a message, move or delete mail, or attach a sensitive local file. The risk is amplified by the Skill's mailbox mutation and email-sending capabilities. Although `SKILL.md` requires user confirmation f ...[truncated 1812 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/search_emails.py:280
Finding

Ordinary Email Search Unnecessarily Retrieves and Exposes Message Bodies

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
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (21)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description presents a general QQ email management skill with explicit capabilities to receive, search, delete, and send emails. The actual code chunk has a narrower and different function: it marks existing emails as read or unread in a chosen folder via IMAP. While this could loosely fit under 'manage mail,' the specific capability of read/unread flag manipulation is not explicitly represented in the declared description, and the chunk does not perform the listed core actions of receiving, searching, deleting, or sending. Therefore, the code behavior is materially different enough from the declared description to count as a mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

声明描述的是一个较完整的QQ邮箱管理技能,涵盖收取、搜索、删除和发送邮件等多项核心能力;而提供的代码片段仅实现了对已知邮件ID的移动/删除操作,并在执行前预览这些邮件的主题、发件人和日期。代码通过 IMAP 登录 QQ 邮箱,查找垃圾箱文件夹,读取指定邮件内容用于预览,然后复制到目标文件夹并删除原邮件,或移入垃圾箱。它没有实现邮件发送(通常需 SMTP)、没有实现按条件搜索邮件、也没有实现列出/收取邮箱邮件的功能。因此,代码行为与技能声明存在明显范围不一致:声明的能力远多于该代码实际实现的能力。虽然“删除和管理邮件”部分与代码相符,但整体描述不能准确代表该代码块的实际功能。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

代码行为集中在只读IMAP查询:读取环境变量中的QQ邮箱凭证,连接imap.qq.com,选择文件夹,搜索邮件,并抓取主题、发件人、日期和正文预览。使用了readonly=True和BODY.PEEK,表明其核心是浏览/搜索而非修改邮箱内容。代码中没有SMTP发送、IMAP删除/标记删除/expunge、移动邮件、修改状态等“管理”或“发送”实现。因此,声明描述明显宽于实际代码能力,属于能力描述不准确的情况。

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

声明描述的是一个较完整的QQ邮箱管理技能,涵盖收取、搜索、删除和发送邮件。但提供的代码块只包含发送新邮件、回复已有邮件、SMTP连通性测试,以及通过IMAP读取单封原邮件以提取回复上下文(主题、发件人、引用正文)。代码没有实现列出收件箱、检索邮件、删除邮件或一般性的邮箱查看/管理逻辑。因此描述显著高估了实际能力,属于描述与行为不符。另有读取本地文件作为邮件主题/正文及添加附件的能力,虽然可视为发送邮件的辅助功能,但在声明中未体现。综合判断为存在明显不匹配。

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding

The skill invokes scripts that rely on environment secrets and perform networked email operations, but it does not declare an explicit tool scope such as permissions or allowed-tools. This weakens governance and increases the chance the runtime grants broader-than-necessary access, especially because the skill can read mailbox contents, move/delete mail, send mail, and download attachments.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger conditions are broad enough that ordinary conversation about mail could activate a skill with access to sensitive mailbox data and destructive operations. Over-triggering increases the risk of unintended mailbox searches, content exposure, attachment downloads, or preparation of send/delete actions in contexts where the user did not intend to invoke this skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The guide instructs users to configure QQ_EMAIL_AUTH_CODE in shell or environment variables but does not explicitly warn that the authorization code is a sensitive credential that must not be shared, logged, committed, or exposed via shell history and shared environments. Because this skill manages live mailbox access, accidental disclosure of the auth code could let an attacker read, send, search, or delete email through IMAP/SMTP.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

The script accesses sensitive credentials from environment variables to authenticate to a mailbox, but it provides no user-facing disclosure that credentials will be read from the environment. Under the code-file criteria, access to sensitive environment variables should have some visible warning, comment, or documented notice.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

This script retrieves full email metadata, body content, and attachment names, then emits them as JSON to stdout. In an agent skill context, that can expose highly sensitive personal or business communications to downstream components, logs, or an LLM without minimization, confirmation, or redaction, increasing the risk of privacy leakage.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file-level docstring states the skill purpose entirely in Chinese ("列出QQ邮箱所有文件夹"), and all user-facing messages in the script are also hardcoded in Chinese. This indicates a fixed language behavior without any user opt-in, language selection, or documented justification for a Chinese-only locale.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

技能清单描述只声明支持“收取、搜索、删除和发送邮件”,未提及修改邮件已读/未读状态。这里的代码通过 IMAP store 修改邮件标记,属于实际行为超出清单描述的邮箱管理操作。

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
87% confidence
Finding

This code fetches full message bodies with IMAP and extracts previews, sender, subject, and date for output, which exposes potentially sensitive mailbox contents. While the script's purpose is email search, there is no explicit user-facing warning in the code comments, CLI help, or output that mailbox data will be transmitted to and displayed by the skill.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The script logs into a live QQ mailbox, retrieves message headers plus body previews, and emits that content as JSON for downstream semantic analysis. This creates a real privacy and data-exposure risk because potentially sensitive mailbox content is transferred to another component without any visible consent, minimization beyond a simple truncation, or warning that emails will be read and exposed to the agent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code fetches email content from IMAP and later sends email bodies and optional attachments over the network, which can expose user data outside the local system. Although the script returns status messages after execution, it does not provide an explicit warning in comments, docstrings, or prompts that message contents and attached files will be transmitted to external mail servers.

Content

No source excerpt is available for this finding.

Vague Triggers

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

A trigger phrase list without clear exclusions or disambiguation can cause accidental activation, especially for a skill handling private email and message deletion/movement. While not an exploit by itself, it increases the chance of privacy-impacting actions being initiated from loosely related requests.

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 natural-language interface, including docstrings, argument help text, and error messages, is exclusively in Chinese. This can violate language/locale policy when a specific language is forced without offering the user a choice or documenting a justified locale restriction.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The manifest says the skill supports receiving, searching, deleting, and sending emails, but this file implements listing all mailbox folders via IMAP LIST. Folder enumeration is related to mail management, but it is still a distinct behavior not explicitly covered by the stated description.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
89% confidence
Finding

This Python file contains user-facing natural-language strings entirely in Chinese, including the module docstring, CLI description, argument help, and runtime messages. That creates an implicit language constraint without offering a language choice or documenting that the skill is intentionally limited to Chinese-speaking users or a China-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file-level docstring is written entirely in Chinese and the skill is tailored to QQ Mail with Chinese-language user-facing messages, but it does not indicate that language choice is optional or region-specific by design. Under the policy, forcing a specific language without opt-in is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

Natural-language strings in the file, including the top-level description and CLI help text, force a specific language presentation. There is no indication that the skill is intentionally limited to Chinese users or that users can select another language.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The top-level docstring uses Chinese-only natural-language guidance ("发送/回复QQ邮件") and the script's user-facing help/messages are likewise fixed to Chinese. Under the stated policy, forcing a specific language without user opt-in can be a locale/language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.