T09 · Insecure Skill Coding Practices
- Location
config.env:6- Finding
TLS Certificate Verification Disabled for IMAP and SMTP
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill appears to provide the promised email features, but it ships insecure defaults and credential-handling flaws that could expose mailbox access or affect local files.
Review this skill carefully before installing. It needs mailbox credentials and can read, send, and modify email state. Do not use the bundled config as-is: enable certificate verification, replace the hardcoded account settings, restrict allowed read/write directories, and avoid running setup where terminal output is logged until the password-printing fallback is fixed.
config.env:6TLS Certificate Verification Disabled for IMAP and SMTP
setup.sh:303Setup Script Prints Email Credentials to Terminal Output
scripts/imap.js:16Attachment Download Allowlist Can Be Bypassed Through Symbolic Links
scripts/smtp.js:15File Read Allowlist Is Vulnerable to Check-to-Use Races
The supplied code substantially matches the IMAP/read side of the description: it connects to IMAP, checks unread/all messages, fetches full content, searches, marks read/unread, lists mailboxes, parses attachments, and downloads attachments. However, the declared purpose explicitly includes sending email via SMTP and sending emails with attachments, and there is no SMTP logic or send-mail function in this code chunk. Additionally, the code has a concrete filesystem write capability for attachment downloads, which is an operational behavior not called out explicitly in the description, though it is closely related to attachment handling. The claim of multiple-account support is only partially supported here through account listing/config display, not through clear per-command account selection or simultaneous account operations in this chunk. Overall, this is a real description/behavior mismatch because a major declared capability—sending mail—is absent from the provided code.
The declared description presents a combined IMAP/SMTP skill with substantial mailbox-reading and message-management features. The supplied code chunk is specifically an SMTP CLI: it creates an SMTP transporter, verifies connectivity, sends mail, supports attachments, reads subject/body content from local files, runs a connection test that sends a test message, and lists configured accounts. There is no evidence in this chunk of IMAP connections, inbox access, unread-message detection, message retrieval, search, or read/unread state changes. While sending email with attachments and multi-account-related configuration are consistent with part of the description, the actual behavior shown is materially narrower than the declared purpose, so this is a mismatch.
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/imap.js --account work check
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
Referenced artifact was not completely inspected
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello
The lockfile pins linkify-it 5.0.0, which has reported quadratic-complexity denial-of-service issues in its matching logic, including mailto: handling. In this skill, mail content is attacker-controlled input, so parsing crafted email bodies or headers could consume excessive CPU and degrade or block processing.
The bundled transitive nodemailer 8.0.4 under mailparser has multiple advisories, including CRLF/header injection and content resolution weaknesses. Because this skill sends and parses email and may handle untrusted addresses, headers, and message parts, exploitation could enable message/header manipulation, unauthorized content inclusion, or denial of service depending on reachable code paths.
The top-level dependency nodemailer 7.0.13 is flagged by multiple advisories affecting header parsing, content resolution, and denial-of-service behavior. This is especially relevant in an IMAP/SMTP skill because it directly constructs outbound email from potentially user-controlled fields like recipients, subject, headers, and attachments.
semver 5.3.0 is affected by a regular-expression denial-of-service issue, but here it appears only as a transitive dependency of utf7 used by imap. The practical risk is lower because exploitation requires attacker influence over semver parsing inputs, which is less obvious in normal email-processing flows than the other findings.
The package declares nodemailer 7.0.13, which is reported as affected by multiple advisories including CRLF/header injection, denial-of-service, and bypass issues. In the context of an IMAP/SMTP skill, this is especially dangerous because the library is central to composing and sending email, so crafted inputs could potentially manipulate headers, bypass safeguards, or disrupt service.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
const dotenv = require('dotenv');
// Split config: secrets in OC .env, connection settings in skill config.env
const OC_ENV_PATH = path.join(os.homedir(), '.openclaw', '.env');
const SKILL_CONFIG_PATH = path.resolve(__dirname, '../config.env');
const LEGACY_ENV_PATH = path.join(os.homedir(), '.config', 'imap-smtp-email', '.env');