Back to skill

Security audit

Qq Email Watcher

Security checks for vulnerabilities and agentic risk

Overview

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.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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/email_watcher.py:19
Finding

Hard-Coded Mailbox Credential and Account Identifiers

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
scripts/email_watcher.py:97
Finding

Indirect Prompt Injection Through Untrusted Email Content

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/email_watcher.py:189
Finding

Whitelist Bypass Through Substring-Based Sender Validation

Content
View full analysis
' in sender: sender_email = sender.split('<')[1].split('>')[0].strip() else: sender_email = sender.strip() is_whitelisted = any( w in sender_email or w in sender for w in whitelist ) ``` ### Technical Analysis The whitelist check uses substring containment instead of exact mailbox comparison. A whitelist entry can therefore match an attacker-controlled address that merely contains the trusted address as a substring. The secondary comparison against the entire `From` header also allows a whitelist entry placed in an attacker-controlled display name to satisfy the check. Examples of values that may match a whitelist entry such as `trusted@example.com` include: ```text trusted@example.com.attacker.test "trusted@example.com" ``` The code manually parses the `From` header using string splitting rather than the standard email address parser. It also does not verify that the sender passed SPF, DKIM, or DMARC checks. Because the `From` header itself can be spoofed, even an exact header-address comparison would not provide cryptographic sender authentication. ### Attack Path 1. The attacker learns or guesses an address in `whitelist.json`. 2. The attacker sends an email with a crafted `From` header whose display name or mailbox contains that whitelist entry as a substring. 3. The script extracts the header and evaluates `w in sender_email or w in sender`. 4. The substring expression evaluates to true even though the actual sender is not the whitelisted mailbox. 5. The script reads the subject and body and submits them to the OpenClaw summarization agent. 6. The resulting content is forwarded to the configured QQ recipient. 7. The attack ...[truncated 601 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (15)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Env Variable Harvesting

High
Category
Data Exfiltration
Confidence
60% confidence
Finding

Code enumerates, copies, or searches environment variables for secrets. Bulk environment access can collect credentials unrelated to the skill's stated purpose.

Content

Scanner excerpt · scripts/email_watcher.py (reported line 115)May include surrounding context.

python
"--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()

Missing User Warnings

High
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

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.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/email_watcher.py (reported line 107)May include surrounding context.

python
4. 50字以内
"""
    try:
        result = subprocess.run(
            [
                "openclaw", "agent",
                "--session-id", "email-summarizer",

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
70% confidence
Finding

subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Content

Scanner excerpt · scripts/email_watcher.py (reported line 135)May include surrounding context.

python
"--message", msg
    ]
    try:
        result = subprocess.run(cmd, capture_output=True, text=True, timeout=15)
        if result.returncode == 0:
            return True
        else:

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
76% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
78% confidence
Finding

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.

Content

No source excerpt is available for this finding.