Back to skill

Security audit

payment-402

Security checks for vulnerabilities and agentic risk

Overview

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.

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 (2)

T09 · Insecure Skill Coding Practices

Error
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

T08 · Insecure Dependencies

Warning
Location
package.json:10
Finding

Dependency Installation Is Not Reproducible or Integrity-Locked

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (7)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/utils.ts (reported line 116)May include surrounding context.

ts
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}$/;

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

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.

Content

No source excerpt is available for this finding.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

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.

Content

Scanner excerpt · references/TESTING.md (reported line 27)May include surrounding context.

md
### 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. |

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

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.

Content

Scanner excerpt · references/TESTING.md (reported line 27)May include surrounding context.

md
### 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. |

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 · scripts/request.ts (reported line 32)May include surrounding context.

ts
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);