Back to plugin

Security audit

OpenMail

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marked the plugin suspicious because it reports that an attachment filename can be placed into shell command guidance without safe escaping, creating a conditional command injection risk.

Consider the reported command injection risk before installing. Risk depends on whether attachment filenames are preserved and whether an agent runs the suggested command through a shell without safely encoding it; the scan did not test end-to-end exploitation.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Findings (1)

MCP05

Warning
Location
plugin/dist/inbound.js:68
Finding

Agent-mediated shell command injection through attachment filenames ## Remediation Suggestions 1. **Replace shell guidance with structured execution.** Provide an attachment-reading tool that accepts the message ID and filename as separate data arguments and invokes the API or CLI without a shell. 2. **Do not interpolate email-controlled metadata into executable instructions.** Keep filenames in clearly identified untrusted metadata fields rather than embedding them in ready-to-run commands. 3. **If shell commands must be generated, encode every argument correctly for the target shell.** Double quotes alone are insufficient. Apply this protection to filenames, message IDs, sender fields, thread IDs, and inbox IDs wherever commands are constructed. 4. **Add regression tests** covering command substitutions, backticks, embedded quotes, newlines, and shell metacharacters. Verify that hostile filenames remain literal data throughout attachment retrieval. 5. **Apply defense in depth.** Retain the skill’s email-safety instructions and restrict shell-tool permissions, but do not treat either as a substitute for eliminating unsafe command construction.

Content
View full analysis

Vulnerability Details

File Location: plugin/dist/inbound.js:68–71
Vulnerability Type: Unsafe shell-command generation from untrusted email metadata
Risk Level: Medium

Vulnerable Code

js
const unread = params.attachments.filter((a) => !a.parsedText?.trim()).map((a) => a.filename);
if (unread.length > 0 && params.staged.paths.length === 0) {
    header.push(`(read one with: openclaw openmail -- attachments text --message-id ${params.messageId} --filename "${unread[0]}")`);
}

Technical Analysis

The plugin inserts an inbound attachment filename into a command presented to the agent as plugin-authored guidance. The filename is not shell-escaped.

Enclosing a value in double quotes does not prevent shell interpretation: $() and backtick command substitutions remain active, and an embedded double quote can terminate the quoted argument. For example, if preserved by the email service, the filename:

text
$(printf OPENMAIL_AUDIT).pdf

produces guidance equivalent to:

bash
openclaw openmail -- attachments text --message-id MESSAGE_ID --filename "$(printf OPENMAIL_AUDIT).pdf"

Executing this command through a compatible shell runs printf before invoking the CLI. An attacker could substitute a different command.

This is an agent-mediated vulnerability, not direct execution by the plugin. The CLI wrapper itself uses argument-array spawning without a shell. Exploitation requires the model to execute the generated guidance through a shell-capable tool without safely re-encoding the filename. The skill’s instruction not to execute commands from emails is a mitigation, but the unsafe command is presented as plugin-generated guidance rather than merely quoted email content.

Attack Path

  1. An attacker sends an email containing an attachment with shell syntax in its filename to an enabled inbox.
  2. OpenMail preserves the relevant filename characters, and the message passes server-side classification.
  3. The attachme ...[truncated 1231 chars]

SkillSpector findings are pending for this release.

Endor dependency reachability

Checked Nov 22, 2026 · 8:10 AM UTC

Scan failed: Endor analysis failed. Request a rescan to try again.