Back to skill

Security audit

Agnic Agent Email

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do what it claims, but it gives the agent broad email access through an unpinned npm command that can change after review.

Review before installing. Use this only if you trust the Agnic CLI supply chain and are comfortable letting the agent read inbox contents and send email. Prefer a pinned, reviewed CLI version and a scoped, revocable token rather than `npx agnic@latest` or command-line tokens.

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

T08 · Insecure Dependencies

Warning
Location
SKILL.md:9
Finding
Execution of an Unpinned Third-Party npm Package## Vulnerability Details **File Location**: `SKILL.md`, lines 9-11 **Vulnerability Type**: Unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code ```yaml allowed-tools: - "Bash(npx agnic@latest status*)" - "Bash(npx agnic@latest email *)" ``` The same mutable package reference is used throughout the documented commands, including: ```bash npx agnic@latest status --json npx agnic@latest email setup --display-name "My Agent" --json npx agnic@latest email address --json npx agnic@latest email inbox --limit 10 --json npx agnic@latest email send --to <address> --subject "<subject>" --body "<body>" npx agnic@latest email reply --message-id <id> --body "<reply text>" ``` ### Technical Analysis The Skill authorizes direct execution of `agnic@latest` through `npx`. The `latest` npm distribution tag is mutable, so the code executed during a future invocation is not necessarily the code that existed when the Skill was audited. The project provides neither a fixed package version nor lockfile integrity metadata. If the package publisher, npm account, release pipeline, package namespace, or registry resolution path is compromised, an attacker could publish a malicious version under the `latest` tag. A subsequent Skill invocation could download and execute that version with the privileges and environment of the Agent process. This risk is particularly relevant because the CLI handles authentication and email operations. Its process may receive `AGNIC_TOKEN` through the environment or command line and may process email addresses, subjects, message bodies, inbox contents, and message identifiers. ### Attack Path 1. An attacker compromises the `agnic` npm publisher account, package release pipeline, or another relevant dependency-distribution component. 2. The attacker publishes a malicious release and assigns it to the mutable `latest` tag. 3. A user as ...[truncated 1154 chars]
Remediation
## Remediation Suggestions 1. Replace `agnic@latest` with a specifically reviewed and approved version, such as `agnic@X.Y.Z`. 2. Install the package as a project dependency using a lockfile that records exact transitive versions and registry integrity hashes. 3. Invoke the locally installed, locked binary rather than allowing `npx` to resolve and download a package dynamically on every use. 4. Verify npm package ownership, release provenance, signatures or attestations, and integrity before approving upgrades. 5. Perform dependency and package-content review whenever the pinned version is changed. 6. Run the CLI in a restricted environment with minimal filesystem permissions, a network allowlist, and only the environment variables required for the requested operation. 7. Supply `AGNIC_TOKEN` through a scoped secret manager and avoid the `--token` command-line option, which may expose the token through process listings or shell history. 8. Use a narrowly scoped, revocable token where supported, and rotate it immediately if package compromise is suspected.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding
The manifest also allows `Bash(npx agnic@latest email *)`, granting broad email-related execution through an unpinned npm package. This is particularly dangerous because the allowed capability includes reading inboxes and sending/replying to mail, so package compromise could directly affect confidentiality and integrity of communications.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The trigger phrases are broad (`check my email`, `send an email`, `inbox`, `set up email`) and overlap with common conversational requests, which can cause the skill to be invoked in contexts the user did not clearly intend. Because this skill can access inbox contents and transmit messages externally, ambiguous invocation increases the chance of unintended data exposure or unintended outbound communication.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding
The skill executes `npx agnic@latest`, which fetches and runs the latest published package at invocation time rather than a reviewed, fixed version. If the npm package, publisher account, or dependency chain is compromised, the agent could execute attacker-controlled code with access to authentication material and email operations.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding
This tool allowlist entry uses `npx agnic@latest`, so each run may execute newly published code outside the skill author's review boundary. In an email skill, that increases risk because the invoked package may access inbox content, send mail, or consume auth tokens if upstream code is tampered with.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The authentication check instructs use of `npx agnic@latest status --json`, which still relies on executing the latest package from npm. A supply-chain compromise here is especially sensitive because the command may run in environments containing `AGNIC_TOKEN` or other credentials.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The login/authentication guidance references `npx agnic@latest auth login`, again delegating trust to the current npm package state. Because this path directly handles account authentication, a malicious update could phish credentials, exfiltrate tokens, or alter account setup.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The setup alias command uses `npx agnic@latest`, exposing the agent to unreviewed code execution whenever email alias configuration is performed. Since this skill manages agent identity and mailbox setup, compromise could redirect communications or alter account metadata.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The email address lookup command runs `npx agnic@latest`, creating a supply-chain execution point in a workflow that discloses agent mailbox identity. Even read-oriented commands can be abused by a malicious package to exfiltrate environment data or establish persistence.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The inbox command uses `npx agnic@latest`, so a compromised upstream package could read, modify, or leak email contents processed by the agent. The context makes this more dangerous because mailbox data often contains sensitive user communications and tokens.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The send-email example executes `npx agnic@latest`, enabling arbitrary upstream package changes to affect outbound message handling. An attacker controlling the package could alter recipients, capture message bodies, or send unauthorized email from the agent.

Missing User Warnings

Medium
Confidence
91% confidence
Finding
The skill supports sending and replying to email but does not explicitly warn that message content and recipients will be transmitted to an external email service. In a privacy-sensitive context, users may unknowingly disclose confidential information or assume content stays local to the agent runtime.

Rp1

Medium
Category
MCP Rug Pull
Confidence
96% confidence
Finding
The reply command also depends on `npx agnic@latest`, making message-response workflows subject to supply-chain compromise. Because replies operate on specific message threads, tampering could leak context, inject malicious responses, or impersonate the user to correspondents.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding
npx commands without a version suffix (e.g. @1.0.0) create a rug-pull risk if the upstream server is compromised and publishes a malicious update.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The prerequisites section references `npx agnic@latest status`, which still introduces unpinned third-party code execution before using the skill. In an authenticated email-management context, even prerequisite checks can expose secrets and system context if the package is compromised.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The error-handling guidance instructs `npx agnic@latest auth login`, repeating the same supply-chain risk in a sensitive auth flow. Users encountering errors may run these commands under pressure, making them more likely to execute compromised latest code without review.

Rp1

Medium
Category
MCP Rug Pull
Confidence
95% confidence
Finding
The remediation text for missing email alias calls `npx agnic@latest email setup`, creating another unreviewed runtime dependency. Because this action configures the agent's mailbox identity, exploitation could misconfigure or hijack future communications.

Static analysis

No suspicious patterns detected.