Back to skill

Security audit

Qq Mail Monitor

Security checks for vulnerabilities and agentic risk

Overview

The skill is a QQ Mail monitor, but it handles mailbox credentials and advertised mail automation too loosely for sensitive email access.

Review before installing. This skill requires access that can read QQ Mail inbox metadata and send mail through the configured account. Do not use it with a primary or sensitive mailbox unless the exposed auth-code-like value has been removed and revoked, credentials are moved out of source files into a safer secret store, and cron/TTS behavior is explicitly confirmed and limited.

Vulnerability Patterns
  • 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
  • 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)

T09 · Insecure Skill Coding Practices

Error
Location
PUBLISH.md:117
Finding
Credential-Like QQ Mail Authorization Code Exposed in Documentation<![CDATA[ ## Vulnerability Details **File Location**: `PUBLISH.md`, lines 117–118 **Vulnerability Type**: Hardcoded sensitive credential in distributed documentation **Risk Level**: High ### Vulnerable Code ```python EMAIL = "289688826@qq.com" # Delete or replace with a placeholder AUTH_CODE = "rnpaosialrosbgeh" # Delete or replace with a placeholder ``` ### Technical Analysis The publication guide contains a specific QQ Mail account together with a 16-character value explicitly represented as its authorization code. Although these values appear in an example demonstrating what should be removed, including them in a distributed project still discloses the credential. Static analysis cannot establish whether the authorization code remains valid. Nevertheless, it must be treated as compromised because anyone who obtains the project can extract and test it against QQ Mail's IMAP and SMTP services. An authorization code provides mailbox-level application access and should receive the same protection as a password. ### Attack Path 1. An attacker downloads or otherwise accesses the project package. 2. The attacker inspects `PUBLISH.md` and extracts the disclosed email address and authorization code. 3. The attacker attempts authentication against `imap.qq.com:993` or `smtp.qq.com:465`. 4. If the authorization code remains active, the attacker accesses mailbox data through IMAP or sends messages using the account through SMTP. 5. The compromised mailbox may then be used to collect sensitive correspondence or impersonate the account owner. ### Impact Assessment If the disclosed authorization code is valid, an attacker could obtain access within the permissions granted to QQ Mail IMAP/SMTP clients. Potential impact includes: - Reading mailbox messages and associated metadata through IMAP. - Accessing verification codes or other sensitive messages delivered to the mailbox. - Sending email as the affected account through SMTP. - Impersonating the mailb ...[truncated 329 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Immediately revoke the exposed QQ Mail authorization code and generate a replacement if the account is still in use. 2. Remove the real email address and authorization-code value from the current project and all repository history, release archives, caches, and published packages. 3. Replace the example with unmistakable non-secret placeholders: ```python EMAIL = "your_qq_number@qq.com" AUTH_CODE = "your_qq_mail_authorization_code" ``` 4. Run an automated secret scanner across the repository and its history before republishing. 5. Add pre-commit and CI checks that reject credentials, authorization codes, API keys, and other secrets. 6. Review account login and sent-mail activity for evidence of unauthorized use. 7. Rotate any other credentials that reused the same value. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/qq_mail_auto_check.py:18
Finding
Mailbox Credentials Are Designed to Be Stored in Plaintext Source Files<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/qq_mail_auto_check.py`, lines 18–19 - `scripts/qq_mail_check.py`, lines 12–13 - `scripts/qq_mail_monitor.py`, lines 16–17 - `scripts/qq_mail_send.py`, lines 13–14 - `SKILL.md`, lines 105–106 - `README.md`, lines 36–37 **Vulnerability Type**: Plaintext credential storage and insecure secret configuration **Risk Level**: Medium ### Vulnerable Code The primary monitoring script contains the following configuration: ```python EMAIL = "your_qq_number@qq.com" # Replace with your QQ email address AUTH_CODE = "your_auth_code" # Replace with your authorization code ``` The same source-level credential pattern is repeated in the other three executable scripts. The user documentation also instructs users to edit the scripts directly: ```python EMAIL = "your QQ number@qq.com" AUTH_CODE = "your authorization code" ``` ### Technical Analysis The scripts require users to replace hardcoded placeholders with live mailbox credentials. This results in the QQ Mail authorization code being stored as plaintext inside executable source files. Source files are commonly committed to version control, copied into backups, included in support bundles, shared between users, or made readable to other local accounts. A configured script can therefore disclose mailbox credentials without requiring an attacker to compromise the running Python process. `PUBLISH.md` recommends environment variables elsewhere in the project, but the shipped scripts do not implement that method. They continue to read credentials exclusively from source-level constants, creating a mismatch between the stated security recommendation and actual runtime behavior. ### Attack Path 1. A user follows the installation instructions and replaces `your_auth_code` with a live QQ Mail authorization code. 2. The configured script is committed to a repository, uploaded as part of a skill package, copied to a backup, included in a d ...[truncated 1038 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove source-level credential configuration from all four scripts. 2. Load credentials from required environment variables and terminate safely if either value is missing: ```python import os EMAIL = os.environ.get("QQ_MAIL_EMAIL") AUTH_CODE = os.environ.get("QQ_MAIL_AUTH_CODE") if not EMAIL or not AUTH_CODE: raise RuntimeError( "QQ_MAIL_EMAIL and QQ_MAIL_AUTH_CODE must be configured securely" ) ``` 3. Do not provide a functioning or real-looking default authorization code. 4. Prefer an operating-system keychain, secret manager, or platform credential API over long-lived environment variables where available. 5. Ensure any local secret configuration file is excluded from source control and has restrictive file permissions. 6. Update `README.md` and `SKILL.md` so they no longer instruct users to place credentials in Python source files. 7. Apply the same secure credential-loading implementation consistently to: - `qq_mail_auto_check.py` - `qq_mail_check.py` - `qq_mail_monitor.py` - `qq_mail_send.py` 8. Add secret scanning to pre-commit hooks and continuous integration. 9. Advise users who previously configured credentials in source files to rotate their authorization codes and remove the values from version-control history and backups where feasible. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
If the actual behavior is primarily a self-addressed SMTP test or narrow message inspection rather than the broad mail automation described, users may enable the skill in contexts involving verification codes or auto-replies without understanding its true behavior. That discrepancy can lead to unsafe operational reliance and unnecessary credential exposure.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
If the actual behavior is primarily a self-addressed SMTP test or narrow message inspection rather than the broad mail automation described, users may enable the skill in contexts involving verification codes or auto-replies without understanding its true behavior. That discrepancy can lead to unsafe operational reliance and unnecessary credential exposure.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
If the actual behavior is primarily a self-addressed SMTP test or narrow message inspection rather than the broad mail automation described, users may enable the skill in contexts involving verification codes or auto-replies without understanding its true behavior. That discrepancy can lead to unsafe operational reliance and unnecessary credential exposure.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
If the actual behavior is primarily a self-addressed SMTP test or narrow message inspection rather than the broad mail automation described, users may enable the skill in contexts involving verification codes or auto-replies without understanding its true behavior. That discrepancy can lead to unsafe operational reliance and unnecessary credential exposure.

Credential Access

High
Category
Privilege Escalation
Content
### 用户配置方式
```bash
# 1. 复制示例文件
cp .env.example .env

# 2. 编辑 .env 填入真实信息
QQ_MAIL_EMAIL=your_qq_number@qq.com
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
# 1. 复制示例文件
cp .env.example .env

# 2. 编辑 .env 填入真实信息
QQ_MAIL_EMAIL=your_qq_number@qq.com
QQ_MAIL_AUTH_CODE=your_auth_code
```
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
This markdown file documents capabilities for IMAP/SMTP access, automatic mail checking, and mail sending, and includes a configuration example with an authorization code. However, it does not warn users that the skill will access mailbox contents, store state, and require sensitive email credentials, which could affect privacy and account security.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
Line L105 states that code must contain clear Chinese comments, which is a natural-language policy constraint. This forces a specific language choice without offering alternatives, opt-in, or documenting a justified region-specific requirement.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The README promotes reading, monitoring, sending, and even TTS-broadcasting email content, but it does not clearly disclose the privacy implications of exposing subjects, senders, message bodies, or one-time codes to the assistant UI, logs, notifications, or nearby listeners. In this context, the skill is specifically designed to process sensitive mailbox data, so the missing warning meaningfully increases the risk of accidental disclosure of personal, corporate, or authentication-related information.

Lp3

Medium
Category
MCP Least Privilege
Confidence
93% confidence
Finding
The skill describes scripts that read from and write local state and connect to external mail servers, but it declares no explicit tool scope or permission boundaries. That makes the operational trust model unclear and can allow broader-than-expected file and network access when the skill is invoked.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill advertises TTS reminders of email subject and sender without clearly warning that spoken alerts can disclose sensitive information to nearby people or devices. Since emails often contain private or security-relevant information, audible notification of metadata materially increases confidentiality risk in shared environments.

Vague Triggers

Medium
Confidence
89% confidence
Finding
Broad invocation phrases like changing check frequency, pausing monitoring, or checking mail now lack explicit scope constraints, confirmation boundaries, or exclusions. In a mail skill, ambiguous triggers can cause unintended access to inbox data or unexpected task changes, especially when paired with network and file capabilities.

Missing User Warnings

Medium
Confidence
88% confidence
Finding
The skill mentions attachment handling and automatic download/save scenarios without warning about local storage, data retention, or modification risks. Saving attachments can consume disk space, persist sensitive files, and introduce malicious content onto the local system if users are not clearly informed and controls are absent.

Natural-Language Policy Violations

Medium
Confidence
92% confidence
Finding
The summary embeds metadata declaring the skill language as "zh-CN", and the rest of the document consistently presents the skill as Chinese-only. The policy requires flagging language or locale constraints when they are imposed without explicit user opt-in or a clearly documented regional justification.

Missing User Warnings

Medium
Confidence
89% confidence
Finding
This code logs into a personal QQ mailbox using an authorization code and fetches email contents/metadata, which is a privacy-sensitive network operation. While the comments explain how to configure the account, they do not disclose to the user that the script will connect to the mailbox and retrieve message data for monitoring.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The script is designed to authenticate to QQ Mail using credentials stored directly in source code variables, which encourages insecure secret handling. If a user replaces the placeholders with a real email address and authorization code and then stores, shares, or commits the file, those secrets can be exposed and abused for mailbox access.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The script prints email subject, sender, and date to stdout and packages them into JSON for external handling without any privacy warning, consent gate, or output minimization. In the context of email monitoring, these fields can contain sensitive personal or operational information and may be exposed to logs, other tools, or unauthorized viewers.

Natural-Language Policy Violations

Low
Confidence
80% confidence
Finding
The changelog and feature description are entirely presented in Chinese, including a claim of complete Chinese documentation. For a general-purpose skill, this can constitute a language-policy concern if users are not offered a language choice or informed that the skill is Chinese-only.

Natural-Language Policy Violations

Low
Confidence
81% confidence
Finding
All user-facing text in the script, including the title, instructions, status output, and errors, is presented only in Chinese. This can violate a language/locale choice policy when the skill does not document that it is region-specific or provide any user opt-in for the forced locale.

Description-Behavior Mismatch

Low
Confidence
95% confidence
Finding
The module docstring and implementation are limited to checking the inbox for the latest message, recording its ID, and emitting structured output. The manifest describes broader capabilities including TTS voice reminders and mail sending/receiving, which are not implemented in this file, creating a description-to-behavior mismatch for this skill file.

Intent-Code Divergence

Low
Confidence
88% confidence
Finding
The docstring presents the script as a monitor that outputs results for outside handling such as notification or speech. In practice, the code also maintains local state by reading and writing a mailbox state file, which is an additional side effect not reflected by the stated intent.

Natural-Language Policy Violations

Low
Confidence
83% confidence
Finding
The natural-language strings and documentation in this file are entirely Chinese, and runtime output is also emitted only in Chinese. There is no indication that the user can choose another language or that the locale restriction is intentional and documented as a region-specific constraint.

Static analysis

No suspicious patterns detected.