Back to skill

Security audit

Mailbox

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent email-management helper, but it asks agents/users to run an unverified remote installer and recommends persistent mailbox access for a very sensitive account category.

Review carefully before installing. Prefer a pinned release with checksum or signature verification instead of curl | sh, protect ~/.config/mailbox/auth.json with restrictive permissions and app-specific credentials, and avoid installing the login daemon unless you explicitly want background mailbox sync and understand where cached email data is stored.

Vulnerability Patterns
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (2)

T03 · Remote Payload Retrieval and Execution

Error
Location
SKILL.md:34
Finding
Unpinned Remote Installation Script Executed Directly by a Shell<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 34 and 62 **Vulnerability Type**: Remote payload retrieval and execution through a mutable external URL **Risk Level**: High ### Vulnerable Code At line 34: ```bash curl -fsSL https://raw.githubusercontent.com/leeguooooo/Mailbox/main/install.sh | sh # installs the prebuilt binary to ~/.local/bin — make sure that's on PATH, then re-probe export PATH="$HOME/.local/bin:$PATH"; mailbox --version ``` The same installation pattern is repeated at line 62: ```bash # 1. Install the CLI from GitHub Releases (no npm/Node needed; prebuilt binary): curl -fsSL https://raw.githubusercontent.com/leeguooooo/Mailbox/main/install.sh | sh # (npm is deprecated: `npm install -g @leeguoo/mailbox-cli` may lag the releases) ``` ### Technical Analysis The Skill retrieves `install.sh` from the mutable `main` branch of a personal GitHub repository and pipes its contents directly to `sh`. No immutable commit, release version, checksum, or cryptographic signature is used to establish the integrity of the downloaded script. This creates a remote code-execution channel whose effective payload can change after the Skill has been reviewed. The shell begins executing the response without retaining it for inspection. The `-f`, `-s`, and `-S` options also make this installation path relatively non-interactive, while `-L` follows redirects. Installing a CLI is related to the declared email-management functionality, but executing an unverified, mutable script is not the minimum privilege or trust necessary to perform that installation. A verified release artifact could be installed without granting a mutable branch immediate shell execution. ### Attack Path 1. An attacker compromises the repository owner’s GitHub account, repository permissions, release process, or another component capable of modifying `install.sh` on `main`. 2. The attacker inserts commands into `install.sh` that steal credentials, alter local fil ...[truncated 1428 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove all `curl | sh` installation instructions. 2. Pin the installation to a specific, immutable release version or commit rather than `main`. 3. Download the artifact to a local file before executing or installing it: ```bash curl -fL -o mailbox.tar.gz \ https://github.com/leeguooooo/Mailbox/releases/download/v2.11.2/mailbox-<platform>.tar.gz ``` 4. Publish a trusted SHA-256 digest through a separately protected release process and verify it before extraction: ```bash echo "<EXPECTED_SHA256> mailbox.tar.gz" | sha256sum --check - ``` 5. Prefer cryptographic release signatures with a documented, pinned public key. A checksum hosted only beside a compromised artifact does not independently establish trust. 6. Extract and install only the expected binary into a user-owned directory without invoking an arbitrary installer script. 7. Document the exact files created and required permissions. 8. Do not install automatically merely because `mailbox` is absent. Ask for explicit user approval and show the source, version, destination, and verification result. 9. If an installation script is unavoidable, pin it to an immutable commit, download it for inspection, verify its digest or signature, and execute it only after explicit approval. ]]>

T06 · System Persistence

Warning
Location
SKILL.md:70
Finding
Optional Email Daemon Establishes Cross-Session User-Level Persistence<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 70–72 and 250–259 **Vulnerability Type**: Installation of an auto-starting persistent service **Risk Level**: Medium ### Vulnerable Code The setup instructions recommend daemon installation at lines 70–72: ```bash # 3. (Recommended) install the persistent daemon for ~5-30× faster calls: mailbox daemon install mailbox daemon status --json # confirm it's running ``` The persistence behavior is described at lines 250–259: ```bash ## Persistent daemon (5-30× faster CLI calls) Each one-shot CLI invocation otherwise spends 1-3s on TCP+TLS+IMAP LOGIN. With the daemon running, every CLI call reuses pooled connections, and the daemon also runs a background SQLite sync so `email list` (without `--live`) usually doesn't touch IMAP at all. ```bash mailbox daemon install # autostart at login (macOS launchd / Linux systemd-user) mailbox daemon status --json mailbox daemon reload # drop pooled connections after editing auth.json mailbox daemon stop ``` ``` ### Technical Analysis `mailbox daemon install` registers the CLI to start automatically at login through macOS `launchd` or Linux `systemd-user`. The service survives the initial Skill invocation, maintains pooled authenticated email connections, and performs background synchronization into a local SQLite cache. The declared email functionality can operate through one-shot CLI calls. Consequently, startup persistence is a performance optimization rather than a requirement for reading, searching, sending, or managing email. Recommending it as part of normal setup expands the duration and scope of access beyond the minimum necessary for an individual task. This risk is compounded by the remote installation issue: if the executable obtained through the mutable `curl | sh` path is compromised, daemon registration provides that executable with recurring execution on future logins. ### Attack Path 1. A malicious or compromised `mailb ...[truncated 1591 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Make one-shot CLI operation the default and do not recommend daemon installation during ordinary setup. 2. Require separate, explicit, informed user consent before creating any login service. 3. Only offer daemon installation after the CLI binary and its provenance have been cryptographically verified. 4. Display the exact `launchd` plist or `systemd-user` unit path, executable path, arguments, environment, and data directories before installation. 5. Provide a documented uninstall command that removes the startup entry, stops the process, closes pooled connections, and optionally deletes cached mailbox data. 6. Restrict service and cache permissions to the owning user, such as mode `0600` for credential and sensitive data files and appropriately restrictive directory permissions. 7. Minimize credentials and sensitive environment variables inherited by the service. 8. Protect local IPC endpoints against access by other users and validate all requests received by the daemon. 9. Document cache retention, encryption, cleanup, and logout behavior. 10. Consider an opt-in session-scoped daemon that terminates after inactivity instead of automatically starting at every login. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Rogue AgentSelf-Modification, Session Persistence
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (7)

Chaining Abuse

High
Category
Tool Misuse
Content
non-interactively from GitHub Releases (no npm, no auth) before doing anything else:

```bash
curl -fsSL https://raw.githubusercontent.com/leeguooooo/Mailbox/main/install.sh | sh
# installs the prebuilt binary to ~/.local/bin — make sure that's on PATH, then re-probe
export PATH="$HOME/.local/bin:$PATH"; mailbox --version
```
Confidence
97% confidence
Finding
The shell pipeline into sh is a classic command-chaining abuse pattern because it turns downloaded content into immediate shell input with no inspection or integrity validation. In the context of a skill file, this is more dangerous because an agent may treat the instruction as an endorsed operational step and execute it non-interactively.

Chaining Abuse

High
Category
Tool Misuse
Content
```bash
# 1. Install the CLI from GitHub Releases (no npm/Node needed; prebuilt binary):
curl -fsSL https://raw.githubusercontent.com/leeguooooo/Mailbox/main/install.sh | sh
#    (npm is deprecated: `npm install -g @leeguoo/mailbox-cli` may lag the releases)

# 2. Configure accounts (edit credentials):
Confidence
97% confidence
Finding
This second instance repeats the same unsafe chaining pattern and normalizes direct execution of network-fetched code. Because the skill is intended for agent use, such instructions materially increase the risk of automated remote code execution if the source is tampered with.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The manifest description says to use the skill for specific phrases and then expands scope to "or anything that involves listing / searching / reading / writing / classifying messages from one or more mailboxes." That catch-all activation language is very broad and lacks exclusion conditions, increasing the chance of unintended invocation for ordinary conversation about email.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The setup instructions tell the user to place live mailbox credentials into ~/.config/mailbox/auth.json without warning about the sensitivity of that file, filesystem permissions, backup exposure, or local compromise risk. Because this skill manages multiple email accounts, compromise of that file could expose mailbox contents and enable sending, deletion, and account takeover workflows via email.

Session Persistence

Medium
Category
Rogue Agent
Content
#    (npm is deprecated: `npm install -g @leeguoo/mailbox-cli` may lag the releases)

# 2. Configure accounts (edit credentials):
mkdir -p ~/.config/mailbox
cp $(npm prefix -g)/lib/node_modules/@leeguoo/mailbox-cli/examples/accounts.example.json \
   ~/.config/mailbox/auth.json
$EDITOR ~/.config/mailbox/auth.json
Confidence
89% confidence
Finding
This skill directs users to persist email credentials in a local configuration file under ~/.config/mailbox/auth.json, creating durable credential storage on disk. Persistent storage increases the attack surface through local malware, shared accounts, insecure backups, or accidental disclosure, especially given the high-value nature of email accounts.

External Script Fetching

Low
Category
Supply Chain
Content
non-interactively from GitHub Releases (no npm, no auth) before doing anything else:

```bash
curl -fsSL https://raw.githubusercontent.com/leeguooooo/Mailbox/main/install.sh | sh
# installs the prebuilt binary to ~/.local/bin — make sure that's on PATH, then re-probe
export PATH="$HOME/.local/bin:$PATH"; mailbox --version
```
Confidence
96% confidence
Finding
The skill instructs the agent/user to fetch and execute a remote install script directly from GitHub using curl piped to sh, which grants immediate code execution to whatever content is served at that URL at execution time. If the repository, branch, network path, or hosting account is compromised, this becomes a straightforward remote code execution vector on the user's machine.

External Script Fetching

Low
Category
Supply Chain
Content
```bash
# 1. Install the CLI from GitHub Releases (no npm/Node needed; prebuilt binary):
curl -fsSL https://raw.githubusercontent.com/leeguooooo/Mailbox/main/install.sh | sh
#    (npm is deprecated: `npm install -g @leeguoo/mailbox-cli` may lag the releases)

# 2. Configure accounts (edit credentials):
Confidence
96% confidence
Finding
This repeated installation instruction again fetches and executes a remote script from a mutable URL. Repetition increases the chance that an agent will follow the unsafe pattern automatically, making compromise of the upstream source or script distribution path especially dangerous.

Static analysis

No suspicious patterns detected.