Back to skill

Security audit

Agnic Pay for Service

Security checks for vulnerabilities and agentic risk

Overview

The skill is coherent for making paid x402 API calls, but it enables real USDC spending through an unpinned downloaded CLI with incomplete safeguards.

Install only if you are comfortable with a skill that can spend USDC and send request URLs, bodies, headers, and responses to external services. Before use, require an explicit destination URL, payment network, maximum amount, and payload review; prefer environment-based credentials over --token, and avoid using the mutable agnic@latest command unless the package version and execution environment are controlled.

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 (3)

T08 · Insecure Dependencies

Error
Location
SKILL.md:10
Finding

Unpinned Third-Party npm Package Is Downloaded and Executed

Content
View full analysis
[-X ] [-d ] [-q ] [-h ] [--max-amount ] [--json] ``` ```bash npx agnic@latest x402 details npx agnic@latest balance --network base npx agnic@latest x402 pay --json ``` ### Technical Analysis Every command resolves and executes `agnic@latest`. The `latest` tag is mutable, so the effective code executed by the Skill can change after the Skill has been reviewed. The project does not pin an exact package version, provide an integrity hash, include a lockfile, or contain the package source for inspection. If the package, its maintainer account, the npm publishing process, or a transitive dependency is compromised, invoking the Skill can execute attacker-controlled JavaScript with the privileges of the agent process. This is particularly sensitive because the package operates in a context involving authentication credentials, wallet balances, API request contents, and paid blockchain transactions. The network access and payment functionality are necessary for the declared x402 purpose, but dynamically retrieving and executing the newest package release exceeds the minimum privilege and reproducibility needed to provide that functionality. ### Attack Path 1. An attacker compromises the `agnic` npm package, its publisher account, or a transitive dependency. 2. The attacker publishes a malicious version and causes it to resolve through the `latest` tag. 3. A user explicitly invokes the paid-request Skill. 4. `npx agnic@latest` downloads and executes the malicious release. 5. The package runs with the agent proces ...[truncated 910 chars]
Remediation
View remediation
`. 2. Install the dependency through a controlled build process rather than downloading it during each Skill invocation. 3. Commit and enforce a lockfile with package integrity hashes. 4. Review the package and its transitive dependencies before deployment. 5. Use an internal package registry or approved package mirror where practical. 6. Run the CLI in a restricted environment with only the network, filesystem, credentials, and wallet permissions required for the requested operation. 7. Establish a controlled update process that repeats security review before changing the pinned version. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
reference/x402-protocol.md:26
Finding

Incomplete Shell Input Validation Permits Command Injection

Content
View full analysis
[-X ] [-d ] [-q ] [-h ] [--max-amount ] [--json] ``` From `reference/x402-protocol.md`: ```markdown ## Input Validation Before constructing the command, validate all user-provided values: - **url**: Must be a valid HTTPS URL (`^https://[^\s;|&]+$`). Reject URLs containing spaces, semicolons, pipes, or backticks. - **method**: Must be one of GET, POST, PUT, DELETE, PATCH (case-insensitive). - **data**: Must be valid JSON. Parse it first; reject if parsing fails. - **max-amount**: Must be a positive integer (`^\d+$`). Do not pass unvalidated user input into the command. ``` ### Technical Analysis The documented URL regular expression excludes whitespace, semicolons, pipes, and ampersands, but it still permits other shell-significant characters, including dollar signs, parentheses, redirection characters, quotes, and wildcard characters. Consequently, an HTTPS-looking string may pass the documented validation while remaining unsafe if interpolated into a Bash command. Validating that request data is syntactically valid JSON also does not make the data safe for shell interpolation. JSON strings can legally contain quotes, apostrophes, dollar signs, parentheses, and other content that may alter shell parsing when command strings are assembled incorrectly. The declared Bash tool patterns permit arguments after commands such as `x402 pay`. The project provides no implementation that guarantees argument-array execution or context-aware shell escaping. Following the documented command-construction workflow with raw interpolation can therefore cause Bash to evaluate attacker-controlled syntax befor ...[truncated 1521 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
SKILL.md:23
Finding

Authentication Token May Be Exposed Through Command-Line Arguments

Content
View full analysis
` - **Interactive (has browser)**: Run `npx agnic@latest auth login` ``` ### Technical Analysis The Skill explicitly recommends passing an authentication token through the `--token ` command-line option. Command-line arguments may be observable through process inspection facilities, agent execution logs, CI logs, shell history, telemetry, error reports, or retained transcripts. This exposure is avoidable because the same documentation already identifies an environment-based authentication method. Although environment variables also require protection, securely injecting a scoped environment variable or using a credential store avoids placing the secret directly in the process command line. ### Attack Path 1. A user or automated agent follows the documented `--token ` authentication method. 2. The secret is included literally in the generated command line. 3. The command is recorded in shell history, execution logs, CI output, agent transcripts, or process-monitoring data. 4. A local user, log reader, monitoring operator, or party with access to retained transcripts retrieves the token. 5. The exposed token is reused against services that accept it until the credential expires or is revoked. ### Impact Assessment An exposed token may allow an attacker to impersonate the authenticated user within the token's assigned permissions. Depending on the external service's authorization model, this could expose account information, paid API functionality, wallet-related actions, transaction metadata, or other resources authorized to the token. The exact scope cannot be established from the audit ...[truncated 87 chars]
Remediation
View remediation
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 (21)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The skill enables real monetary spend and transmits user-supplied request data to third-party APIs, yet the description and workflow do not prominently warn about those consequences before showing execution steps. In this context, missing upfront disclosure is dangerous because an agent or user may treat the skill like a normal fetch helper rather than a payment action, causing unintended USDC loss, data exfiltration to external services, or both.

Content

No source excerpt is available for this finding.

Rp1

Medium
Category
MCP Rug Pull
Confidence
70% confidence
Finding

MCP server references in the skill manifest without version pinning are a rug-pull risk.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The trigger phrases are broad enough to match common requests like 'call this API' or 'use this service' without clearly signaling that invocation may spend USDC and contact an external endpoint. In an agent environment, this increases the risk of accidental activation of a payment-capable skill on ambiguous user prompts, especially when paired with permissive examples and user-invocable status.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

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.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The reference describes how to make paid HTTP requests and set a maximum USDC amount, but it does not warn that requests can incur real charges or transmit user data to external services. In a payment-capable skill, missing explicit notice and confirmation guidance increases the risk of unintended spending and accidental disclosure of sensitive request contents.

Content

No source excerpt is available for this finding.