Back to skill

Security audit

Neomutt Commander

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent NeoMutt email helper, but its setup instructions include an unsafe HTML-mail handler and plaintext email credential storage that users should review before installing.

Install only after adjusting the configuration: do not store your IMAP password directly in the NeoMutt config, use an app-specific token retrieved from a password manager or OS keychain where possible, lock down config permissions, and replace the mailcap HTML handler with a version that does not pass untrusted MIME charset values through the shell. Treat the skill as needing review rather than as intentionally harmful.

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:53
Finding

Shell Command Injection Through an Unquoted MIME Charset Parameter

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 53-56
Vulnerability Type: Mailcap shell command injection
Risk Level: High

Vulnerable Code:

text
Create `~/.config/neomutt/mailcap` so w3m renders HTML parts:

text/html; w3m -I %{charset} -T text/html; copiousoutput;

text

Technical Analysis

The recommended mailcap command inserts %{charset} into a shell-interpreted command without quoting or validation. This value can originate from the charset parameter in an email's MIME Content-Type header, which is controlled by the message sender.

If the mailcap implementation passes the expanded command through a shell, a malicious charset containing shell metacharacters can change the command's structure. As a result, rendering an attacker-supplied HTML message may execute an injected command rather than merely passing a charset value to w3m.

Attack Path

  1. A user installs the documented mailcap configuration.
  2. An attacker sends the user an HTML email with a crafted MIME charset parameter containing shell syntax.
  3. The user opens the message in NeoMutt.
  4. NeoMutt selects the documented mailcap handler for the HTML body.
  5. The attacker-controlled charset is substituted into the unquoted command.
  6. The shell interprets the injected metacharacters and executes the attacker's command with the NeoMutt user's privileges.

Impact Assessment

Successful exploitation can provide arbitrary command execution under the local account running NeoMutt. The attacker could read or alter files accessible to that account, access email configuration and credentials, modify shell configuration, or install user-level persistence. The vulnerability does not directly grant root privileges, but its scope includes all resources available to the affected user.

Remediation
View remediation

Remediation Suggestions

  • Do not interpolate attacker-controlled MIME parameters directly into shell commands.
  • Prefer a fixed charset where practical, for example by invoking w3m with a predetermined safe encoding.
  • If dynamic charset support is required, use a dedicated wrapper that strictly allowlists recognized charset names, such as alphanumeric names with narrowly permitted separators.
  • Have the wrapper invoke w3m using an argument array without a shell.
  • Reject unexpected values rather than attempting to escape arbitrary input.
  • Test the hardened handler against MIME parameters containing spaces, quotes, semicolons, command substitutions, redirections, and newline characters.

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:28
Finding

IMAP Credentials Stored in a Plaintext Configuration File

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 28-32
Vulnerability Type: Plaintext storage of sensitive credentials
Risk Level: Medium

Vulnerable Code:

text
Create `~/.config/neomutt/neomuttrc` (or `~/.neomuttrc`):

set imap_user = "user@gmail.com" set imap_pass = "*****"

text

Technical Analysis

The documented configuration directs users to place an IMAP password or Gmail App Password directly in a persistent NeoMutt configuration file. The instructions do not require restrictive file permissions and do not recommend retrieving the credential from an operating-system keychain or password manager.

Although an App Password may be more limited than a primary account password, it remains a sensitive authentication secret. Plaintext storage exposes it to other local users when permissions are weak, malware running in the same account, insecure backups, support bundles, dotfile repositories, and accidental file sharing.

Attack Path

  1. A user follows the documented configuration and replaces the placeholder with a real IMAP or App Password.
  2. The credential remains stored in plaintext in ~/.config/neomutt/neomuttrc or ~/.neomuttrc.
  3. The file is exposed through permissive filesystem permissions, local compromise, backup leakage, or accidental synchronization to a repository.
  4. An attacker extracts the username, mail server, and password from the configuration.
  5. The attacker authenticates to the mailbox using the stolen credentials, subject to the provider's controls and the credential's granted permissions.

Impact Assessment

Exposure may allow unauthorized mailbox access, including reading sensitive correspondence, searching historical email, downloading attachments, and modifying or deleting messages. Depending on the provider and account configuration, the credential may also permit sending email as the victim. Mailbox access can facilitate identity imperson ...[truncated 130 chars]

Remediation
View remediation

Remediation Suggestions

  • Replace the plaintext password example with NeoMutt's supported external credential-command mechanism.
  • Retrieve secrets at runtime from an operating-system keychain, password manager, or another access-controlled secret store.
  • Avoid placing literal passwords in configuration files, shell history, environment files, or version-controlled dotfiles.
  • If a local configuration must contain a credential, require restrictive permissions such as chmod 600 ~/.config/neomutt/neomuttrc and ensure the containing directory is not accessible to other users.
  • Use a provider-specific App Password or narrowly scoped credential instead of the primary account password.
  • Enable multifactor authentication, monitor account access, and document immediate credential revocation and rotation if the file may have been exposed.
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (2)

Sudo/Root Execution

Medium
Category
Privilege Escalation
Confidence
70% confidence
Finding

Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Content

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

brew install neomutt w3m

Ubuntu / Debian

sudo apt install neomutt w3m

text

## Configuration

Session Persistence

Medium
Category
Rogue Agent
Confidence
94% confidence
Finding

The skill instructs users to place IMAP credentials, including imap_pass, directly into a persistent plaintext neomutt configuration file in the home directory. Storing long-lived email credentials on disk materially increases the risk of credential theft from local compromise, backups, shell access, or accidental file exposure, especially because access to the mailbox can expose sensitive communications and enable account abuse.

Content

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

Configuration

Create ~/.config/neomutt/neomuttrc (or ~/.neomuttrc):

text
set imap_user = "user@gmail.com"

Static analysis

No suspicious patterns detected.