T09 · Insecure Skill Coding Practices
- Location
cli.js:20- Finding
IMAP TLS Certificate Validation Is Disabled
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This IMAP email skill is purpose-aligned overall, but it handles mailbox credentials and email-derived files in ways that need review before installation.
Review this skill before installing. It needs your IMAP credentials and can read mailbox contents, which fits its purpose, but it currently disables TLS certificate verification, saves email-derived digests into OpenClaw memory, and can write attachment files using unsafe sender-provided names. Install only if you trust the environment and preferably after fixing TLS verification, attachment filename sanitization, storage locations, and dependency sources.
cli.js:20IMAP TLS Certificate Validation Is Disabled
download-attachments.js:39Email Attachment Filename Allows Path Traversal and Arbitrary File Overwrite
cli.js:203Attacker-Controlled Email Metadata Is Persisted in Agent Memory
package-lock.json:21Dependency Lockfile Uses an Unencrypted Third-Party Package Mirror
The documented behavior does not fully match the detected behavior: the skill apparently writes local state and digest files that are not disclosed, while a declared attachment-download feature is not actually represented in the supplied implementation. Behavior mismatches are dangerous because they undermine user and reviewer expectations, making it easier to hide persistence, sensitive data retention, or other side effects involving email content.
The IMAP client disables TLS certificate validation via rejectUnauthorized: false while sending mailbox credentials from local config. This enables man-in-the-middle attacks in which an attacker can impersonate the mail server, capture credentials, and read or alter mailbox traffic; in an email-management skill, that is especially dangerous because it exposes both authentication secrets and sensitive message content.
linkify-it 5.0.0 is flagged with quadratic-complexity denial-of-service issues. In this skill, parsing attacker-controlled email bodies is a core function, so a crafted message containing pathological input could consume excessive CPU during text/link processing and degrade or block mailbox handling.
nodemailer 8.0.2 has multiple published advisories, including header injection and resource-consumption issues. Even if only present transitively, its inclusion is especially concerning here because the skill processes untrusted email-derived content and the package provides outbound mail functionality that is outside the stated IMAP-focused purpose.
semver 5.3.0 is affected by a regular-expression denial-of-service vulnerability. Although this appears to be a transitive dependency under utf7 and may not be directly exposed, vulnerable utility libraries still increase risk if attacker-influenced version strings or package metadata are ever parsed during runtime or auxiliary operations.
The skill declares capabilities that inherently require network access and likely access to local configuration, but it does not explicitly scope or constrain those tools via permissions or allowed-tools metadata. In an email-reading skill, missing scope increases the chance of overbroad execution, unintended data access, or silent expansion of what the agent may do with mailbox contents and local secrets.
Broad trigger phrases such as checking email or reading inbox can overlap with ordinary conversation, increasing the risk of accidental activation. In the context of a mailbox skill, unintended activation could expose email metadata, fetch message contents, or initiate network actions without sufficiently clear user intent.
The CLI emits Chinese-only messages and later formats dates with the zh-CN locale, indicating a fixed language/locale behavior. There is no opt-in, language selection mechanism, or documentation showing that the skill is intentionally limited to a Chinese-speaking or region-specific context.
The digest operation saves sender, subject, date, and UID information from emails into markdown files under the user's home directory. While it logs the save path after writing, the code does not provide prior disclosure in comments, help text, or a prompt that mailbox contents will be stored locally.
The code exposes a 'setup' command and earlier error text instructs users to run 'imap-mailbox setup' when the config file is missing. However, setupConfig only prints '配置已存在' and does not create, validate, or update configuration, which directly contradicts the documented/advertised intent of the setup flow.
The manifest describes an IMAP mailbox skill for reading and managing email, but this file directly accesses ~/.config/imap-mailbox/config.json to load account credentials. While IMAP access itself is expected, reading arbitrary local files from the home directory is a separate local-file access capability that is not justified or declared by the stated skill purpose.
The code loads mailbox configuration, including credentials, from a user-specific config file and uses them to access an email account. While the script's purpose implies email access, there is no comment, docstring, or explicit user-facing disclosure that sensitive credentials are being read from disk.
The script writes downloaded attachments and email text directly to disk in a persistent workspace path without confirmation, sanitization, or minimization. This can expose sensitive documents and message content to other local components, and attacker-controlled attachment filenames may cause unsafe writes within the target tree.
The script is named and described as an attachment downloader, but it also exports the full email body text to a workspace file. That broadens data collection beyond the apparent feature scope and can persist sensitive message content, increasing the risk of unintended disclosure to other tools, users, or processes with access to the workspace.
The lockfile includes nodemailer as a transitive dependency even though the skill is described as IMAP mailbox reading/management, not outbound mail sending. Extra outbound-capable mail functionality expands the attack surface and can enable unintended data exfiltration or misuse if exposed through code paths or future changes, especially in an email-processing skill handling sensitive content.
The use-case section describes when the skill may be used but does not clearly define when it should not activate, leaving room for ambiguous routing decisions. For an email-access skill, that ambiguity can result in unintentional mailbox operations or disclosure of sensitive message summaries when the user was only speaking generally about email.
The manifest describes an IMAP mailbox skill for listing, reading, searching, downloading attachments, and digest mode. While digest mode is declared, this implementation also stores mailbox-tracking state and generated digest content under ~/.openclaw/workspace/memory, which extends behavior from transient mailbox operations into local persistence of email metadata and summaries.
The code explicitly formats dates using toLocaleDateString('zh-CN'), which imposes a Chinese locale regardless of the user's preferences or system settings. This is a natural-language/locale policy concern because the tool does not offer a choice or explain the restriction.
The dependency uses a caret version range, which allows npm to install newer compatible releases rather than an exact reviewed version. This increases supply-chain risk because a future upstream compromise, malicious publish, or breaking security change could be pulled into the skill without explicit maintainer review.
"imap-mailbox": "./cli.js"
},
"dependencies": {
"html-to-text": "^9.0.5",
"imap": "^0.8.19",
"mailparser": "^3.6.5",
"minimist": "^1.2.8"
The imap package is specified with a caret range, so builds may resolve to different upstream versions over time. For a mail-handling skill that processes credentials and network data, this creates avoidable supply-chain exposure if an unreviewed release introduces malicious code or a vulnerable behavior.
},
"dependencies": {
"html-to-text": "^9.0.5",
"imap": "^0.8.19",
"mailparser": "^3.6.5",
"minimist": "^1.2.8"
}
The mailparser dependency is not strictly pinned, allowing automatic adoption of later semver-compatible releases. Because this skill parses attacker-controlled email content, pulling in unreviewed parser changes raises supply-chain and parser-security risk beyond a typical utility package.
"dependencies": {
"html-to-text": "^9.0.5",
"imap": "^0.8.19",
"mailparser": "^3.6.5",
"minimist": "^1.2.8"
}
}
The minimist dependency is referenced with a caret range instead of an exact version, permitting drift across installations. While the direct impact is usually limited, it still widens the attack surface for dependency confusion, compromised maintainer releases, or introduction of known vulnerable subversions.
"html-to-text": "^9.0.5",
"imap": "^0.8.19",
"mailparser": "^3.6.5",
"minimist": "^1.2.8"
}
}