Back to skill

Security audit

Email Monitor

Security checks for vulnerabilities and agentic risk

Overview

This email-monitoring skill is related to its stated purpose, but it stores mailbox credentials in plaintext and can write sender-controlled attachment filenames to disk if attachment downloading is enabled.

Review before installing. Use only an app-specific password, avoid primary account passwords, and be aware that the skill keeps ongoing access to email content through a local config file. Do not enable attachment downloading unless the filename handling is fixed and downloaded files are treated as untrusted.

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

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:32
Finding

Mailbox Credentials Are Collected and Stored in Plaintext

Content
View full analysis
/config.json` Config template: ```json { "email": "", "password": "", "imap_host": "", "imap_port": 993, "mailbox": "INBOX", "state_file": "~/.openclaw/email-monitor//state.json", "max_emails": 20, "fetch_attachments": false, "attachment_dir": "~/Downloads/email-attachments" } ``` ``` `scripts/fetch_emails.py:99-117` then reads the plaintext secret and uses it to authenticate: ```python parser = argparse.ArgumentParser() parser.add_argument("--config", required=True, help="Path to config JSON file") args = parser.parse_args() with open(args.config) as f: cfg = json.load(f) # Merge with defaults for k, v in DEFAULT_CONFIG.items(): cfg.setdefault(k, v) # Expand ~ in paths cfg["state_file"] = os.path.expanduser(cfg["state_file"]) cfg["attachment_dir"] = os.path.expanduser(cfg["attachment_dir"]) state = load_state(cfg["state_file"]) last_uid = int(state.get("last_uid", 0)) mail = imaplib.IMAP4_SSL(cfg["imap_host"], cfg["imap_port"]) mail.login(cfg["email"], cfg["password"]) ``` ### Technical Analysis The Skill explicitly asks the user to disclose a mailbox credential in a conversation and stores that credential unencrypted in `config.json`. Neither the instructions nor the implementation require the file to be ...[truncated 2257 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/fetch_emails.py:55
Finding

Sender-Controlled Attachment Filename Allows Writes Outside the Attachment Directory

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (17)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The declared description emphasizes an end-to-end setup tool for periodic email monitoring: helping configure any IMAP mailbox, testing the connection, and creating a scheduled cron job that delivers summaries automatically. The supplied code does not implement that setup/orchestration behavior. Instead, it is only a fetcher script that reads an existing config file, logs into IMAP, retrieves messages newer than the last UID, optionally downloads attachments to disk, stores state locally, and prints raw email summary objects to stdout. The attachment-saving behavior is also a notable undeclared capability because it writes email attachments to the filesystem, which goes beyond merely checking for new emails and summarizing them. While the code is related to email monitoring, it materially under-implements the declared primary purpose and includes file download behavior not reflected in the description.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The skill explicitly asks the user for an email password or app password and stores it in a local JSON config file under the user's home directory, without any warning, encryption, or safer secret-handling mechanism. Compromise of that file would give direct mailbox access and may expose reset links, personal data, and other downstream accounts.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill instructs the agent to solicit highly sensitive mailbox credentials, persist them locally, and display fetched email content back to the user in plain language. That combines credential exposure with ongoing access to private communications, greatly increasing the blast radius if logs, config files, or outputs are exposed to other processes, users, or systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README promotes continuous mailbox monitoring, notifications, and AI summarization without clearly warning that the skill will maintain ongoing access to email contents and metadata. Because email often contains sensitive personal, business, or authentication information, failing to disclose the privacy implications can lead users to grant persistent access without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The README advertises automatic attachment download to a local directory but does not warn users that this causes arbitrary remote-supplied files to be written to disk. In the context of an email-monitoring skill, attachments may be malicious, oversized, or contain dangerous filenames/content, so omission of safety guidance increases the chance of unsafe deployment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
92% confidence
Finding

The skill performs file-writing operations by instructing storage of mailbox configuration and state on disk, but it declares no tool scope or permissions boundary. Missing explicit capability declarations weakens reviewability and can allow a skill with persistent local side effects to run with broader authority than users or auditors expect.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The onboarding prompt is written in Chinese and later examples and confirmations are also Chinese, indicating the skill is prescribing a specific interaction language. There is no opt-in or statement that the skill is intended only for a Chinese-speaking or region-specific context, so this is a language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Automatically downloading email attachments to a local directory creates a file-system and malware exposure path, especially because email attachments are a common delivery mechanism for malicious content. The skill provides no warning, scanning, type restrictions, or containment controls before enabling this behavior.

Content

No source excerpt is available for this finding.

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The second RA2 report refers to the same persistence behavior: installation of a cron task that continues operating after the interactive session ends. In the context of mailbox monitoring and local attachment handling, this makes the skill more dangerous because it enables repeated access to sensitive data and repeated file writes over time.

Content

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

  • "standard" for B
  • "<custom template string>" for C

Step 6 — Summarize and create cron job

Show a confirmation summary:

text

Session Persistence

Medium
Category
Rogue Agent
Confidence
91% confidence
Finding

The second RA2 report refers to the same persistence behavior: installation of a cron task that continues operating after the interactive session ends. In the context of mailbox monitoring and local attachment handling, this makes the skill more dangerous because it enables repeated access to sensitive data and repeated file writes over time.

Content

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

  • "standard" for B
  • "<custom template string>" for C

Step 6 — Summarize and create cron job

Show a confirmation summary:

text

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The cron command uses ~/.openclaw/email-monitor/<email>/config.json while the documented storage path uses a sanitized email (<sanitized-email>). This inconsistency can cause the scheduled task to reference the wrong file, fail unpredictably, or operate on attacker-influenced path content if raw email text is inserted into filesystem paths.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The document provides a concrete configuration example that includes a plaintext password field and tells users to copy an app password, but it does not warn against storing that credential in markdown, config files, logs, or source control. In the context of an email-monitoring skill, this is more dangerous because users are likely to persist these settings for scheduled automation, increasing the chance of long-lived credential exposure and mailbox compromise.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes periodic email checking and summary delivery, but this file supports saving attachment contents locally when fetch_attachments is enabled. Persisting arbitrary mailbox attachments is a materially broader behavior than summarizing new messages and is not mentioned in the stated skill purpose.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

Attachment filenames from untrusted email content are joined directly into a local path and written to disk. A malicious sender could supply crafted filenames such as '../' path traversal sequences or overwrite-prone names, causing files to be written outside the intended attachment directory or clobber existing files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
82% confidence
Finding

The code loads a password from the config file and uses it to authenticate to a remote IMAP server, which involves sensitive credential handling and network access to mailbox contents. The file contains no warning, log message, or disclosure to the user at the point of execution about using stored credentials or connecting to a remote mail service.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
73% confidence
Finding

The natural-language instructions and example invocation are entirely in Chinese, and the README does not indicate whether other languages are supported or that the skill is intentionally limited to a Chinese-speaking audience. Under the stated policy, forcing a specific language without user opt-in can be a locale-policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

The file tells users to invoke manual checking with a Chinese phrase and does not provide alternatives in other languages. This creates a locale-specific interaction requirement without opt-in or justification.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.