Back to skill

Security audit

Nevermined Payments

Security checks for vulnerabilities and agentic risk

Overview

ClawScan marks this payment integration skill suspicious because its autonomous payment guidance may accept an endpoint’s payment offer and spend delegation funds without validating the offer against an approved purchase policy.

Review the payment flow before installing or using it. Require approval or a clear policy that checks the endpoint, merchant, plan, and maximum charge before a token is created or sent; use delegation limits. Also consider whether sending queries to OpenAI fits your privacy requirements. Because several files were only partially inspected, the scan cannot establish that the skill is safe.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (71)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 49)May include surrounding context.

md
### How payments work (x402 in one minute)

Nevermined uses the **x402 protocol** (HTTP `402 Payment Required`). A buyer acquires an **access token** authorizing a spend, then **settles** it — which charges the payment method, mints, and burns credits. The same token can be sent to a protected agent in the `payment-signature` header; the agent verifies and settles for you.

Two payment **schemes** exist:

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 174)May include surrounding context.

A4 · Buy access via x402 (fully programmatic)

Two calls: get an access token, then settle. x402 is the default buy flow for both rails — crypto and card work the same way, only scheme/network differ. The facilitator charges the right method (on-chain against your delegation for crypto, the card for fiat), mints, and burns.

bash
# 1. Get an access token (authorizes the spend against your delegation)

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 177)May include surrounding context.

Two calls: get an access token, then settle. x402 is the default buy flow for both rails — crypto and card work the same way, only scheme/network differ. The facilitator charges the right method (on-chain against your delegation for crypto, the card for fiat), mints, and burns.

bash
# 1. Get an access token (authorizes the spend against your delegation)
curl -X POST -H "Authorization: Bearer $NVM_API_KEY" -H "Content-Type: application/json" \
  -d '{
        "accepted": { "scheme": "nvm:erc4337", "network": "eip155:84532", "planId": "<PLAN_ID>" },

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 560)May include surrounding context.

md
| Header | Direction | Description |
|---|---|---|
| `payment-signature` | Client → Server | x402 access token |
| `payment-required` | Server → Client (402) | Base64-encoded JSON with plan requirements |
| `payment-response` | Server → Client (200) | Base64-encoded JSON settlement receipt |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/client-integration.md (reported line 12)May include surrounding context.

md
As a subscriber (consumer of a paid API/agent), you:
1. Order a payment plan
2. Check your credit balance
3. Generate an x402 access token
4. Send requests with the `payment-signature` header
5. Decode the settlement receipt from the `payment-response` header

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/client-integration.md (reported line 21)May include surrounding context.

An autonomous agent can complete the whole subscriber flow with plain HTTP — no SDK install. Send Authorization: Bearer $NVM_API_KEY on each call.

bash
# 1. Get an x402 access token (create the delegation first via /delegation/create, then pass its delegationId)
curl -s -X POST -H "Authorization: Bearer $NVM_API_KEY" -H "Content-Type: application/json" \
  -d '{ "accepted": { "scheme": "nvm:erc4337", "network": "eip155:84532", "planId": "<PLAN_ID>" },
        "delegationConfig": { "delegationId": "<DELEGATION_ID>" } }' \

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 73)May include surrounding context.

md
| Plan registration + the plan-type matrix (A6) | `references/payment-plans.md` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 269)May include surrounding context.

md
e the SDK helpers to produce them. Full plan-type matrix and helper reference: `references/payment-plans.md`.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 604)May include surrounding context.

md
See `references/payment-plans.md` for plan registration code.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 625)May include surrounding context.

md
**SDK (recommended):** `registerAgentAndPlan` / `register_agent_and_plan` as shown in **A6**; full TypeScript and Python code in `references/payment-plans.md`.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 74)May include surrounding context.

md
| Subscriber-side SDK patterns | `references/client-integration.md` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 228)May include surrounding context.

md
Full crypto + card walkthroughs with every field: `references/autonomous-operations.md`. Subscriber-side SDK patterns: `references/client-integration.md`.

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 424)May include surrounding context.

md
| **Client-side** | TS / Python | `references/client-integration.md` | `payments.x402.getX402AccessToken()` with `delegationConfig` |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · SKILL.md (reported line 213)May include surrounding context.

md
- **No `billingModel` at all?** The deployment predates the discriminator — apply the `credits` rule, never pay-as-you-go.
- **Card budget caveat:** a card settle may not immediately move the delegation's `amountSpentCents`/`remainingBudgetCents` — use the settle receipt + the A5 plan balance as the source of truth for card spend, not the delegation budget.

**Calling a protected agent directly** (the common case): just send the access token as the `payment-signature` header to the agent's endpoint — the agent's own `402` response **is** your `paymentRequired`, and the agent verifies + settles for you. You only call `/settle` yourself when topping up a plan with no protected endpoint to hit.

> A dedicated `orderPlan` / `POST /protocol/plans/{id}/order` endpoint exists for an explicit, upfront stablecoin purchase, but **x402 above is the default for both rails — use `/order` only when specifically requested.**

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 418)May include surrounding context.

