Back to skill

Security audit

imap-smtp-email

Security checks for vulnerabilities and agentic risk

Overview

The skill is a real email tool, but it needs review because its dependency/install chain and attachment download boundary have concrete security weaknesses.

Install only if you are comfortable giving the skill access to your email account and letting it send mail on your behalf. Prefer an app-specific password, keep ALLOWED_READ_DIRS and ALLOWED_WRITE_DIRS narrow, avoid symlinked download directories, review outgoing email commands before running them, and update or pin dependencies from trusted registries before use.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (2)

T08 · Insecure Dependencies

Warning
Location
package-lock.json:382
Finding

Nodemailer Dependency Retrieved from a Non-Official Package Registry

Content
View full analysis
=6.0.0" } } ``` ### Technical Analysis The setup process automatically invokes `npm install --production`. The lockfile instructs npm to retrieve the primary Nodemailer package from `registry.npmmirror.com`, while the other dependencies are predominantly retrieved from the official npm registry. Nodemailer is a security-sensitive dependency because it receives SMTP credentials, message contents, recipient addresses, and local attachment paths. Using an additional package-distribution operator expands the supply-chain trust boundary beyond the official npm registry. The pinned SHA-512 integrity value materially limits exploitation: control of the mirror alone is not sufficient to replace the package transparently because npm should reject content that does not match the lockfile hash. Successful package substitution would therefore also require modification of the lockfile integrity value, compromise or bypass of npm integrity verification, or delivery of a package already matching the trusted digest. The non-official source nevertheless creates an avoidable dependency-delivery and availability risk. ### Attack Path 1. A user runs `bash setup.sh`. 2. If `node_modules` is absent, the ...[truncated 1215 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/imap.js:55
Finding

Attachment Download Allowlist Can Be Bypassed Through Symlinked Directories

