Back to skill

Security audit

Ordiscan

Security checks for vulnerabilities and agentic risk

Overview

The skill is clearly for Ordiscan x402 payments, but it asks agents to handle raw wallet keys and sign USDC transfer authorizations without enough local validation or spending controls.

Review carefully before installing. Only use this with a dedicated low-balance wallet, verify every payment amount and recipient out of band, avoid exposing a primary private key through X402_PRIVATE_KEY or ~/.evm-wallet.json, and prefer pinned, reviewed dependencies or a wallet flow that enforces a hard maximum spend.

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)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/x402-sign.mjs:76
Finding
Untrusted Payment Headers Can Authorize Arbitrary USDC Transfers<![CDATA[ ## Vulnerability Details **File Location**: `scripts/x402-sign.mjs`, lines 76-157 **Vulnerability Type**: Insufficient validation of payment authorization data **Risk Level**: High ### Vulnerable Code ```js // Decode the Payment-Required header (x402 v2) const headerJson = Buffer.from(base64Header, "base64").toString("utf-8"); const paymentRequired = JSON.parse(headerJson); const accept = paymentRequired.accepts?.[0]; if (!accept) { log("Error: No payment options in Payment-Required header."); process.exit(1); } const amount = BigInt(accept.amount); const amountUsdc = Number(amount) / 10 ** USDC_DECIMALS; log(`Signing payment of $${amountUsdc.toFixed(2)} USDC`); log(` From: ${account.address}`); log(` To: ${accept.payTo}`); // Check balance const publicClient = createPublicClient({ chain: base, transport: http(rpcUrl), }); const balance = await publicClient.readContract({ address: USDC_ADDRESS, abi: BALANCE_OF_ABI, functionName: "balanceOf", args: [account.address], }); if (balance < amount) { const balanceUsdc = Number(balance) / 10 ** USDC_DECIMALS; log( `Error: Insufficient USDC balance. Have $${balanceUsdc.toFixed(2)}, need $${amountUsdc.toFixed(2)}` ); process.exit(1); } // Generate nonce and validity window const nonce = keccak256( concat([ pad(toHex(Date.now())), encodePacked(["address"], [account.address]), ]) ); const validAfter = 0n; const validBefore = BigInt(Math.floor(Date.now() / 1000) + 3600); // Sign EIP-3009 TransferWithAuthorization const walletClient = createWalletClient({ account, chain: base, transport: http(rpcUrl), }); const signature = await walletClient.signTypedData({ domain: USDC_DOMAIN, types: TRANSFER_WITH_AUTHORIZATION_TYPES, primaryType: "TransferWithAuthorization", message: { from: account.address, to: accept.payTo, value: amount, validAfter, validBefore, nonce, }, }); ``` ### Technical Analysis The signing command decodes a ...[truncated 2042 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Validate `x402Version`, payment scheme, network, and asset against strict constants before signing. 2. Require the resource URL to use HTTPS and match an explicit Ordiscan hostname and expected API path. 3. Validate `payTo` against a trusted recipient obtained through authenticated configuration or documented service metadata. 4. Require an explicit maximum amount supplied independently of the payment header, and reject payments above it. 5. Bind the payment response to the original method, URL, and request body so a header cannot be reused for a different operation. 6. Present the verified recipient, amount, asset, network, resource, and expiration to the user and require confirmation before signing. 7. Reject malformed, duplicated, unsupported, or ambiguous payment options rather than automatically selecting the first entry. 8. Prefer a maintained x402 validation library where available, while retaining local policy checks around origin and spending limits. ]]>

T08 · Insecure Dependencies

Warning
Location
package.json:6
Finding
Unpinned Dependencies and Runtime Package Execution Create Supply-Chain Risk<![CDATA[ ## Vulnerability Details **File Location**: `package.json`, line 6; `SKILL.md`, lines 34, 49, and 94-95 **Vulnerability Type**: Mutable and unpinned third-party dependency execution **Risk Level**: Medium ### Vulnerable Code `package.json`: ```json { "name": "ordiscan-skill", "private": true, "type": "module", "dependencies": { "viem": "^2.0.0" } } ``` `SKILL.md`: ```bash # Install dependencies (only once) npm install --prefix <skill-dir> ``` ```bash # Check if awal is already available and authenticated which awal && npx awal status ``` ```bash npx awal x402 pay "https://api.ordiscan.com/v1/inscription/0" ``` ### Technical Analysis The project declares `viem` using the broad semver range `^2.0.0` and does not include an audited lockfile. Following the documented `npm install` command can consequently resolve a newer package graph than the one originally reviewed. The instructions also execute `npx awal` without an exact version or a restriction such as `--no-install`. Depending on the local npm/npx behavior and whether the package is already installed, this may download and execute mutable package content from the configured registry. This is particularly sensitive because the resulting packages run in a workflow that has access to wallet credentials, payment data, and the user's local environment. ### Attack Path 1. A user follows the documented setup or alternative-wallet instructions. 2. `npm install` resolves `viem` and transitive dependencies using mutable semver and registry metadata because no lockfile fixes the dependency graph. 3. Alternatively, `npx awal` downloads a package when a trusted local executable is unavailable. 4. A compromised maintainer release, registry account, dependency, or substituted registry response supplies malicious package content. 5. Package installation hooks or the invoked CLI execute locally under the user's account. 6. The malicious code can inspect environment variables and local files ...[truncated 497 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin direct dependencies to exact reviewed versions instead of broad semver ranges. 2. Commit a lockfile containing the complete resolved dependency graph and integrity hashes. 3. Document and use `npm ci` rather than `npm install` for reproducible installation. 4. Install `awal` as an explicitly pinned, reviewed dependency and execute its local binary. 5. If `npx` remains necessary, specify an exact version and use controls that prevent unexpected package installation. 6. Use a trusted registry configuration and consider signature, provenance, or integrity verification. 7. Disable dependency lifecycle scripts where they are unnecessary and compatible with the selected packages. 8. Keep wallet secrets out of the environment during dependency installation, and expose them only to the minimal reviewed signing process. ]]>

T09 · Insecure Skill Coding Practices

Note
Location
SKILL.md:62
Finding
Predictable Shared Temporary File Permits Symlink and Collision Attacks<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 62-63 and 199-200 **Vulnerability Type**: Unsafe temporary-file handling **Risk Level**: Low ### Vulnerable Code ```bash HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \ -X POST -H "Content-Type: application/json" \ -d "$BODY" \ "https://api.ordiscan.com/v1/inscribe") ``` The same fixed path is used in the worked example: ```bash HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \ -X POST -H "Content-Type: application/json" \ -d "$BODY" \ "https://api.ordiscan.com/v1/inscribe") ``` ### Technical Analysis The documented commands write HTTP response data to the fixed path `/tmp/x402_body.json`. Shared temporary directories are commonly writable by multiple local users. A predictable filename permits another process or local user to create that path first, including as a symbolic link to another file. The command does not create the file exclusively, check its ownership or type, set restrictive permissions, or remove it safely after use. Concurrent invocations can also overwrite one another's response data. ### Attack Path 1. A local attacker predicts that the victim will run the documented Ordiscan command. 2. The attacker creates `/tmp/x402_body.json` before the victim, potentially as a symbolic link to a file writable by the victim. 3. The victim runs the `curl` command from `SKILL.md`. 4. `curl` opens the fixed output path and may follow the attacker-created symbolic link. 5. The HTTP response overwrites or modifies the linked target file. 6. Alternatively, another process can read or replace response data stored at the predictable path, causing disclosure or confusion during price verification. ### Impact Assessment The issue can permit overwrite of files writable by the victim, disclosure of payment-response metadata, or interference between concurrent requests. It does not by itself grant higher privileges; the affected ...[truncated 89 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create a unique temporary file with `mktemp` rather than using a fixed name. 2. Set a restrictive umask before creating files containing response or payment metadata. 3. Register a shell trap to remove the temporary file on normal exit and interruption. 4. Quote the generated path consistently. 5. Ensure file creation is exclusive and reject pre-existing paths or symbolic links. 6. A hardened example is: ```bash umask 077 X402_BODY=$(mktemp "${TMPDIR:-/tmp}/x402_body.XXXXXX") || exit 1 trap 'rm -f "$X402_BODY"' EXIT HEADER=$(curl --fail-with-body -sS \ -o "$X402_BODY" \ -w '%header{Payment-Required}' \ -X POST \ -H "Content-Type: application/json" \ -d "$BODY" \ "https://api.ordiscan.com/v1/inscribe") ``` ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Credential Access

High
Category
Privilege Escalation
Content
Requires `node` and the `X402_PRIVATE_KEY` environment variable (an Ethereum private key with USDC on Base).

If `X402_PRIVATE_KEY` is not already set, check if `~/.evm-wallet.json` exists (created by the `evm-wallet` skill). If it does, read the private key from it:

```bash
X402_PRIVATE_KEY=$(node -e "console.log(JSON.parse(require('fs').readFileSync(require('os').homedir()+'/.evm-wallet.json','utf8')).privateKey)")
Confidence
95% confidence
Finding
The skill instructs the agent to read an Ethereum private key from `X402_PRIVATE_KEY` or `~/.evm-wallet.json`, exposing highly sensitive signing material to the skill execution environment. Even if the key is intended only for local signing, expanding skill access to raw private keys materially increases the risk of theft, misuse, or accidental disclosure through logs, subprocesses, or compromise of related tooling.

Lp3

Medium
Category
MCP Least Privilege
Confidence
83% confidence
Finding
The skill uses sensitive capabilities, including reading environment variables and a wallet file containing a private key, but does not declare a restrictive tool scope. This weakens containment and makes it harder for a host/runtime to enforce least privilege around credential access and command execution.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
Using `npx awal` without a pinned version allows whatever package version is currently resolved to be fetched and executed. This creates a supply-chain risk where a compromised or unexpected upstream release could execute arbitrary code in the agent environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
Using `npx awal` without a pinned version allows whatever package version is currently resolved to be fetched and executed. This creates a supply-chain risk where a compromised or unexpected upstream release could execute arbitrary code in the agent environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
Using `npx awal` without a pinned version allows whatever package version is currently resolved to be fetched and executed. This creates a supply-chain risk where a compromised or unexpected upstream release could execute arbitrary code in the agent environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
Using `npx awal` without a pinned version allows whatever package version is currently resolved to be fetched and executed. This creates a supply-chain risk where a compromised or unexpected upstream release could execute arbitrary code in the agent environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
Using `npx awal` without a pinned version allows whatever package version is currently resolved to be fetched and executed. This creates a supply-chain risk where a compromised or unexpected upstream release could execute arbitrary code in the agent environment.

Rp1

Medium
Category
MCP Rug Pull
Confidence
89% confidence
Finding
Using `npx awal` without a pinned version allows whatever package version is currently resolved to be fetched and executed. This creates a supply-chain risk where a compromised or unexpected upstream release could execute arbitrary code in the agent environment.

External Transmission

Medium
Category
Data Exfiltration
Content
CONTENT=$(echo -n "Hello from OpenClaw!" | base64)
BODY="{\"contentType\":\"text/plain\",\"base64_content\":\"$CONTENT\",\"recipientAddress\":\"bc1p...\"}"

HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
Confidence
60% 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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
```

Check the price before paying:
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
BODY="{\"contentType\":\"text/plain\",\"base64_content\":\"$CONTENT\",\"recipientAddress\":\"bc1p...\"}"

# Step 1: Get price and payment header
HEADER=$(curl -s -o /tmp/x402_body.json -w '%header{Payment-Required}' \
  -X POST -H "Content-Type: application/json" \
  -d "$BODY" \
  "https://api.ordiscan.com/v1/inscribe")
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Unpinned Dependencies

Low
Category
Supply Chain
Content
"private": true,
  "type": "module",
  "dependencies": {
    "viem": "^2.0.0"
  }
}
Confidence
95% confidence
Finding
The dependency version for viem is specified with a caret range (^2.0.0), which permits automatic installation of newer minor and patch releases. This can introduce supply-chain risk if a later allowed version contains a malicious change or breaking security regression, reducing build reproducibility and making it harder to audit exactly what code is deployed.

Static analysis

No suspicious patterns detected.