Back to skill

Security audit

Agnic Check Balance

Security checks for vulnerabilities and agentic risk

Overview

This balance-checking skill is coherent, but it runs an unpinned external npm CLI in a wallet-related workflow and may reveal financial metadata through broad triggers.

Review this carefully before installing. It appears intended only to check USDC balances, but it depends on live execution of the latest `agnic` npm package and may use or expose wallet-related tokens, addresses, and balances. Prefer a version-pinned, reviewed CLI and avoid invoking it from vague balance requests or shared/logged environments.

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

Error
Location
SKILL.md:9
Finding

Unpinned npm Package Is Downloaded and Executed at Runtime

Content
View full analysis

Vulnerability Details

File Location: SKILL.md, lines 9–11; additional occurrences at lines 16, 19, 29, 50, and 53
Vulnerability Type: Runtime execution of an unpinned third-party dependency
Risk Level: High

Vulnerable Code

yaml
allowed-tools:
  - "Bash(npx agnic@latest status*)"
  - "Bash(npx agnic@latest balance*)"

The same unsafe package reference is used throughout the Skill:

bash
npx agnic@latest balance
npx agnic@latest status --json
npx agnic@latest balance [--network <network>] [--json]
npx agnic@latest balance --json
npx agnic@latest balance --network base --json

Technical Analysis

The Skill instructs the Agent to execute agnic@latest through npx. Unless already available in a suitable local cache, npx can retrieve the current package release from the npm registry and execute its package entry point. The latest tag is mutable and does not identify a specific, previously reviewed artifact.

Consequently, the code executed by this Skill can change after the Skill itself has been audited. The project contains no lockfile, exact package version, integrity hash, vendored implementation, or other mechanism that establishes which agnic package contents will run.

This creates a supply-chain trust boundary in which compromise of the npm publisher account, registry distribution path, package repository, or a future release can turn an apparently read-only balance operation into arbitrary code execution. Because npm package lifecycle behavior and executable entry points run under the invoking user's context, malicious package code would inherit the Agent process's available permissions.

Attack Path

  1. An attacker compromises the agnic npm publisher, its release pipeline, or another component capable of updating the package's latest distribution tag.
  2. The attacker publishes a malicious release and assigns it to latest.
  3. A user asks the Agen ...[truncated 1520 chars]
Remediation
View remediation

Remediation Suggestions

  1. Replace agnic@latest with an exact, reviewed version, for example agnic@1.2.3. Do not use mutable npm tags or version ranges for executable dependencies.
  2. Install dependencies through a committed lockfile and use a reproducible installation command such as npm ci.
  3. Verify npm integrity metadata and provenance in the deployment pipeline. Record the reviewed package version and artifact hash.
  4. Prefer a locally installed, locked executable over runtime package retrieval. Configure the allowed command to invoke that local binary.
  5. Review the package source, executable entry point, lifecycle scripts, transitive dependencies, ownership history, and release process before approval.
  6. Disable or restrict npm lifecycle scripts where operationally possible.
  7. Run the command in a sandbox with minimal filesystem and network access. Expose only the credentials needed for the requested balance operation.
  8. Do not place authentication tokens directly in command-line arguments, because they may appear in process listings or shell history. Supply them through a protected credential mechanism or narrowly scoped environment injection.
  9. Use a short-lived, least-privileged token and prevent the balance command from inheriting unrelated secrets.
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (12)

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The manifest also authorizes Bash(npx agnic@latest balance*), exposing the same supply-chain risk on the main balance-check path. Since this tool can be invoked automatically by the agent, a malicious package update could execute without additional scrutiny and access sensitive environment data.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The trigger phrases are broad and overlap with common conversational requests such as 'check my balance' or 'how much do I have', increasing the chance of accidental invocation. In this skill, accidental activation can expose wallet balances and addresses or prompt execution of the external CLI when the user may not have intended a wallet operation.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The skill executes npx agnic@latest, which pulls and runs whatever package version is current at invocation time. Using @latest in a security-sensitive wallet skill creates a supply-chain risk: a compromised upstream release or dependency could execute arbitrary code in the agent environment and access wallet tokens, balance data, or other local secrets.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

This command again relies on npx agnic@latest, causing runtime installation/execution of an unpinned package. In a wallet-related workflow, that can let a malicious or compromised package exfiltrate authentication material such as AGNIC_TOKEN or manipulate returned balance data.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
98% confidence
Finding

The unpinned npx agnic@latest reference permits silent changes in behavior whenever the package updates. Because the skill explicitly handles authentication checks, a malicious update could harvest credentials or tokens while appearing to perform normal status verification.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill retrieves and displays sensitive financial metadata, including balances and wallet addresses, but provides no warning or consent language about exposing that information. In shared terminals, logs, agent transcripts, or multi-tenant environments, this can leak financial holdings and addresses even if no funds are moved.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

Documenting npx agnic@latest balance as the standard invocation normalizes executing unreviewed upstream code in a finance-adjacent context. This is dangerous because the tool can read environment variables, make network requests, and return forged output that influences user decisions.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

Another unpinned runtime package execution appears in the command syntax section. Repetition increases the likelihood that downstream agents or operators will execute the package exactly as written, propagating supply-chain exposure across all balance checks.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

The examples section includes npx agnic@latest, which is a direct operational instruction to fetch and run mutable code from the registry. In a wallet balance skill, compromise of that package could expose financial metadata and authentication state or pivot to broader system compromise.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

This example invocation also uses an unpinned package and therefore inherits the same supply-chain execution risk. Since the skill may be triggered by ordinary balance-check requests, the exposure could occur frequently and without users realizing executable code is being freshly resolved from upstream.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

Another example uses @latest, allowing arbitrary future package changes to affect execution. In a financial context, even a brief compromise window could leak wallet addresses, balances, tokens, or tamper with displayed results.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
97% confidence
Finding

The error-handling guidance tells users to run npx agnic@latest auth login, again invoking mutable upstream code during an authentication flow. Authentication paths are especially sensitive because a compromised package can directly capture login material or persistent tokens.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.