T09 · Insecure Skill Coding Practices
- Location
scripts/email_watcher.py:19- Finding
Hard-Coded Mailbox Credential and Account Identifiers
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This email watcher matches its general purpose, but it ships with hardcoded mailbox credentials and a fixed QQ notification target that could expose email data without clear user control.
Review this skill carefully before installing or running it. Revoke or remove the bundled IMAP authorization code, replace all hardcoded account and target values with your own protected configuration, confirm the QQ recipient, disable or constrain AI summarization for sensitive email, and fix whitelist matching before using it on a real mailbox.
scripts/email_watcher.py:19Hard-Coded Mailbox Credential and Account Identifiers
scripts/email_watcher.py:97Indirect Prompt Injection Through Untrusted Email Content
scripts/email_watcher.py:189Whitelist Bypass Through Substring-Based Sender Validation
The documented behavior does not fully disclose that the implementation uses sensitive mailbox credentials, accesses a specific QQ mailbox, and sends notifications to a fixed QQ target. This mismatch can conceal credential handling and data-routing behavior from users, which is dangerous because email contents and authentication material are highly sensitive and may be exposed or redirected without informed consent.
Email content is transmitted for AI summarization without any explicit warning, confirmation, or consent flow, exposing potentially sensitive personal or business information. In an email-watching skill, mailbox contents are especially sensitive, so silent onward transfer to another processor is more dangerous than in less sensitive domains.
Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.
"--thinking", "off"
],
capture_output=True, text=True, timeout=30,
env={**os.environ, "OPENCLAW_SESSION_ID": "email-summarizer"}
)
if result.returncode == 0 and result.stdout.strip():
return result.stdout.strip()
The skill forwards derived email content, including subject, sender, and preview text, to a QQ target without explicit disclosure in the code path or any consent guard. This can leak sensitive information from incoming emails into another messaging channel, expanding the exposure surface beyond the mailbox itself.
The skill advertises a capability that inherently uses filesystem access, network access, environment/secrets, and shell execution, but the manifest does not declare any tool scope or permissions. This weakens transparency and policy enforcement, making it easier for a user or platform to underestimate what the skill can access and increasing the blast radius if the skill is misused or modified.
Continuous mailbox polling and forwarding notifications into QQ exposes sensitive email metadata and potentially message content into an additional communication channel, but the description does not warn users about this propagation. That omission matters because users may assume monitoring is local-only, while in reality subjects, senders, summaries, and codes could appear in QQ messages and logs.
The skill states that it performs AI summarization of incoming emails but does not warn users that email content may be transmitted to an external AI service. Because emails can contain verification codes, financial details, links, and personal data, undisclosed third-party transmission creates a significant privacy and confidentiality risk.
The guide instructs users to place a long-lived IMAP authorization code directly into a Python script, which encourages credential hardcoding in source files. This increases the chance of accidental disclosure through backups, logs, screenshots, version control, or file sharing, and the skill context is particularly sensitive because the credential grants ongoing access to a personal mailbox.
The instructions tell the user to launch the watcher as a background process, but they do not clearly warn that it will maintain continuous network access to the mailbox and persist state in local files. In an email-monitoring skill, this matters because users may not understand the ongoing collection, retention, and notification behavior, which can create privacy and operational risk if the process keeps running unexpectedly.
The script sends email subject and body content to an external AI subprocess for summarization, which creates a confidentiality risk because potentially sensitive mailbox data leaves the core watcher flow. In this skill context, the feature is optional enhancement rather than essential monitoring, so transmitting private email content to another processing component materially increases exposure.
The docstring claims isolation, but the code uses a fixed shared session identifier 'email-summarizer', which can cause cross-run or cross-context data mixing depending on how the downstream tool handles sessions. Misrepresenting isolation increases the chance that sensitive email-derived prompts or outputs are retained or become accessible in an unintended shared context.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
4. 50字以内
"""
try:
result = subprocess.run(
[
"openclaw", "agent",
"--session-id", "email-summarizer",
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
"--message", msg
]
try:
result = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
if result.returncode == 0:
return True
else:
All user-facing instructions in this file are presented exclusively in Chinese. Under the policy, forcing a specific language without user opt-in can be a natural-language policy violation unless the locale restriction is explicit and justified.
The file's user-facing natural-language strings and operational descriptions are in Chinese, including startup and error messages, with no indication that the language is configurable or intentionally limited to a Chinese-only audience. This can violate language/locale policy when a skill forces a specific language without user opt-in.