T09 · Insecure Skill Coding Practices
- Location
scripts/smtp_send.py:61- Finding
SMTP Password Exposed Through Process Command-Line Arguments
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This messaging skill needs review because it handles email credentials and outbound messages while also storing learning data and preferences more broadly than its mail purpose clearly scopes.
Install only if you are comfortable with a mail skill that can send external messages and store local learning history. Use app-specific mail credentials, prefer environment variables or a secret manager instead of --pass, confirm recipients and webhook URLs before sending, and review or disable learned_patterns.json persistence if notes could contain sensitive content.
scripts/smtp_send.py:61SMTP Password Exposed Through Process Command-Line Arguments
scripts/learner.py:77Unvalidated Persistent Learning Data Can Poison Future Agent Decisions
The declared purpose is a mail and messaging helper, but the document also instructs the agent to record outcomes, persist preferences, and perform reflection/writeback. This hidden behavioral expansion matters because it introduces telemetry and stateful storage that users would not reasonably expect from a simple send/read mail skill, increasing privacy and integrity risk.
The declared purpose is a mail and messaging helper, but the document also instructs the agent to record outcomes, persist preferences, and perform reflection/writeback. This hidden behavioral expansion matters because it introduces telemetry and stateful storage that users would not reasonably expect from a simple send/read mail skill, increasing privacy and integrity risk.
This file implements a generic cross-skill telemetry and learning component that is materially broader than the declared purpose of a mail/messaging assistant. In skill ecosystems, undeclared cross-cutting data collection is dangerous because it expands the trust boundary, enables collection of behavioral data from unrelated workflows, and can be repurposed for surveillance or persistence beyond user expectations.
The skill declares capabilities that use environment variables and file-writing behavior via the learner workflow, but it does not scope or disclose those tool permissions. Missing tool scope weakens review and runtime containment, making it easier for a skill that handles credentials and user communications to access sensitive data or persist telemetry without explicit approval.
Broad trigger phrases like '发邮件', '通知我', and '读取邮件' are common natural-language requests and may cause the skill to activate in situations where the user did not intend credential use, mailbox access, or outbound transmission. In a skill capable of reading email and sending messages, accidental activation can lead to privacy exposure or unintended sends.
The skill advertises email-reading capability without prominent warning that it may access mailbox contents, sender/recipient metadata, and other sensitive personal data. Insufficient disclosure is dangerous because users may invoke it casually without understanding the privacy implications or the need for least-privilege credentials and explicit consent.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
### 3. 消息通知(机器人 Webhook)
- **企业微信群机器人**:`curl -X POST "$WECOM_WEBHOOK" -H 'Content-Type: application/json' -d '{"msgtype":"text","text":{"content":"任务完成"}}'`
- **飞书**:POST 到飞书自定义机器人 webhook,body 同上结构。
- **钉钉**:webhook 后需加 `×tamp=&sign=`(加签模式)。
The self-improve workflow exceeds the stated role of sending and retrieving messages by introducing persistent learning, failure recording, and reflective modification. That creates an unexpected data retention surface and potential file mutation path, which is risky in a public skill handling credentials and communication metadata.
The safety statement says private mail content will never be sent externally, yet earlier instructions encourage sending long reports and attachments through email and webhooks. This contradiction can mislead users and operators about actual data-flow boundaries, increasing the chance of accidental exfiltration of sensitive content under a false sense of safety.
The natural-language instructions, usage text, and user-facing messages in this file are all Chinese, which effectively forces a specific language for users interacting with the tool. The file does not offer an opt-in language choice or justify that the skill is intentionally region-specific.
The module writes learned_patterns.json containing user preferences and notes without any explicit warning, consent flow, or visible privacy notice. Silent persistence of potentially sensitive free-text notes is risky because users may provide secrets, personal data, or message content assuming it is transient, and those details remain on disk for later access.
The code persistently stores arbitrary preferences, operational history, error notes, and recent activity for any supplied skill directory, not just this mail assistant. That creates a privacy and cross-skill data exposure risk because user notes may contain sensitive content such as email subjects, recipients, failure details, or internal workflow context, all written to disk without scoping or protection.
This code file contains natural-language strings exclusively in Chinese, starting with the module docstring that describes the tool. The file does not indicate that the skill is intentionally limited to a Chinese-speaking or region-specific context, nor does it offer a language/locale option, which conflicts with the policy against forcing a specific language without user opt-in.
The script's runtime messages shown to users, including missing-credential errors and send success/failure notices, are only in Chinese. Because there is no opt-in, fallback language, or explicit justification for a Chinese-only audience, this is a natural-language policy violation rather than a code-security issue.
The docstring frames the module as only recording usage, preferences, insights, and reflection, but self_reflect generates explicit recommendations to '回写本技能 SKILL.md'. While it does not modify SKILL.md directly, the documentation omits this skill-maintenance-oriented behavior and therefore understates the module's intent.
No suspicious patterns detected.