Content
View full analysis
path.resolve(d.replace(/^~/, os.homedir())) ); const allowed = allowedDirs.some(dir => resolved === dir || resolved.startsWith(dir + path.sep) ); if (!allowed) { throw new Error(`Access denied: '${dirPath}' is outside allowed write directories`); } return resolved; } ``` The validated path is subsequently used as follows: ```javascript const resolvedDir = validateWritePath(outputDir); if (!fs.existsSync(resolvedDir)) { fs.mkdirSync(resolvedDir, { recursive: true }); } const downloaded = []; for (const attachment of parsed.attachments) { // If specificFilename is provided, only download matching attachment if (specificFilename && attachment.filename !== specificFilename) { continue; } if (attachment.content) { const filePath = path.join(resolvedDir, sanitizeFilename(attachment.filename)); fs.writeFileSync(filePath, attachment.content); downloaded.push({ filename: attachment.filename, path: filePath, size: attachment.size, }); } } ``` ### Technical Analysis `validateWritePath` performs only lexical normalization with `path.resolve()`. It does not canonicalize the destination with `fs.realpathSync()` and does not inspect path components for symbolic links. Consequently, a path may appear to be under an approved directory while resolving through a symlink to a location outside that directory. For example: ```tex ...[truncated 2269 chars]
Remediation
View remediation
destination === root || destination.startsWith(root + path.sep) ); if (!allowed) { throw new Error('Destination is outside allowed write directories'); } return destination; ...[truncated 129 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (53)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

The description mostly matches the IMAP-related read/search/mark functionality implemented here, but it overstates the code's capabilities in material ways. Most importantly, there is no SMTP or send-email logic in this code chunk, despite the declared purpose explicitly promising sending emails with attachments. Additionally, the code writes attachments to local disk, which is a resource-access capability not mentioned in the description. Finally, while the description says it supports multiple accounts, this chunk's operational commands use a single configured IMAP account from config; it only exposes account listing, not clear multi-account selection or simultaneous support in the shown code. Therefore the declared description does not accurately represent the supplied code chunk.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description presents an operational IMAP/SMTP email skill. However, this code chunk does not implement email access or message operations at all. Its sole purpose is local configuration migration: it reads a legacy env file, parses credentials and server settings, detects providers, builds account config blocks, handles allowed read/write directory settings, and emits a new config format. While this may support the broader email skill during setup, the actual behavior of this chunk is materially different from the declared end-user capability, so this chunk is a mismatch against the stated description.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The description presents a combined IMAP/SMTP email skill with both mailbox-reading and message-sending capabilities. However, this code chunk is an SMTP CLI only. Its implemented commands are 'send', 'test', and 'list-accounts'. It creates an SMTP transporter, sends mail, optionally loads subject/body/HTML from local files, attaches files from allowed directories, and can send a test message to the configured account. There is no code here for connecting to IMAP, listing or searching messages, checking unread mail, fetching email contents, or changing read/unread state. While account listing and attachment sending are consistent with part of the description, the core declared read/IMAP capabilities are absent from the provided code, making the description materially broader than the actual behavior of this chunk.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/imap.js --account work check

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/smtp.js --account work send --to foo@bar.com --subject Hi --body Hello

Known Vulnerable Dependency: linkify-it==5.0.0 — 2 advisory(ies): CVE-2026-48801 (LinkifyIt#match scan loop has quadratic algorithmic complexity); CVE-2026-59887 (linkify-it: Quadratic-complexity DoS via the `mailto:` validator scan-loop on at)

High
Category
Supply Chain
Confidence
96% confidence
Finding

This lockfile includes linkify-it 5.0.0, which is flagged for quadratic-complexity denial-of-service issues during link parsing, including mailto handling. In an email skill, attacker-controlled email bodies and headers are realistic inputs, so parsing untrusted message content can trigger CPU exhaustion and service degradation.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nodemailer==8.0.5 — 8 advisory(ies): CVE-2026-82661 (Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary); GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable) +5 more

High
Category
Supply Chain
Confidence
98% confidence
Finding

This package-lock contains nodemailer 8.0.5 as a transitive dependency under mailparser, and the listed advisories include CRLF/header injection, resource-exhaustion, and content resolution bypass issues. Because this skill processes and sends email, malformed attacker-supplied addresses, headers, or message structures are directly relevant and could lead to denial of service, header manipulation, or unsafe file/content access behavior depending on how the library is used upstream.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nodemailer==9.0.3 — 4 advisory(ies): GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable); GHSA-cc9r-2j5m-2m83 (Nodemailer: Recipient-domain validation bypass via RFC 5322 comment mis-parsing ) +1 more

High
Category
Supply Chain
Confidence
97% confidence
Finding

The direct dependency nodemailer 9.0.3 is flagged for multiple high-severity issues, including address parsing denial-of-service and security-control bypasses around content and recipient validation. In a skill whose main purpose is SMTP email sending, these flaws are especially relevant because untrusted recipient fields, headers, and message composition data may come from users or parsed emails.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: semver==5.3.0 — 1 advisory(ies): CVE-2022-25883 (semver vulnerable to Regular Expression Denial of Service)

High
Category
Supply Chain
Confidence
85% confidence
Finding

semver 5.3.0 is affected by a ReDoS issue, but here it appears only as a transitive dependency of utf7 used by imap. The vulnerability is real in the dependency tree, though this specific skill context makes exploitability less direct unless attacker-controlled semver expressions are somehow passed into that code path.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nodemailer==9.0.3 — 4 advisory(ies): GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable); GHSA-cc9r-2j5m-2m83 (Nodemailer: Recipient-domain validation bypass via RFC 5322 comment mis-parsing ) +1 more

High
Category
Supply Chain
Confidence
97% confidence
Finding

The package depends on nodemailer 9.0.3, which is flagged with multiple published advisories, including issues affecting parsing, validation, and safety controls. In an email skill that sends mail and may handle attachments or untrusted recipient/address content, these flaws are more dangerous because they sit directly in the core message construction and delivery path.

Content

No source excerpt is available for this finding.