T09 · Insecure Skill Coding Practices
- Location
scripts/request.ts:39- Finding
Documented Payment Limits and Human Approval Requirements Are Not Enforced in Code
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill is a real x402 payment helper, but it can automatically sign blockchain payments with a raw private key and its documented spending safeguards are not enforced in code.
Install only with a dedicated burner wallet holding funds you are willing to risk, preferably on testnet first. Do not use a main wallet private key. Treat every request URL as payment-capable, verify the merchant and expected amount yourself, and consider adding code-level limits or an allowlist before allowing autonomous use.
scripts/request.ts:39Documented Payment Limits and Human Approval Requirements Are Not Enforced in Code
package.json:10Dependency Installation Is Not Reproducible or Integrity-Locked
The skill is presented as a general Base L2 x402 payment utility, but the available behavior appears oriented toward sandbox/testnet token minting rather than real protected-resource payment flows. This discrepancy can confuse autonomous agents and humans into invoking the skill in the wrong context, potentially leading to bad operational decisions, false assurances about payment support, or accidental interaction with unvetted endpoints while handling a live private key.
The skill is presented as a general Base L2 x402 payment utility, but the available behavior appears oriented toward sandbox/testnet token minting rather than real protected-resource payment flows. This discrepancy can confuse autonomous agents and humans into invoking the skill in the wrong context, potentially leading to bad operational decisions, false assurances about payment support, or accidental interaction with unvetted endpoints while handling a live private key.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
export function getPrivateKey(isJson: boolean): string {
const pk = process.env.CLIENT_PRIVATE_KEY;
if (!pk) {
reportError('CLIENT_PRIVATE_KEY not found in environment. Check .env file.', isJson, EXIT_CODES.AUTH_FAILURE);
}
// Simple format check (0x followed by 64 hex characters)
const pkRegex = /^0x[0-9a-fA-F]{64}$/;
The skill requires access to a highly sensitive environment secret (CLIENT_PRIVATE_KEY) but does not declare any explicit tool scope or permission boundary. In an agent setting, undeclared secret access increases the chance that the runtime grants broader capabilities than operators expect, which is especially dangerous because this key can authorize blockchain transactions and spend funds.
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
### API Specifications
| Method | Description | Input | Output |
| :------- | :--------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **POST** | **Handshake**: Get payment parameters.<br>**Verification**: Verify on-chain transaction. | **Query**: `network` ("testnet") <br> **Header**: `x-paynode-receipt` (Optional), `x-paynode-order-id` (Required for verification) <br> **Body**: `agent_name` (Optional) | **402 (Payment Required)**: Returns headers (`x-paynode-*`) with contract, merchant, amount, token, order ID, etc.<br>**200 (Success)**: Returns JSON object with `status: "SUCCESS"`.<br>**400/500 (Error)**: Returns error message. |
Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.
### API Specifications
| Method | Description | Input | Output |
| :------- | :--------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **POST** | **Handshake**: Get payment parameters.<br>**Verification**: Verify on-chain transaction. | **Query**: `network` ("testnet") <br> **Header**: `x-paynode-receipt` (Optional), `x-paynode-order-id` (Required for verification) <br> **Body**: `agent_name` (Optional) | **402 (Payment Required)**: Returns headers (`x-paynode-*`) with contract, merchant, amount, token, order ID, etc.<br>**200 (Success)**: Returns JSON object with `status: "SUCCESS"`.<br>**400/500 (Error)**: Returns error message. |
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
CLIENT_PRIVATE_KEY Required. 64-character hex string starting with 0x.
Example:
bun run scripts/request.ts "https://api.example.com/data" --json --network testnet
`.trim()
);
process.exit(args.params.length < 1 && !args.isHelp ? EXIT_CODES.INVALID_ARGS : EXIT_CODES.SUCCESS);