Back to skill

Security audit

163邮箱基础版

Security checks for vulnerabilities and agentic risk

Overview

This skill is an email tool with a coherent purpose, but it asks users to use plaintext mailbox credentials and enables sensitive email reading/sending with incomplete scoping and disclosure.

Review this carefully before installing. Use a dedicated 163.com authorization code, keep the config file outside shared or source-controlled folders, set owner-only permissions, and revoke/rotate the code if exposed. Avoid callback_url unless you fully trust the destination and confirm exactly what will be sent. Treat any send-mail request as requiring explicit approval of recipient, subject, body, and attachment.

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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:132
Finding

Plaintext Storage of Email Authorization Credentials

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 132–145
Vulnerability Type: Plaintext sensitive credential storage
Risk Level: Medium

The Skill directs users to store their 163.com email address and reusable client authorization code in a local JSON configuration file:

markdown
## 配置说明

### 配置文件位置
`./.config/email-163-com/config.json`

### 配置文件格式
```json
{
  "email": "your_email@163.com",
  "password": "your_auth_code",
  "imap_server": "imap.163.com",
  "imap_port": 993,
  "smtp_server": "smtp.163.com",
  "smtp_port": 465
}
text

The document subsequently acknowledges the plaintext storage risk at line 241:

```markdown
- 配置文件明文存储授权码,需手动设置文件权限

Technical Analysis

The documented configuration format places a reusable mailbox authorization code directly in a plaintext file. Restrictive permissions are only recommended later in the documentation and are not enforced as part of configuration-file creation or validated before use.

The documented path is also inconsistent: lines 132–145 identify ./.config/email-163-com/config.json, whereas line 220 identifies ./.json. Because both are relative paths, their resolved locations depend on the process's current working directory. This ambiguity can cause credentials to be stored inside a source repository, shared workspace, backup scope, or directory readable by other users and processes.

No executable implementation is included in the audited project, so runtime permission handling cannot be verified. The finding is therefore limited to the insecure credential-storage workflow explicitly prescribed by SKILL.md.

Attack Path

  1. A user follows the Skill documentation and writes a valid 163.com client authorization code into the documented JSON configuration.
  2. The file is created with default permissions, at the ambiguous ./.json location, or within a project directory without an applicable ignore rule.

...[truncated 1114 chars]

Remediation
View remediation

Remediation Suggestions

  1. Store authorization codes in an operating-system credential store or dedicated secret manager rather than in JSON.
  2. If file-based storage is unavoidable, use one canonical absolute or user-home-relative path outside the project tree, such as a platform-specific private configuration directory.
  3. Create the credential file atomically with owner-only permissions (0600 on POSIX systems) and a private parent directory (0700). Do not rely on users to apply permissions afterward.
  4. Validate file ownership, symbolic-link status, and permissions before reading the credential; reject files accessible by group or other users.
  5. Correct the conflict between ./.config/email-163-com/config.json and ./.json, and clearly document the single supported location.
  6. Add the configuration path and equivalent secret-file patterns to version-control ignore rules.
  7. Separate non-sensitive server configuration from credentials so only the authorization code requires protected storage.
  8. Avoid printing, logging, returning, or including the authorization code in command-line arguments, errors, telemetry, or generated reports.
  9. Provide credential rotation and revocation instructions for users who suspect exposure.
  10. Add automated tests that verify secure creation permissions, reject unsafe ownership or modes, and prevent secret files from being committed.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (6)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill advertises email sending and includes exec/write capabilities, which can cause user-provided content, attachments, and metadata to be transmitted to external mail infrastructure. Without a clear, prominent warning at the capability declaration point, users may unknowingly expose sensitive data through the agent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

Accepting an arbitrary callback_url introduces an outbound network sink that could send task status or processed content to attacker-controlled endpoints. Because the document provides no privacy or allowlist warning, users may not recognize that enabling this parameter can exfiltrate metadata or sensitive results.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs users to store email credentials or authorization codes in a local JSON file, but the disclosure and safeguards are too weak relative to the sensitivity of the secret. In agent environments, local plaintext credential storage increases the risk of accidental exposure through logs, workspace sharing, backups, or other tools with file access.

Content

No source excerpt is available for this finding.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
80% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

Scanner excerpt · SKILL.md (reported line 220)May include surrounding context.

md
### Q1: 为什么必须使用客户端授权码?
A: 163邮箱IMAP/SMTP登录必须使用客户端授权码而非登录密码。获取方式:登录网页版 → 设置 → POP3/SMTP/IMAP → 开启服务并生成授权码.
### Q2: 配置文件应该放在哪里?
A: 默认路径 `./.json`,包含 `email`、`password`(授权码)、`imap_server`(imap.163.com)、`imap_port`(993)、`smtp_server`(smtp.163.com)、`smtp_port`(465)。建议执行 `chmod 600` 设置权限.
### Q3: 如何发送HTML格式邮件?
A: 基础版支持纯文本(`--body`)与单附件,不支持HTML格式发送。如需HTML邮件、多附件、文件正文等功能,请升级付费版.
### Q4: IMAP ID是什么?为什么163邮箱必需?

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation states the configuration file location is ./.config/email-163-com/config.json at L133-L145, but the FAQ later says the default path is ./.json at L219-L220. These two statements cannot both be correct, creating intent/documentation divergence about where credentials should be stored.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The config example lists only email, password, and server settings, but the error handling and FAQ state that imap_id is required and 'default configuration already includes' it at L195-L197 and L223-L224. This is a direct contradiction in the skill's own documentation about required configuration for login behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.