Back to skill

Security audit

X402hub

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its marketplace purpose, but it handles wallets, signatures, tokens, and relay messages in ways that could expose secrets or trigger high-impact marketplace actions.

Review this skill carefully before installing. Use it only with a test wallet or a wallet you are prepared to replace, do not paste private keys or relay tokens into command lines or logs, verify api.clawpay.bot and relay endpoints before any signed request, and require manual confirmation for registration, claim, submit, abandon, token, and stake actions.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (4)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/relay-send.cjs:42
Finding
Relay credentials and message contents are transmitted over unauthenticated plaintext TCP<![CDATA[ ## Vulnerability Details **File Location**: `scripts/relay-send.cjs:42-54`; protocol documented at `SKILL.md:139` **Vulnerability Type**: Plaintext transmission of sensitive information **Risk Level**: High ### Complete Code Snippet ```javascript const sock = net.createConnection({ host: HOST, port: PORT }, () => { sock.write(frame({ v: 1, type: 'HELLO', id: `${AGENT}-${Date.now()}`, ts: Date.now(), payload: { agent: AGENT, version: '1.0.0', authToken: TOKEN } })); }); const dec = new Decoder(); sock.on('data', (data) => { for (const f of dec.push(data)) { if (f.type === 'WELCOME') { sock.write(frame({ v: 1, type: 'SEND', id: `m-${Date.now()}`, ts: Date.now(), to: TO, payload: { kind: 'message', body: BODY } })); console.log(JSON.stringify({ ok: true, to: TO, body: BODY })); ``` The corresponding documentation explicitly identifies the transport as TCP: ```markdown **Protocol:** TCP, 4-byte big-endian length prefix + JSON payload (legacy framing) ``` ### Technical Analysis The script uses Node.js `net.createConnection`, which establishes a raw TCP connection without TLS encryption or server authentication. The initial `HELLO` frame contains the relay authentication token, while the subsequent `SEND` frame contains the recipient and message body. Consequently, any party able to observe or alter traffic between the client and relay can read the token and message, modify frames, or impersonate the relay. The destination is also configurable through `--host` and `X402_RELAY_HOST`, so a configuration error or manipulated invocation can send the credential directly to an attacker-controlled server. Network communication is necessary for the declared relay functionality, but transmitting reusable credentials and message contents without transport protection is not the minimum safe privilege required. ### Attack Path 1. A user invokes the relay script with a valid relay token. 2. The script opens a plaintext TCP connec ...[truncated 963 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace `net.createConnection` with `tls.connect`. - Require strict certificate-chain and hostname validation; do not disable `rejectUnauthorized`. - Pin the expected relay hostname or enforce an explicit allowlist of approved relay destinations. - Do not transmit authentication material until the TLS connection and peer identity have been successfully verified. - Prefer short-lived, audience-bound, least-privilege relay tokens. - Add clear failure handling so the script refuses to fall back to plaintext TCP. - If the relay cannot support TLS directly, use a mutually authenticated secure tunnel rather than exposing credentials over raw TCP. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/relay-send.cjs:3
Finding
Relay authentication token can be exposed through command-line arguments<![CDATA[ ## Vulnerability Details **File Location**: `scripts/relay-send.cjs:3-13`; usage documented at `SKILL.md:211-217` **Vulnerability Type**: Sensitive credential exposure through process arguments **Risk Level**: High ### Complete Code Snippet ```javascript // Usage: node relay-send.cjs --host <host> --port <port> --agent <name> --token <token> --to <target> --body "message" const net = require('net'); const args = process.argv.slice(2); const opts = {}; for (let i = 0; i < args.length; i += 2) opts[args[i].replace(/^--/, '')] = args[i + 1]; const HOST = opts.host || process.env.X402_RELAY_HOST || 'trolley.proxy.rlwy.net'; const PORT = parseInt(opts.port || process.env.X402_RELAY_PORT || '48582'); const AGENT = opts.agent || 'agent'; const TOKEN = opts.token || process.env.X402_RELAY_TOKEN || ''; ``` The documented invocation encourages the unsafe argument form: ```bash node scripts/relay-send.cjs \ --host trolley.proxy.rlwy.net --port 48582 \ --agent my-agent --token <relay-token> \ --to target-agent --body "Task complete" ``` ### Technical Analysis The script accepts a relay authentication token through the `--token` command-line argument. Command-line arguments are commonly observable through process-inspection facilities, shell history, job-control interfaces, audit systems, CI logs, and automation telemetry. Although an environment-variable alternative exists, the command-line argument takes precedence and is the method promoted in the documentation. Environment variables can also leak in some execution environments, but they are generally less exposed than process arguments. A protected secret store, restricted descriptor, or standard input is safer. ### Attack Path 1. A user follows the documented command and places a valid token after `--token`. 2. The shell may record the complete command in its history. 3. While the process is running, a local user or monitoring process reads its command-line arguments. 4. Alternatively, a CI/C ...[truncated 582 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Remove support for `--token` and remove it from all examples. - Read the token from a protected secret manager, operating-system credential store, or permission-restricted file. - For interactive use, accept the token through hidden standard-input prompting rather than an echoed argument. - If an environment variable must be supported, document its exposure limitations and avoid logging the environment. - Issue short-lived, narrowly scoped, revocable tokens. - Validate that a nonempty token is present before connecting, and avoid including it in exceptions or diagnostic output. - Rotate any token previously used in shell commands or exposed automation logs. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:18
Finding
Wallet generation example prints the private key to standard output<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:18-25` **Vulnerability Type**: Cryptocurrency private-key disclosure **Risk Level**: Critical ### Complete Code Snippet ```javascript const { ethers } = require('ethers'); const wallet = ethers.Wallet.createRandom(); console.log('Address:', wallet.address); console.log('Private Key:', wallet.privateKey); // Store your private key securely — x402hub never sees it ``` ### Technical Analysis The documented wallet-generation flow prints the newly generated private key directly to standard output. Standard output may be captured by terminal logging, agent transcripts, CI systems, remote execution platforms, screen-sharing software, or centralized log collectors. A private key is a complete authorization secret rather than ordinary diagnostic information. Anyone obtaining it can generate valid signatures and control the wallet. The instruction to store the key securely does not mitigate the disclosure that has already occurred through output. ### Attack Path 1. A user executes the documented wallet-generation example. 2. The private key is printed in plaintext to the terminal. 3. Terminal output is retained in an agent transcript, CI log, remote session log, or other output-capture system. 4. An attacker or unauthorized log reader retrieves the private key. 5. The attacker imports the key into a wallet. 6. The attacker signs marketplace messages or blockchain transactions as the victim and transfers any assets controlled by the wallet. ### Impact Assessment Possession of the private key grants complete control over the generated wallet. The attacker can impersonate the agent, produce valid wallet signatures, take over wallet-backed marketplace actions, and transfer blockchain assets. The compromise remains effective until assets and identities are migrated to a new key; conventional password resets cannot revoke a blockchain private key. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Never print or log raw private keys. - Generate the wallet directly into an encrypted keystore or established wallet application. - Display only the public wallet address. - If backup material must be presented interactively, use a dedicated secure workflow that prevents routine logging and clearly warns the user about screen capture and transcript retention. - Protect stored wallet material with strong encryption and restrictive filesystem permissions. - Prefer hardware-backed keys or operating-system secure storage for valuable identities. - Treat any private key previously printed into retained logs as compromised, migrate assets and identity to a new wallet, and securely delete accessible copies where possible. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/relay-send.cjs:50
Finding
Full relay message bodies are unnecessarily written to standard output<![CDATA[ ## Vulnerability Details **File Location**: `scripts/relay-send.cjs:50-55` **Vulnerability Type**: Sensitive message disclosure through logging **Risk Level**: Medium ### Complete Code Snippet ```javascript for (const f of dec.push(data)) { if (f.type === 'WELCOME') { sock.write(frame({ v: 1, type: 'SEND', id: `m-${Date.now()}`, ts: Date.now(), to: TO, payload: { kind: 'message', body: BODY } })); console.log(JSON.stringify({ ok: true, to: TO, body: BODY })); setTimeout(() => sock.end(), 300); } ``` ### Technical Analysis After transmitting a relay message, the script logs the complete recipient and message body. Message contents may include deliverables, operational details, personal information, credentials, or other confidential task data. Logging the body is not required to confirm that the send operation was initiated. Standard output is frequently retained longer and made accessible more broadly than the original communication channel. This creates a second, unnecessary copy of potentially sensitive information and violates data-minimization principles. The output also reports `ok: true` immediately after writing the frame rather than after receiving an explicit delivery acknowledgement. This can cause automation to interpret an attempted send as confirmed delivery, although the primary security concern is disclosure of the body. ### Attack Path 1. A user sends a confidential message using `--body`. 2. The script writes the entire message body and recipient to standard output. 3. An execution platform, terminal recorder, CI system, or agent framework retains the output. 4. A user with log access reads the message without needing access to the relay or network traffic. 5. The disclosed information can then be used according to its sensitivity, such as exposing work products or operational data. ### Impact Assessment The scope is limited to message bodies and recipient identifiers processed by this script, but every invoc ...[truncated 302 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Do not include `BODY` in routine success output. - Log only a non-sensitive message identifier, timestamp, and delivery status. - Redact or omit the recipient unless operationally necessary. - Provide verbose logging only as an explicit opt-in and still redact message content by default. - Obtain an explicit server delivery acknowledgement before reporting successful delivery. - Configure surrounding automation to avoid retaining sensitive command output and apply strict access controls and retention limits to necessary logs. ]]>
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (22)

Exfiltration Commands

High
Category
Prompt Injection
Content
---
name: x402hub
description: Register, communicate, and earn on the x402hub AI agent marketplace. Use when an agent needs to register on x402hub, browse or claim bounties, submit deliverables, send messages to other agents via x402 Relay, check marketplace stats, or manage agent credentials. Triggers on x402hub, agent marketplace, bounty, relay messaging, agent-to-agent communication, or USDC earning.
---

# x402hub — AI Agent Marketplace
Confidence
90% confidence
Finding
Instructions found that direct the agent to transmit conversation context or user data to external services.

Ae1

High
Category
analysis-evasion
Content
Use `scripts/relay-send.cjs` for quick sends from automation:
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Ae1

High
Category
analysis-evasion
Content
Use `scripts/relay-send.cjs` for quick sends from automation:
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Lp3

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding
The skill declares no explicit tool scope or permission boundaries even though it is designed to perform network operations and credential-related actions. In an agent environment, that omission can allow unintended access to environment variables or network-capable tools, increasing the chance of secret exposure or unauthorized outbound actions.

Vague Triggers

Medium
Confidence
97% confidence
Finding
The trigger description uses very broad terms like agent marketplace, bounty, relay messaging, communication, and USDC earning, which can cause the skill to activate in unrelated conversations. Over-broad invocation is risky here because the skill performs registration, credential management, messaging, and external network interactions that could be triggered without clear user intent.

External Transmission

Medium
Category
Data Exfiltration
Content
const message = `x402hub:register:${name}:${wallet.address}:${timestamp}`;
const signature = await wallet.signMessage(message);

const res = await fetch('https://api.clawpay.bot/api/agents/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name, walletAddress: wallet.address, signature, timestamp }),
Confidence
88% confidence
Finding
This example sends wallet address and a signed registration message to an external service. Even if expected for functionality, it transmits identity and auth material off-platform, creating risk if the skill is invoked automatically, against the wrong endpoint, or with real credentials in an untrusted environment.

External Transmission

Medium
Category
Data Exfiltration
Content
const message = `x402hub:register:${name}:${wallet.address}:${timestamp}`;
const signature = await wallet.signMessage(message);

const res = await fetch('https://api.clawpay.bot/api/agents/register', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({ name, walletAddress: wallet.address, signature, timestamp }),
Confidence
88% confidence
Finding
This example sends wallet address and a signed registration message to an external service. Even if expected for functionality, it transmits identity and auth material off-platform, creating risk if the skill is invoked automatically, against the wrong endpoint, or with real credentials in an untrusted environment.

External Transmission

Medium
Category
Data Exfiltration
Content
### 3. Verify registration

```bash
curl -s https://api.clawpay.bot/api/agents | jq '.agents[] | select(.name=="my-agent")'
```

### Alternative: Managed registration (legacy)
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
### 3. Verify registration

```bash
curl -s https://api.clawpay.bot/api/agents | jq '.agents[] | select(.name=="my-agent")'
```

### Alternative: Managed registration (legacy)
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
### 3. Verify registration

```bash
curl -s https://api.clawpay.bot/api/agents | jq '.agents[] | select(.name=="my-agent")'
```

### Alternative: Managed registration (legacy)
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
### 3. Verify registration

```bash
curl -s https://api.clawpay.bot/api/agents | jq '.agents[] | select(.name=="my-agent")'
```

### Alternative: Managed registration (legacy)
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
### 3. Verify registration

```bash
curl -s https://api.clawpay.bot/api/agents | jq '.agents[] | select(.name=="my-agent")'
```

### Alternative: Managed registration (legacy)
Confidence
50% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
If you don't want to manage your own wallet:

```bash
curl -X POST https://api.clawpay.bot/api/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "my-agent"}'
```
Confidence
84% confidence
Finding
The managed registration flow posts to an external service that creates and returns wallet-related onboarding data server-side. This increases custodial and data-handling risk because users may rely on a remote service for key generation or claim material, which is sensitive in a credential-management skill.

External Transmission

Medium
Category
Data Exfiltration
Content
If you don't want to manage your own wallet:

```bash
curl -X POST https://api.clawpay.bot/api/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "my-agent"}'
```
Confidence
84% confidence
Finding
The managed registration flow posts to an external service that creates and returns wallet-related onboarding data server-side. This increases custodial and data-handling risk because users may rely on a remote service for key generation or claim material, which is sensitive in a credential-management skill.

External Transmission

Medium
Category
Data Exfiltration
Content
### Claim a Run

```bash
curl -X POST 'https://api.clawpay.bot/api/runs/<run-id>/claim' \
  -H "Content-Type: application/json" \
  -d '{"agentId": <your-agent-id>, "walletAddress": "<your-wallet>"}'
```
Confidence
83% confidence
Finding
Claiming a run sends agent identity and wallet address to an external API and may change marketplace state. In context, the skill can cause financial or reputational consequences by claiming work on behalf of an agent if activated unintentionally or without a clear approval step.

External Transmission

Medium
Category
Data Exfiltration
Content
### Claim a Run

```bash
curl -X POST 'https://api.clawpay.bot/api/runs/<run-id>/claim' \
  -H "Content-Type: application/json" \
  -d '{"agentId": <your-agent-id>, "walletAddress": "<your-wallet>"}'
```
Confidence
83% confidence
Finding
Claiming a run sends agent identity and wallet address to an external API and may change marketplace state. In context, the skill can cause financial or reputational consequences by claiming work on behalf of an agent if activated unintentionally or without a clear approval step.

External Transmission

Medium
Category
Data Exfiltration
Content
MESSAGE="x402hub:submit:<run-id>:<ipfs-hash>"
# Sign MESSAGE with your agent wallet to get SIGNATURE

curl -X POST 'https://api.clawpay.bot/api/runs/<run-id>/submit' \
  -H "Content-Type: application/json" \
  -d '{"deliverableHash": "<ipfs-hash>", "signature": "<wallet-signature>", "message": "<signed-message>"}'
```
Confidence
91% confidence
Finding
Submitting a deliverable sends a wallet signature plus deliverable hash to an external endpoint, creating a signed state-changing action. In a skill that may be auto-invoked, this is dangerous because it can finalize work submissions or leak linkage between agent identity and deliverable artifacts without sufficient human review.

External Transmission

Medium
Category
Data Exfiltration
Content
MESSAGE="x402hub:abandon:<run-id>"
# Sign MESSAGE with your agent wallet

curl -X POST 'https://api.clawpay.bot/api/runs/<run-id>/abandon' \
  -H "Content-Type: application/json" \
  -d '{"signature": "<wallet-signature>", "message": "<signed-message>"}'
```
Confidence
89% confidence
Finding
The abandon endpoint performs a signed state change that can forfeit an agent's claim on a run. This is operationally sensitive because accidental or malicious invocation could cause loss of opportunity, workflow disruption, or reputation damage.

External Transmission

Medium
Category
Data Exfiltration
Content
MESSAGE="x402hub:relay-token:<agentId>:$TIMESTAMP"
# Sign MESSAGE with your agent wallet

curl -X POST https://api.clawpay.bot/api/relay/token \
  -H "Content-Type: application/json" \
  -d '{"agentId": <your-agent-id>, "timestamp": '$TIMESTAMP', "signature": "<wallet-signature>"}'
```
Confidence
92% confidence
Finding
Obtaining a relay token requires a wallet-signed request to an external API and yields an authentication token for subsequent messaging access. This is sensitive because a leaked or mishandled token could permit unauthorized relay use, impersonation, or access to queued messages.

External Transmission

Medium
Category
Data Exfiltration
Content
Stake endpoint exists for when staking is re-enabled:
```bash
# Check stake status
curl -s https://api.clawpay.bot/api/agents/<id>/stake

# Record a stake (send USDC to treasury first, then submit tx hash)
curl -X POST https://api.clawpay.bot/api/agents/<id>/stake \
Confidence
89% confidence
Finding
The stake flow references sending USDC to a treasury and then posting transaction details to an external API. Because this touches asset transfer and wallet-linked records, misuse could lead to irreversible financial loss or fraudulent stake recording attempts if an agent performs it without careful validation.

External Transmission

Medium
Category
Data Exfiltration
Content
Stake endpoint exists for when staking is re-enabled:
```bash
# Check stake status
curl -s https://api.clawpay.bot/api/agents/<id>/stake

# Record a stake (send USDC to treasury first, then submit tx hash)
curl -X POST https://api.clawpay.bot/api/agents/<id>/stake \
Confidence
89% confidence
Finding
The stake flow references sending USDC to a treasury and then posting transaction details to an external API. Because this touches asset transfer and wallet-linked records, misuse could lead to irreversible financial loss or fraudulent stake recording attempts if an agent performs it without careful validation.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -s https://api.clawpay.bot/api/agents/<id>/stake

# Record a stake (send USDC to treasury first, then submit tx hash)
curl -X POST https://api.clawpay.bot/api/agents/<id>/stake \
  -H "Content-Type: application/json" \
  -d '{"amount": "20000000", "txHash": "0x...", "walletAddress": "0x..."}'
```
Confidence
88% confidence
Finding
Posting stake amount, transaction hash, and wallet address to an external endpoint is tied to financial activity and identity. Incorrect automation or use of an unverified treasury/workflow could cause monetary loss, false accounting, or exposure of wallet-linked transaction history.

Static analysis

No suspicious patterns detected.