md
| **FastAPI** | Python | `references/fastapi-integration.md` | `PaymentMiddleware` from `payments_py.x402.fastapi` |

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 420)May include surrounding context.

md
| **LangChain / LangGraph** | TS / Python | `references/langchain-integration.md` | `@requires_payment` from `payments_py.x402.langchain` / `requiresPayment` fr

Incomplete referenced artifact analysis

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

Scanner excerpt · SKILL.md (reported line 421)May include surrounding context.

md
| **MCP Server** | TS / Python | `references/mcp-paywall.md` (TypeScript examples; Python has `payments.mcp.register_tool()` / `start()`) | `payments.mcp.start(

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/a2a-integration.md (reported line 206)May include surrounding context.

md
### Initialize the Client

The client mints the x402 access token itself from the delegation you pass in, so create the delegation first.

#### TypeScript

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/autonomous-operations.md (reported line 152)May include surrounding context.

Two calls. x402 is the default buy flow for both rails — crypto and card are identical except scheme/network; the facilitator charges the right method (on-chain against your delegation for crypto, the card for fiat).

4a. Get an access token

bash
curl -s -X POST -H "Authorization: Bearer $NVM_API_KEY" -H "Content-Type: application/json" \

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/x402-protocol.md (reported line 20)May include surrounding context.

md
| Header | Direction | Description |
|---|---|---|
| `payment-signature` | Client → Server | x402 access token |
| `payment-required` | Server → Client (402) | Base64-encoded payment requirements |
| `payment-response` | Server → Client (200) | Base64-encoded settlement receipt |

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/x402-protocol.md (reported line 55)May include surrounding context.

return res .status(402) .setHeader('payment-required', paymentRequiredBase64) .json({ error: 'Payment Required', message: 'Missing x402 access token' }) }

text

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/x402-protocol.md (reported line 85)May include surrounding context.

return JSONResponse( status_code=402, content={"error": "Payment Required", "message": "Missing x402 access token"}, headers={"payment-required": payment_required_base64} )

text

Credential Access

High
Category
Privilege Escalation
Confidence
90% confidence
Finding

The workflow instructs an autonomous agent to accept a remote endpoint's first payment offer, mint a token for its supplied plan, and return that bearer token without validating the merchant, price, or approved purchase scope. A malicious or compromised endpoint could substitute an attacker-controlled plan and consume the available delegation budget; this source explicitly permits plan-agnostic delegations.

Content

Scanner excerpt · references/autonomous-operations.md (reported line 236)May include surrounding context.

md
If you're calling an x402-protected agent/service rather than topping up a plan, you don't build `paymentRequired` yourself:

1. Call the agent's endpoint with no token → it returns `402` with a `payment-required` header (base64 JSON). That decoded object **is** your `paymentRequired`.
2. Get an access token (step 4a) using its `accepts[0]` scheme/network/planId.
3. Retry the request with header `payment-signature: <accessToken>`. The agent verifies and settles for you and returns `200` with a `payment-response` receipt header (base64 JSON of the settle response above).

Common errors (read the message — code semantics differ slightly between the OpenAPI examples and the backend error registry, so recover by the message, not the number alone): `BCK.X402.0001` — can't generate the token: unknown/invalid `planId` or `agentId` (the agent may not exist). `BCK.X402.0002` — plan not found (often the wrong environment). `BCK.X402.0003` — token rejected: it's expired/invalid **or** the plan is

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/client-integration.md (reported line 39)May include surrounding context.

text

- **Card payment:** switch `scheme` to `nvm:card-delegation` and `network` to `stripe` (or `braintree`/`visa`) in both calls.
- **Calling a protected agent directly:** skip building `paymentRequired` — send the access token as the `payment-signature` header; the agent settles for you and returns the receipt in the `payment-response` header.
- **Proof of purchase — read `billingModel` first.** On a `credits` plan it is `success: true` and `creditsRedeemed > 0`. On a `pay-as-you-go` plan there is no credit balance, so `creditsRedeemed` and `remainingBalance` are always the string `"0"` even on a successful charge; the proof is `success: true` plus a non-empty `orderTx` (fiat) or `transaction` (crypto). Never gate on `creditsRedeemed` alone — on a card rail it reports a real charge as a decline and invites a retry. If `billingModel` is missing entirely the deployment predates it: apply the `credits` rule.

Full runbook with API-key retrieval, card enrollment, and status checks: `auto

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

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

Content

Scanner excerpt · references/client-integration.md (reported line 109)May include surrounding context.

md
## Automatic Credit Top-Ups

When the access token carries a `delegationConfig`, the facilitator tops up the subscriber's credits automatically — no manual balance-check-then-`orderPlan` loop.

- The top-up fires at **settlement** (when a paid request is consumed), **not** when `getX402AccessToken` is called. Generating the token only pre-authorizes the spend; no credits are bought until the balance is actually short.
- **Crypto (`nvm:erc4337`)**: the facilitator executes an on-chain `order` against the subscriber's smart account.