Back to skill

Security audit

X402 Cfo

Security checks for vulnerabilities and agentic risk

Overview

This skill is coherent for paid x402 API use, but it delegates wallet-based payment authority with broad defaults and an unpinned dependency, so it should be reviewed carefully before installation.

Review this before installing. Use only a pinned and audited x402-cfo version, prefer npm ci with a committed lockfile, restrict the wallet or session key to small limits and approved recipients, add an explicit destination allowlist, and require confirmation before first payment to any new endpoint. Also decide whether ./x402-cfo-ledger.json is acceptable in the project because it records payment audit details.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (2)

T08 · Insecure Dependencies

Error
Location
skill.md:16
Finding

Unpinned Third-Party Package Installation

Content
View full analysis
/dev/null || npm install x402-cfo ``` ``` ### Technical Analysis The setup instruction installs `x402-cfo` without specifying an exact version or verifying package integrity. Consequently, installation resolves to whatever version the configured npm registry currently serves. The package's source code, lifecycle scripts, and runtime behavior are not included in the audited project. This dependency is especially sensitive because it receives a payment-capable wallet and mediates paid network requests. A compromised package release, registry account, registry configuration, or dependency chain could execute arbitrary JavaScript during installation or runtime. Redirecting `npm list` diagnostics to `/dev/null` also reduces visibility into errors that could indicate an unexpected local dependency state. The documented payment functionality legitimately requires an implementation dependency, but installing an unpinned and unaudited version is not necessary to provide that functionality. ### Attack Path 1. An attacker compromises the `x402-cfo` package, one of its transitive dependencies, its publisher account, or the configured npm registry. 2. The attacker publishes or serves a modified version containing a malicious lifecycle script or runtime payload. 3. The Agent follows the Skill setup instructions and runs `npm install x402-cfo`. 4. npm resolves and installs the attacker-controlled release because no exact version or integrity value is specified. 5. The malicious code executes with the permissions of the Agent process. 6. During initialization, the package may also gain access to the supplied wallet object and use or disclose its p ...[truncated 470 chars]
Remediation
View remediation
``` 2. Commit and enforce a lockfile with verified registry integrity hashes. Use `npm ci` in controlled environments instead of dynamically resolving dependencies. 3. Audit the selected package version, its transitive dependencies, and all npm lifecycle scripts before deployment. 4. Use a trusted, explicitly configured package registry and enable package provenance verification where supported. 5. Disable lifecycle scripts during installation when they are unnecessary: ```bash npm ci --ignore-scripts ``` 6. Run the dependency in a sandbox with minimal filesystem, environment-variable, wallet, and network permissions. 7. Do not suppress dependency-check errors. Surface and handle installation failures explicitly. ]]>

T05 · Unauthorized Access and Privilege Escalation

Error
Location
skill.md:29
Finding

Broad Wallet Delegation Without a Default Destination Allowlist

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (3)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill instructs agents to use cfo.fetch() for paid endpoints and configures persistent ledger storage, but it does not clearly warn that this can trigger real monetary transactions and write an audit file to disk. In an autonomous-agent context, missing consent and side-effect disclosure is dangerous because users may unknowingly authorize spending and persistent logging.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · skill.md (reported line 55)May include surrounding context.

ALWAYS use cfo.fetch() instead of raw fetch() for any x402 endpoint:

typescript
const response = await cfo.fetch('https://api.paid-service.com/v1/data');

The CFO will automatically:

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · skill.md (reported line 70)May include surrounding context.

ALWAYS use cfo.fetch() instead of raw fetch() for any x402 endpoint:

typescript
const response = await cfo.fetch('https://api.paid-service.com/v1/data');

The CFO will automatically: