Back to skill

Security audit

基于163邮箱SMTP发送邮件功能

Security checks for vulnerabilities and agentic risk

Overview

This 163 Mail sender appears to do what it claims, but it needs review because it disables SMTP certificate checks and logs email details by default.

Review before installing or using with real mail credentials. Remove InsecureSkipVerify, make logs opt-in or private/redacted, avoid shared log directories, do not send confidential content through this version, and do not pass untrusted text as the subject until header validation is added.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/main.go:163
Finding

SMTP TLS Certificate Verification Is Disabled

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.go:111
Finding

Sensitive Email Data Is Logged with Permissive File Permissions

Content
View full analysis
200 { logContent = logContent[:200] + "..." } logEntry := fmt.Sprintf(` ======================================== 发送时间: %s 邮件标题: %s 接收方: %s 邮件内容: %s 发送结果: %s ======================================== `, timestamp, subject, strings.Join(recipients, ", "), logContent, result) // 打开或创建日志文件(追加模式) file, err := os.OpenFile(logFilePath, os.O_CREATE|os.O_WRONLY|os.O_APPEND, 0644) ``` Logging is enabled by default and receives the original message data: ```go var logPath = flag.String("log", "./", "日志文件保存路径(可选)") ``` ```go writeLog(*logPath, *subject, *info, toList, err == nil, err) ``` ### Technical Analysis The application automatically logs email subjects, recipient addresses, delivery errors, and up to 200 bytes of message content. The default log location is the current directory, so logging occurs even when the user does not explicitly request it. New log directories are requested with mode `0755`, and new log files are requested with mode `0644`. Subject to the process umask and existing directory permissions, these modes can allow other local users to traverse the log directory and read the log file. Email bodies and recipient lists may contain personal, confidential, or operational information. The 200-byte truncation reduces the amount of exposed body data but does not eliminate the exposure. Subjects, recipient lists, error details, and the first portion of each message remain available. ### Att ...[truncated 1050 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/main.go:240
Finding

User-Controlled Subject Permits Raw Email Header Injection

Content
View full analysis
Remediation
View remediation
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 (7)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

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

md
go build -o email163 main.go

# 将可执行文件移动到PATH目录(可选)
sudo mv email163 /usr/local/bin/

# 或者直接使用go install
go install

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill explicitly documents that logs include sending time, subject, recipients, content, and results, but it does not clearly warn users that sensitive email bodies and recipient addresses may be persisted to disk. This creates a real privacy and data-leakage risk, especially if the tool is used for confidential notifications, credentials, personal data, or internal operational messages and logs are stored in shared or weakly protected 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 skill's help text and all user-visible console messages are presented only in Chinese, which imposes a language choice on users without opt-in. Under the stated policy, forcing a specific language without offering a choice is a natural-language policy violation unless clearly justified as region-specific.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The program writes recipients, subject, and up to 200 characters of email body into a log file, which may contain sensitive business or personal data. Because logging is enabled by default via './' unless explicitly changed, this creates unintended data retention and disclosure risk if local users, backups, or log collectors can access the files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
91% confidence
Finding

The shell script contains a natural-language comment in Chinese ('编译main.go为email163可执行文件') with no indication that the skill supports user language choice or is intentionally limited to a Chinese-speaking context. Per the policy, forcing a specific language without opt-in is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The help text says the log records include '内容' and describes the logging feature as recording the email content, which implies the full content is logged. In the implementation, the content is explicitly shortened to 200 characters before being written, so the documentation overstates what the code actually records.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

The program accesses EMAIL163_ADDRESS and EMAIL163_PASSWORD, which are sensitive credentials. The help text lists the required environment variables, but the execution path that reads them provides no disclosure that sensitive credentials are being consumed for authentication.

Content

No source excerpt is available for this finding.