Back to skill

Security audit

confidential-agentic-payment-stack

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed encrypted-payment skill, but it can spend funds and send sensitive data to configurable services without strong confirmation or destination checks.

Install only if you trust the publisher and will configure it tightly. Use Sepolia or a low-balance wallet first, prefer supervised Ledger approval for real funds, avoid passing proprietary code or secrets to review-and-rate, and only point DFNS and paid-service URLs at trusted HTTPS origins. Treat every payment, escrow, unwrap, feedback, and delegation command as an irreversible on-chain action.

Vulnerability Patterns
  • 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
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (3)

T09 · Insecure Skill Coding Practices

Error
Location
_wallet.ts:126
Finding

DFNS Authentication Token Can Be Sent to an Arbitrary Endpoint

Content
View full analysis
{ const apiUrl = process.env.DFNS_API_URL ?? 'https://api.dfns.io'; const authToken = process.env.DFNS_AUTH_TOKEN!; const walletId = process.env.DFNS_WALLET_ID!; const response = await fetch(`${apiUrl}/wallets/${walletId}`, { headers: { Authorization: `Bearer ${authToken}`, 'Content-Type': 'application/json', }, }); ``` ### Technical Analysis The Skill permits `DFNS_API_URL` to specify an unrestricted URL and then sends the sensitive `DFNS_AUTH_TOKEN` to that destination in an `Authorization` header. There is no validation of the URL scheme, hostname, port, or origin. Using the DFNS authentication token with the official DFNS API is necessary for the declared DFNS wallet functionality. However, sending the token to any environment-controlled endpoint exceeds minimum privilege. An attacker who can influence runtime environment variables could redirect the request to an attacker-controlled HTTPS or plaintext HTTP server. The DFNS credential private key is separately passed to `createDfnsWallet`, whose implementation resides in the unavailable `../../core/src/index.js`. This audit therefore cannot determine whether that dependency handles the credential private key safely. ### Attack Path 1. The attacker gains the ability to influence the Skill's runtime configuration or deployment environment. 2. The attacker sets `DFNS_API_URL` to an endpoint they control, such as `https://attacker.example`. 3. A user invokes any command that initializes DFNS wallet mode. 4. `resolveDfnsWalletMetadata()` sends `Authorization: Bearer ` to the attacker's server. 5. The attacker captures the token and attempts to reuse i ...[truncated 586 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
_paid-request.ts:138
Finding

Untrusted HTTP 402 Responses Control Payment Destinations and Contracts

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
review-and-rate.ts:19
Finding

Sensitive User Content Can Be Transmitted to Untrusted or Plaintext Service Endpoints

Content
View full analysis
>; summary?: string; }>( context, `${codeReviewUrl}/api/review`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ code: args.code, language, }), }, ); ``` From `research-and-visualize.ts`: ```ts const searchUrl = process.env.SEARCH_SERVER_URL ?? 'http://127.0.0.1:3001'; const llmUrl = process.env.LLM_SERVER_URL ?? 'http://127.0.0.1:3002'; const imageUrl = process.env.IMAGE_SERVER_URL ?? 'http://127.0.0.1:3003'; const context = await createDemoPaymentContext(100_000n); const search = await paidJsonRequest<{ results?: Array<{ title: string; url: string; snippet: string }> }>( context, `${searchUrl}/api/search`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ query, count: 5 }), }, ); const analysis = await paidJsonRequest<{ response?: string; usage?: Record }>( context, `${llmUrl}/api/chat`, { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ model: 'gpt-4o-mini', messages: [ { role: 'system', content: 'Summarize these search results into 3 concise insights.' }, { role: 'user', co ...[truncated 2571 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented review-and-rate workflow sends code to an external review service even though the skill is framed as an encrypted payment utility. In the context of a wallet-enabled skill, this hidden expansion of behavior can cause confidential source code or other sensitive data to be transmitted externally under the guise of a payment operation, which materially changes the trust and threat model.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The documented review-and-rate workflow sends code to an external review service even though the skill is framed as an encrypted payment utility. In the context of a wallet-enabled skill, this hidden expansion of behavior can cause confidential source code or other sensitive data to be transmitted externally under the guise of a payment operation, which materially changes the trust and threat model.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

This file implements a paid search, LLM summarization, and image-generation pipeline, which is materially broader than the stated FHE x402 payment skill purpose. In an agent skill, capability expansion is dangerous because it enables data exfiltration and paid outbound actions through unrelated external services under the cover of a payment-focused manifest.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The code introduces unjustified capabilities: it sends user input to a search service, forwards results to an LLM, and then sends derived content to an image generator, all while charging encrypted payments. These hidden or undocumented capabilities expand the attack surface and can cause privacy loss, unexpected spending, and misuse of agent permissions beyond what users would expect from a payment utility.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
88% confidence
Finding

The skill declares environment and network requirements but does not define an explicit tool scope such as allowed tools or permissions. In a payment-capable skill that can access private keys, wallet endpoints, and RPC infrastructure, missing scope boundaries increases the chance that the runtime grants broader-than-necessary capabilities or that operators misunderstand what the skill may access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The quick-start and command descriptions encourage immediate use of wrap, pay, fund-job, and other transaction-producing actions without a prominent warning that they can spend real funds and are irreversible. In a blockchain payment skill, omission of this warning makes accidental loss materially more likely, especially if users switch from Sepolia defaults to Mainnet or misconfigure RPC targets.

Content

No source excerpt is available for this finding.

Unrestricted Tool Access

Medium
Category
Excessive Agency
Confidence
80% confidence
Finding

Skill grants unrestricted tool access without appropriate constraints. An agent with unfettered tool access can perform arbitrary actions including file modification, network requests, and code execution.

Content

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

Quick Start

Set a wallet and RPC, then run any command:

bash
# Minimal setup (local dev)

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

This code automatically responds to any HTTP 402 challenge by creating a payment proof from challenge parameters supplied by the remote server, then retransmits it without any user-facing confirmation, trust check, or recipient verification. In a payment skill, that is dangerous because a malicious or compromised endpoint can trigger unexpected spending or induce payments to attacker-controlled recipients, especially since the skill context is designed to move on-chain value.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

This code sends an on-chain finalizeUnwrap transaction immediately after obtaining decrypted values, with no explicit user-facing disclosure or confirmation step. In an agent skill context, that means a caller can trigger a real external blockchain state change and spend gas without a final consent checkpoint, increasing the risk of unintended or prompt-induced transactions.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manual path also broadcasts finalizeUnwrap directly from user-supplied requestId, cleartextAmount, and proof without any explicit warning that this performs an irreversible on-chain action. Because this skill is specifically designed to manage payments and token unwraps, the absence of a confirmation step is more dangerous: an agent or attacker influencing inputs could cause unintended state changes, failed costly transactions, or premature finalization attempts.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This code performs real on-chain state-changing actions that can spend funds and grant token operator approval without any explicit user-facing confirmation step in this function or CLI entrypoint. In an agent skill context, that is risky because an upstream agent, prompt injection, or mistaken automation could trigger funding of the wrong job or approve escrow access without the operator clearly reviewing the target, amount, network, and expiry.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code performs a blockchain payment immediately after parsing CLI arguments, with no explicit user-facing confirmation, preview, or secondary approval step in the local flow. In an agent skill that can move value on-chain, accidental invocation, parameter confusion, prompt-injection-driven tool use, or malicious automation could cause irreversible transfers before the operator notices.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code transmits the user-provided query, search results, and model-derived content to multiple external services without any disclosure, consent check, or warning in this file. In an agent context, this creates a meaningful privacy and data-handling risk because sensitive prompts or derived information may leave the local environment unexpectedly and be retained or processed by third parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

This code transmits arbitrary user-supplied source code to an external review endpoint via paidJsonRequest without any in-file consent gate, redaction, or sensitivity checks. In this skill context, the risk is elevated because agents may be given proprietary code, secrets, or internal logic to analyze, and the default endpoint is configurable by environment variable, making silent exfiltration to a third-party or attacker-controlled service plausible.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The manifest description frames the skill as encrypted payments only, but the command set also covers identity registration, reputation feedback, escrow workflows, delegated balance viewing, and external service orchestration. This mismatch can cause operators or downstream policy systems to under-scope the skill's permissions and data flows, increasing the chance that higher-risk capabilities are enabled without informed review.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill includes 'research-and-visualize' and 'review-and-rate' workflows that go beyond private payment execution and implicitly orchestrate external services using user-provided content. In a payment-focused skill, these broader behaviors enlarge the trust boundary and can enable unanticipated data disclosure or purchases without users realizing the skill is acting as a broker to third-party systems.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest describes chained search, LLM, and image-generation requests but omits a warning that the user's query will be shared with outside providers. Sensitive prompts, research topics, or internal operational context could therefore be disclosed externally without clear notice, and the chaining increases exposure across multiple third parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The manifest says user-supplied code can be sent to an external reviewer, but it does not warn that proprietary code, secrets, or sensitive logic may leave the local environment. In a security-sensitive agent context, this can directly cause confidentiality loss, including leakage of source code, credentials embedded in snippets, or internal business logic to third parties.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This code submits irreversible on-chain unwrap and possible finalizeUnwrap transactions immediately based on CLI input, with no explicit confirmation, review step, or dry-run before funds are affected. In an agent skill context, that is dangerous because upstream prompts, tool misuse, or compromised automation can trigger real asset movement without the operator consciously approving the action.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The code performs an ERC-20 approval followed immediately by an on-chain wrap transaction with no interactive confirmation, preview, or policy gate before spending funds. In an agent skill context, this is risky because higher-level automation or prompt manipulation could trigger real token movements without the operator clearly acknowledging the amount, destination contract, network, and approval implications.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The function imports fs/promises and reads a DFNS credential private key from a path supplied by an environment variable, which is a sensitive credential access operation. In this file there is no confirmation prompt, user-facing log, or warning comment near the operation explaining that secret material will be loaded from disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
88% confidence
Finding

This code performs an outbound fetch to the DFNS API and transmits a bearer token in the Authorization header. Although the network call is part of wallet metadata resolution, this file does not provide any explicit user-facing warning or nearby disclosure that credentials and wallet identifiers will be sent to an external service.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.env_credential_access, suspicious.potential_exfiltration

Environment variable access combined with network send.

Critical
Code
suspicious.env_credential_access
Location
_wallet.ts:18

Sensitive-looking file read is paired with a network send.

Warn
Code
suspicious.potential_exfiltration
Location
_wallet.ts:122