T09 · Insecure Skill Coding Practices
- Location
qq_email.py:465- Finding
Path Traversal Through Untrusted Email Attachment Filenames
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This QQ Mail skill is generally aligned with email use, but it handles mailbox credentials and saved attachments in ways that deserve careful review before installation.
Install only if you are comfortable giving this skill QQ Mail send/read access. Prefer a narrowly scoped secret mechanism over TOOLS.md, revoke the QQ authorization code if it may have been exposed, and avoid using --save on untrusted emails until attachment filenames are sanitized and overwrite protection is added.
qq_email.py:465Path Traversal Through Untrusted Email Attachment Filenames
qq_email.py:53Mailbox Authorization Code Stored in a Shared Plaintext Workspace File
The README is written entirely in Chinese and instructs the user to invoke the skill with Chinese phrases such as '你可以直接对我说', implying a fixed language expectation. There is no indication that users may interact in another language or that the Chinese-only constraint is required for a region-specific compliance reason.
The README instructs users to place the QQ Mail authorization code in TOOLS.md, a plaintext file, without clearly warning that this stores reusable credentials unencrypted on disk. In an agent/workspace context, such files are more likely to be read by other tools, accidentally committed, included in logs, or exposed to other users on the same system, enabling unauthorized email access and abuse of the mailbox.
The skill exposes capabilities that can access environment/configuration data, read local files, and perform network communication, but it does not declare any explicit tool scope such as permissions or allowed-tools. That makes the skill's effective authority broader and less auditable, increasing the risk of unintended data access or exfiltration if the underlying script is misused or modified.
The read command advertises a '--save' option for attachments without warning that untrusted email attachments will be written to local disk. This can lead users or agents to persist potentially sensitive or malicious files unintentionally, creating risks of local data exposure, unsafe follow-on handling, or accidental execution/opening of downloaded content.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
recipients = [email.strip() for email in to_email.split(",")]
try:
# Create message
if attachment:
msg = MIMEMultipart()
msg.attach(MIMEText(content, "html" if html else "plain", "utf-8"))
The manifest describes the skill as being for sending, receiving, checking inbox, and reading messages. The implementation includes a separate mark_as_read capability that changes remote mailbox state, which goes beyond the stated read-oriented inbox functionality.
When --save is used, attachments are written to disk, defaulting to ~/Downloads, without strong user-facing disclosure of the destination or risks of saving untrusted files. In an agent skill context, this can lead to silent persistence of attacker-controlled content on the host, which may later be opened or processed by the user or other software.
User-facing output strings such as 主题, 发件人, 收件人, 日期, and 状态 are hard-coded in Chinese, even though the rest of the tool description and command interface are in English. This imposes a specific language on users without opt-in or justification, which matches the natural-language locale policy violation criteria.
The README first describes a subcommand interface for send/receive/read/mark-read operations, e.g. qq_email.py send ... and qq_email.py receive ... at L47-L95. But L97-L147 switches to examples and an argument table implying qq_email.py can be invoked directly with --to/--subject/--content, which contradicts the earlier documented command structure and could misrepresent how the tool actually works.
The skill's stated purpose is email transmission and retrieval, but it also implements local credential discovery by reading ~/.openclaw/workspace/TOOLS.md. While this may be an operational convenience, it is an additional local file access capability not directly described in the manifest itself.
No suspicious patterns detected.