T09 · Insecure Skill Coding Practices
- Location
scripts/x402-sign.mjs:76- Finding
Untrusted Payment Headers Can Authorize Arbitrary USDC Transfers
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
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.
scripts/x402-sign.mjs:76Untrusted Payment Headers Can Authorize Arbitrary USDC Transfers
package.json:6Unpinned Dependencies and Runtime Package Execution Create Supply-Chain Risk
SKILL.md:62Predictable Shared Temporary File Permits Symlink and Collision Attacks
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.
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:
X402_PRIVATE_KEY=$(node -e "console.log(JSON.parse(require('fs').readFileSync(require('os').homedir()+'/.evm-wallet.json','utf8')).privateKey)")
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.
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.
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.
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.
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.
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.
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.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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")
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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:
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
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")
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.
"private": true,
"type": "module",
"dependencies": {
"viem": "^2.0.0"
}
}
No suspicious patterns detected.