T09 · Insecure Skill Coding Practices
- Location
main.py:146- Finding
Mailbox Credentials Can Be Transmitted to Configuration-Controlled Servers
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This email-management skill fits its stated purpose, but it needs Review because it handles mailbox credentials and destructive mail actions with weak safeguards and has unsafe attachment download behavior.
Install only if you are comfortable giving this tool access to read, send, move, mark, delete, and download content from your 163.com mailbox. Verify the config uses the official 163.com IMAP/SMTP hosts, protect or rotate the authorization code, avoid bulk delete/move commands unless you have reviewed the target folder and IDs, and be cautious downloading attachments until filename containment is fixed.
main.py:146Mailbox Credentials Can Be Transmitted to Configuration-Controlled Servers
main.py:535Untrusted Attachment Filenames Permit Arbitrary File Overwrite
main.py:119Mailbox Authorization Code Is Entered with Terminal Echo Enabled
The config example instructs users to place an email password/auth code in plaintext in a JSON file and does not warn about credential sensitivity, file permissions, or safer storage mechanisms. This creates a straightforward credential-exposure risk: any local user, backup system, logs, or malware that can read the file may obtain reusable mailbox credentials.
The bulk deletion example shows searching a spam folder and then deleting all messages, but it provides no safety warning, preview step, or confirmation mechanism. In an automated or agent-driven setting, this pattern could easily be generalized or misapplied to the wrong folder, causing large-scale unintended mailbox data loss.
The tool exposes a destructive batch-delete operation, including an --all mode, without any confirmation prompt, dry-run, safeguard, or secondary approval. In an agent/skill context, this is dangerous because a mistaken invocation, prompt injection, or ambiguous user request could irreversibly delete a user's mailbox contents, especially when combined with --expunge.
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
解决:
# 检查软链接
ls -la ~/.local/bin/email-163-com
# 重新安装
clawhub uninstall email-163-com
The installation guide advertises commands for reading, sending, searching, and downloading email attachments without any warning that these operations access sensitive mailbox contents and may modify external state by sending messages. In an agent skill context, omission of privacy and side-effect warnings increases the chance that a user or downstream agent invokes powerful email actions without understanding the data exposure and account-impacting consequences.
Skill enumerates or reads other installed skills. Access to other skills' SKILL.md files or the skills directory reveals prompt instructions, capabilities, and secrets that should be invisible to peer skills.
## 📚 文档
- **技能说明**: `~/.openclaw/workspace/skills/email-163-com/SKILL.md`
- **使用指南**: `~/.openclaw/workspace/skills/email-163-com/README.md`
- **配置**: `~/.config/email-163-com/config.json`
The README explicitly instructs users to store their 163.com email address and authentication secret in a plaintext local JSON config file under the home directory, but it does not warn about file permissions, secret exposure, or safer storage alternatives. For an email-management skill, those credentials grant access to mailbox contents and mail-sending capability, so compromise could expose sensitive communications and enable account abuse.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| 特性 | 状态 | 说明 |
|------|------|------|
| **配置文件位置** | ✅ `~/.config/email-163-com/config.json` | 用户目录,非系统目录 |
| **文件权限** | ✅ `chmod 600` | 仅所有者可读 |
| **凭证类型** | ✅ 客户端授权码 | 不使用登录密码 |
| **加密存储** | ⚠️ 明文存储 | 建议配合磁盘加密 |
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| 特性 | 状态 | 说明 |
|------|------|------|
| **配置文件位置** | ✅ `~/.config/email-163-com/config.json` | 用户目录,非系统目录 |
| **文件权限** | ✅ `chmod 600` | 仅所有者可读 |
| **凭证类型** | ✅ 客户端授权码 | 不使用登录密码 |
| **加密存储** | ⚠️ 明文存储 | 建议配合磁盘加密 |
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
| 特性 | 状态 | 说明 |
|------|------|------|
| **配置文件位置** | ✅ `~/.config/email-163-com/config.json` | 用户目录,非系统目录 |
| **文件权限** | ✅ `chmod 600` | 仅所有者可读 |
| **凭证类型** | ✅ 客户端授权码 | 不使用登录密码 |
| **加密存储** | ⚠️ 明文存储 | 建议配合磁盘加密 |
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.
email-163-com folders
# 创建文件夹
email-163-com folder create "MyFolder"
# 删除文件夹
email-163-com folder delete "MyFolder"
The skill documents destructive operations such as deleting emails and folders without clearly warning that these actions may be irreversible or provider-dependent in recoverability. In an agent context, exposing deletion commands without confirmation guidance increases the risk of accidental data loss from user mistakes, prompt misunderstandings, or automation errors.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 设置配置文件权限(仅自己可读)
chmod 600 ~/.config/email-163-com/config.json
This markdown file documents operations such as deleting folders, deleting or moving emails, marking message state, and downloading attachments to disk, but it provides no warning about potential impact on user data or mailbox state. Under the markdown-specific SQP-2 criteria, descriptions of behaviors that can affect user data, privacy, or system integrity should include user-facing warnings.
The module docstring says v1.0.2 adds 'IMAP ID 预发送支持(登录前发送)', implying IMAP ID is transmitted before login to address the Unsafe Login issue. In every implementation path shown, the code calls mail.login(...) first and only then calls mail.xatom('ID', ...), so the documentation directly contradicts the actual behavior.
The batch-move feature can operate on all messages and marks originals as deleted after copying, effectively removing mail from the source folder without any confirmation. In a skill used by an autonomous or semi-autonomous agent, this raises the risk of large-scale unintended mailbox modification or data loss from operator error or adversarial prompting.
The primary user-facing description is written only in Chinese, with no indication that the skill is region-specific or that users can choose another language. This can violate language/locale policy when a skill implicitly forces a language without explicit opt-in or documented justification.
This shell script includes user-facing comments and status/output text in Chinese, including installation guidance and next steps. Per the policy, forcing a specific language or locale without offering user choice or opt-in is a natural-language policy violation.
This markdown file uses Chinese throughout, including installation and safety-related instructions, but does not indicate that the skill is China-specific or provide an opt-in language choice. That can violate language/locale policy because users are implicitly forced into a specific language for operational guidance.
This manifest file includes a broad capability description for full email management, but it does not specify when the skill should be invoked or what phrases or contexts should activate it. In manifest files, missing trigger specificity can cause unintended invocation overlap with general email-related requests.
No suspicious patterns detected.