Back to skill

Security audit

tencent-exmail

Security checks for vulnerabilities and agentic risk

Overview

This appears to be a real Tencent Exmail skill, but it needs review because it can access and mutate a mailbox while under-disclosing some credential, persistence, and safety details.

Install only if you are comfortable giving the skill access to a Tencent Enterprise Mail account that can send, read, mark, move, and monitor email. Prefer an app-specific authorization code, keep it out of logs and source control, review any send or move action before it runs, and place downloaded attachments or hook files only in private directories you control.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
SKILL.md:194
Finding

Unpinned Third-Party Dependency Installation

Content
View full analysis
Remediation
View remediation
``` 2. Generate and verify cryptographic hashes for the package and all transitive dependencies: ```bash python3 -m pip install --require-hashes -r requirements.txt ``` 3. Use a lock file produced from a controlled build process and commit it to the project. 4. Explicitly document the trusted package index and avoid untrusted extra indexes. 5. Prefer a dedicated virtual environment rather than installing into the user's global Python environment. 6. Review dependency updates before changing the pinned version. 7. Replace all bare `pip3 install imapclient` instructions with the locked, hash-verified installation procedure. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/watch_email.py:127
Finding

Email Metadata Hook File Uses Unsafe Permissions and Non-Atomic Symlink-Following Writes

Content
View full analysis
Remediation
View remediation
None: path = path.expanduser() path.parent.mkdir(mode=0o700, parents=True, exist_ok=True) parent_stat = path.parent.stat() if parent_stat.st_uid != os.getuid(): raise PermissionError("Hook directory is not owned by the current user") if parent_stat.st_mode & (stat.S_IWGRP | stat.S_IWOTH): raise PermissionError("Hook directory must not be group- or world-writable") if path.is_symlink(): raise PermissionError("Hook file must not be a symbolic link") fd, temporary_name = tempfile.mkstemp( prefix=f".{path.name}.", dir=path.parent, ) try: os.fchmod(fd, 0o600) with os.fdopen(fd, "w", encoding="utf-8") as output: json.dump(records, output, ensure_ascii=False, indent=2) output.flush() os.fsync(output.fileno()) os.replace(temporary_name, path) os.chmod(path, 0o600) except Exception: try: os.unlink(temporary_name) except FileNotFoun ...[truncated 46 chars]
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 (14)

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code accurately targets Tencent enterprise email and does implement several declared mailbox functions: inbox listing, reading messages, searching, attachment download, folder listing, marking read/unread, and moving mail. However, the description materially overstates the capability set. There is no SMTP sending logic, no attachment upload logic, and no IMAP IDLE or other real-time notification/listening mechanism. The primary resource and domain are consistent (Tencent Exmail via IMAP SSL), but the declared description presents a broader full mail-operation skill than this code chunk actually provides. Therefore this is a description/behavior mismatch.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

The code chunk is narrowly focused on outbound email sending through smtp.exmail.qq.com:465. It supports SSL, attachments, HTML/plain bodies, and recipient fields, which aligns with part of the description. However, the declared purpose substantially overstates the implemented behavior by claiming support for receiving mail, inbox viewing, searching, downloading attachments, IMAP protocol operations, and real-time new mail notifications via IMAP IDLE. None of those capabilities appear in this code. This is a material description-to-behavior mismatch because the declared skill presents itself as a comprehensive Tencent enterprise mailbox operator, while the actual code only sends email.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The move action copies the message and then marks the original as deleted and expunges it immediately, permanently altering mailbox contents without confirmation. In an agent context, accidental or manipulated invocation could delete or relocate important email, causing data loss, operational disruption, and reduced recoverability.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill declares environment-variable, network, and file-write capabilities but does not constrain them with an explicit permissions or allowed-tools scope. For a mail-handling skill that authenticates to remote servers and can write local files, missing scope increases the chance of overbroad execution, unintended secret exposure, or misuse of local filesystem/network access by the agent runtime.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger text is overly broad and includes a catch-all for 'any mail operation,' which can cause the skill to activate for unintended requests. In a credentialed mail skill, overbroad invocation increases the risk of the agent taking sensitive mailbox actions without sufficiently specific user intent or with the wrong skill selected.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The security note claims the password 'will not be uploaded,' but the documented behavior necessarily transmits that secret to remote IMAP/SMTP servers for authentication. This is dangerous because it misleads users about secret handling and may cause them to provide more sensitive credentials under false assumptions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This markdown file instructs the user to generate a client-specific password and use it as the EXMAIL_PASSWORD value, which is a sensitive credential. The surrounding documentation does not include any warning about keeping the token secret, avoiding logs/version control, or handling it securely.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Reading a message automatically sets the \Seen flag, which changes mailbox state without explicit consent. In an agent-driven workflow this can mislead users, alter audit/state semantics, and interfere with triage rules or other clients that depend on unread status, even when the user only intended to inspect content.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The attachment download action writes arbitrary email attachment contents to the local filesystem immediately, with no confirmation, dry-run, or safety prompt. In an agent setting, a user or downstream automation could trigger this unintentionally, causing silent persistence of untrusted files and increasing the risk of malware staging, unsafe file overwrites, or storing sensitive content in unexpected locations.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script's docstring, CLI description, help text, examples, and runtime messages are all written in Chinese, which effectively forces a specific language for users. The file does not provide an English alternative, locale selection, or any documented justification that the tool is region-specific only.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The script persists email metadata such as subject, sender, date, UID, and folder to a local JSON file, which can expose sensitive business communication details if the file is readable by other local users, synced to cloud storage, or collected by logs/backups. In the context of an email-listening skill, this is more dangerous because message metadata often contains confidential information even without full message bodies, and the script does not warn about persistence or enforce restrictive file permissions.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

The skill documents writing mailbox event data to an arbitrary local JSON path in background monitoring mode. Allowing arbitrary file destinations can overwrite sensitive files, place mail metadata in insecure locations, or create a persistence/exfiltration foothold through files later consumed by other tools or agents.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

This markdown file contains all user-facing troubleshooting instructions in Chinese, and it does not indicate that the skill is restricted to Chinese-speaking users or provide an opt-in language choice. Per the policy category, forcing a specific language without user choice can be a natural-language policy violation.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script's docstring, CLI descriptions, and runtime messages are all hard-coded in Chinese. There is no opt-in, locale detection, or documented justification that this skill is intended only for Chinese-speaking or region-specific users.

Content

No source excerpt is available for this finding.