Back to skill

Security audit

Agnic Authenticate Wallet (x402)

Security checks for vulnerabilities and agentic risk

Overview

This wallet-authentication skill is purpose-aligned, but it needs Review because it runs a mutable npm CLI while handling wallet credentials and includes unsafe token guidance.

Install only if you trust the Agnic npm package and publisher, and prefer a pinned reviewed CLI version. Avoid pasting real API tokens into command lines or agent-visible transcripts; use a protected environment variable or secret manager, keep token scopes and spending limits tight, and use logout or token revocation when done.

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

T08 · Insecure Dependencies

Error
Location
SKILL.md:19
Finding
Execution of an Unpinned Third-Party npm Package<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 19-20 **Vulnerability Type**: Supply-chain risk caused by unpinned dependency execution **Risk Level**: High ### Vulnerable Code ```bash npx agnic@latest status --json ``` The same mutable `agnic@latest` package reference is also used by the authentication and logout instructions elsewhere in `SKILL.md`. ### Technical Analysis The skill directs the agent to execute the `latest` release of a third-party npm package through `npx`. If that release is not already available locally, `npx` may download and immediately execute it. The project provides no fixed version, lockfile, package integrity hash, vendored source, or other mechanism that binds execution to the version reviewed during this audit. Consequently, the effective implementation can change without any modification to the audited skill. Compromise of the npm package, its publisher account, or its release process could cause a future invocation to execute attacker-controlled package lifecycle or CLI code under the privileges of the user running the agent. This finding concerns unsafe dependency execution. The audited file itself contains no evidence that the current package release is malicious. ### Attack Path 1. An attacker compromises the npm package publisher, publication credentials, or upstream release process. 2. The attacker publishes a malicious version under the `agnic` package and assigns it the `latest` distribution tag. 3. A user or agent follows the skill and invokes `npx agnic@latest`. 4. `npx` retrieves the mutable release and executes its package or CLI code. 5. The malicious code runs with the invoking user's operating-system privileges and can access resources available to that account. ### Impact Assessment Successful exploitation could permit arbitrary code execution within the invoking user's privilege boundary. Depending on that user's environment and accessible data, the package could read or alter fil ...[truncated 297 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `agnic@latest` with an exact, reviewed package version in every allowed-tool declaration and command example. 2. Install dependencies through a lockfile-backed workflow and enforce npm integrity verification. 3. Review package provenance, publisher identity, repository ownership, and release signatures before permitting execution. 4. Prefer a locally installed, version-controlled CLI dependency over on-demand `npx` downloads. 5. Update versions only through a controlled review process that re-audits changed package code and dependencies. 6. Where supported, disable automatic installation prompts and fail closed when the approved version is unavailable. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:37
Finding
API Token Exposure Through Command-Line Arguments<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 37-40 **Vulnerability Type**: Sensitive credential passed through process arguments **Risk Level**: Medium ### Vulnerable Code ```markdown **Option B -- Inline flag** (one-off commands): ```bash npx agnic@latest --token <your-api-token> status --json ``` ``` ### Technical Analysis The documented inline-token option instructs users to place an API token directly in a command-line argument. After replacing the placeholder with a real credential, the token may be retained in shell history. Depending on the operating system, process configuration, and monitoring environment, command arguments may also be observable through process inspection, audit logs, telemetry, terminal recording, debugging output, or automation logs. An environment variable is also sensitive and must be protected, but it avoids directly embedding the credential in the shell command and its history. A dedicated credential store or protected standard-input mechanism would provide stronger handling where supported. ### Attack Path 1. A user replaces the placeholder with a valid Agnic API token and runs the documented command. 2. The shell records the complete command in history, or local monitoring and process-inspection facilities capture its arguments. 3. Another user, process, administrator, log reader, or attacker with access to the recorded data obtains the token. 4. The attacker reuses the token before it expires or is revoked. 5. The attacker performs operations allowed by the token's configured account permissions and spending limits. ### Impact Assessment Exposure can grant unauthorized access to the Agnic account or wallet functions available to the token. The exact impact depends on server-side token scopes, expiration, revocation controls, and spending limits, none of which are fully specified in the audited file. Potential consequences include disclosure of account information and unauthorized API or wall ...[truncated 144 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the inline `--token` example and discourage command-line transmission of credentials. 2. Prefer secure secret injection through a protected environment, operating-system credential manager, or dedicated secrets-management service. 3. If the CLI supports it, accept secrets through a non-echoing interactive prompt or protected standard input rather than process arguments. 4. Ensure CI systems mask the token and prevent it from appearing in build logs, command traces, diagnostics, or artifacts. 5. Apply minimum required scopes, restrictive spending limits, short expiration periods, and regular token rotation. 6. Document immediate revocation and regeneration procedures for tokens that may have entered shell history or logs. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • 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
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (11)

Rp1

Medium
Category
MCP Rug Pull
Confidence
83% confidence
Finding
This duplicate manifest finding is substantively valid because the allowed tools authorize execution of a moving `@latest` target. In an auth-related skill, dynamic package resolution is more sensitive because the invoked code may process tokens, open browser OAuth flows, and write credentials locally.

Vague Triggers

Medium
Confidence
95% confidence
Finding
The trigger text is broad enough to match many generic authentication or wallet-related requests, which can cause the skill to activate outside a narrowly intended context. Over-broad invocation increases the chance that an agent prompts for tokens, initiates auth flows, or steers users into credential-handling steps when another, safer path would be more appropriate.

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
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
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
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
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
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
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
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.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill recommends `export AGNIC_TOKEN=<your-api-token>` and an inline `--token <your-api-token>` form without warning that secrets may be exposed through shell history, terminal logs, process listings, CI logs, or agent transcripts. Because this skill is specifically about authentication, omission of secret-handling guidance materially raises the chance of credential leakage and account compromise.

Static analysis

No suspicious patterns detected.