Back to skill

Security audit

Elsa x402 API

Security checks for vulnerabilities and agentic risk

Overview

This DeFi skill is mostly coherent and disclosed, but it can sign wallet transactions and x402 payments with safeguards that are too weak for the financial authority it requests.

Review carefully before installing. Use a low-balance payment wallet, set a separate low-balance TRADE_PRIVATE_KEY if execution is enabled, avoid local_signer unless you independently trust the Elsa API response, and do not rely on the documented budget limits as hard protection.

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

T09 · Insecure Skill Coding Practices

Error
Location
scripts/pipeline.ts:77
Finding

API-Controlled Pipeline Transactions Are Signed Without Binding Them to User Confirmation

Content
View full analysis
{ const result = PipelineRunAndWaitInputSchema.safeParse(args); if (!result.success) { return result.error.errors.map((e) => `${e.path.join('.')}: ${e.message}`).join('; '); } return null; }, run: async (args) => { const input = PipelineRunAndWaitInputSchema.parse(args); return runPipelineAndWait(input); }, }, ``` ```ts // scripts/pipeline.ts:77-83 if (task.status === 'sign_pending') { // Task needs signing - use evm_tx_data from API const rawTxData = task.evm_tx_data || task.tx_data; if (params.mode === 'external_signer') { ``` ```ts // scripts/pipeline.ts:101-118 const txData = mapTransactionData(rawTxData); const walletClient = getTradeWalletClient(); // Broadcast transaction const txHash = await walletClient.sendTransaction({ to: txData.to as `0x${string}`, data: txData.data as `0x${string}`, value: txData.value ? BigInt(txData.value) : undefined, gas: txData.gas ? BigInt(txData.gas) : undefined, maxFeePerGas: txData.maxFeePerGas ? BigInt(txData.maxFeePerGas) : undefined, maxPriorityFeePerGas: txData.maxPriorityFeePerGas ? BigInt(txData.maxPriorityFeePerGas) : undefined, }); logger.info({ task_id: task.task_id, tx_hash: txHash }, 'Transaction broadcast'); txHashes.push(txHash); ``` ```ts // scripts/util.ts:86-123 export function mapTransactionData(raw: unknown): TransactionData { if (!raw || typeof raw !== 'object') { throw new Error('Invalid transaction data: expected object'); } const data = raw as Record; if (!data.to || typeof data. ...[truncated 3995 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/budgets.ts:32
Finding

In-Memory Estimated-Cost Tracking Does Not Enforce the Documented Payment Limits

Content
View full analysis
call.timestamp >= startOfDay); } /** * Get calls in the last minute */ private getCallsLastMinute(): CallRecord[] { const oneMinuteAgo = Date.now() - 60_000; return this.calls.filter((call) => call.timestamp >= oneMinuteAgo); } /** * Clean up old call records (older than 24 hours) */ private cleanup(): void { const cutoff = Date.now() - 24 * 60 * 60 * 1000; this.calls = this.calls.filter((call) => call.timestamp >= cutoff); } /** * Record a call */ recordCall(endpoint: string, cost_usd: number): void { this.calls.push({ timestamp: Date.now(), endpoint, cost_usd, }); this.cleanup(); } ``` ```ts // scripts/budgets.ts:72-100 checkBudget(endpoint: string): void { const config = getConfig(); const estimatedCost = getEndpointCost(endpoint); // Check per-call limit if (estimatedCost > config.ELSA_MAX_USD_PER_CALL) { throw new BudgetExceededError( `Estimated cost $${estimatedCost.toFixed(4)} exceeds per-call limit of $${config.ELSA_MAX_USD_PER_CALL.toFixed(2)}`, { limit: config.ELSA_MAX_USD_PER_CALL, requested: estimatedCost, spent: 0, } ); } // Check daily limit const spentToday = this.getSpentToday(); if (spentToday + estimatedCost > config.ELSA_MAX_USD_PER_DAY) ...[truncated 4268 chars]
Remediation
View remediation
Vulnerability Patterns
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (89)

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Describing the skill mainly as portfolio analysis, token search, and swaps while it also supports wallet risk analysis, order management, perpetuals, and budget tracking can mislead users and automated governance systems. In a financial environment, capability understatement is dangerous because it affects trust, approval, and runtime policy decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

Describing the skill mainly as portfolio analysis, token search, and swaps while it also supports wallet risk analysis, order management, perpetuals, and budget tracking can mislead users and automated governance systems. In a financial environment, capability understatement is dangerous because it affects trust, approval, and runtime policy decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

Describing the skill mainly as portfolio analysis, token search, and swaps while it also supports wallet risk analysis, order management, perpetuals, and budget tracking can mislead users and automated governance systems. In a financial environment, capability understatement is dangerous because it affects trust, approval, and runtime policy decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Describing the skill mainly as portfolio analysis, token search, and swaps while it also supports wallet risk analysis, order management, perpetuals, and budget tracking can mislead users and automated governance systems. In a financial environment, capability understatement is dangerous because it affects trust, approval, and runtime policy decisions.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

Describing the skill mainly as portfolio analysis, token search, and swaps while it also supports wallet risk analysis, order management, perpetuals, and budget tracking can mislead users and automated governance systems. In a financial environment, capability understatement is dangerous because it affects trust, approval, and runtime policy decisions.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

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
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
npx tsx scripts/index.ts elsa_get_swap_quote '{

Static analysis

No suspicious patterns detected.