Back to skill

Security audit

defi gym

Security checks for vulnerabilities and agentic risk

Overview

This skill documents real crypto actions from server-managed wallets while saying no client authorization header is required, so it needs careful review before use.

Review the backend security model before installing or using this skill. Do not rely on agent IDs as secrets, and avoid funding any generated wallet unless the service proves caller authentication, per-agent ownership checks, transaction-specific consent, spending limits, and a safe simulation path for live on-chain actions.

Vulnerability Patterns
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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 (1)

T05 · Unauthorized Access and Privilege Escalation

Error
Location
SKILL.md:7
Finding
Unauthenticated Control of Server-Managed Wallet Operations## Vulnerability Details **File Location**: `SKILL.md:7-12`, with affected financial operations documented at `SKILL.md:190-206`, `SKILL.md:323-341`, and `SKILL.md:447-473` **Vulnerability Type**: Missing caller authentication and agent ownership authorization **Risk Level**: High ### Vulnerable Code Snippets `SKILL.md:7-12`: ```markdown **API Base URL:** ``` https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api ``` **No authorization header required** — the proxy handles authentication internally. ``` `SKILL.md:190-206`: ```markdown ### Request Body ```json { "agent_id": "550e8400-e29b-41d4-a716-446655440000" } ``` | Field | Type | Required | Description | |-------|------|----------|-------------| | `agent_id` | UUID | ✅ Yes | Agent ID from `/join` response | ### curl ```bash curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/swap \ -H "Content-Type: application/json" \ -d '{"agent_id": "550e8400-e29b-41d4-a716-446655440000"}' ``` ``` The documented swap behavior includes: ```markdown 4. Sends tx via Privy server-side wallet RPC (`eth_sendTransaction` on `eip155:8453`) ``` `SKILL.md:447-473`: ```markdown | `feeRecipient` | object | ❌ No | Fee routing (defaults to agent wallet). `{ "type": "wallet", "value": "0x..." }` | | `simulateOnly` | boolean | ❌ No | When `true`, returns predicted address without broadcasting | ### curl ```bash curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/deploy-token \ -H "Content-Type: application/json" \ -d '{"agent_id": "550e8400-e29b-41d4-a716-446655440000", "tokenName": "My Agent Token", "tokenSymbol": "MAT"}' ``` ### What Happens 1. Moves agent to DeFi zone with status `"Deploying token via Bankr 🚀"` 2. Calls Bankr Deploy API (`POST https://api.bankr.bot/token-launches/deploy`) 3. Fees default to agent's wallet address 4. Logs `deploy_token` action with token add ...[truncated 3549 chars]
Remediation
## Remediation Suggestions 1. **Require client authentication** - Require a validated user session, OAuth token, API key, or equivalent credential on every non-public endpoint. - Do not rely on the backend's Privy or Bankr credentials as proof that the external caller is authorized. 2. **Enforce object-level authorization** - Bind every `agent_id` to an authenticated owner or tenant. - Before reading state or initiating a transaction, verify that the authenticated principal is authorized to control that specific agent. - Return a generic `404` or `403` response for unauthorized agent references. 3. **Require transaction-specific consent** - Use signed challenges containing the chain ID, wallet address, target contract, function, amount, nonce, expiration time, and intended recipient. - Display and require explicit confirmation for swaps, approvals, deposits, deployments, and fee-recipient changes. - Prevent a general session token from silently authorizing unrestricted wallet transactions. 4. **Introduce scoped capabilities** - Issue short-lived, single-use authorization tokens scoped to one agent, one endpoint, and strict amount limits. - Add nonce validation, expiration, and replay protection. - Apply per-agent and per-user rate limits and spending limits. 5. **Restrict caller-controlled transaction parameters** - Default `feeRecipient` to the verified agent wallet. - Reject alternate fee recipients unless separately authenticated and explicitly approved by the wallet owner. - Allowlist chain IDs, contracts, methods, tokens, vaults, and maximum amounts on the server. 6. **Protect identifiers and operational data** - Treat UUIDs only as identifiers, never as bearer secrets. - Avoid exposing Privy user IDs and unnecessary wallet metadata in action-history responses. - Redact agent IDs and transaction-control metadata from logs where they are not required. 7. **A ...[truncated 670 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (14)

External Transmission

Medium
Category
Data Exfiltration
Content
| `name` | string | ✅ Yes | Agent display name |
| `farcaster_fid` | string | ❌ No | Farcaster user FID for social features |

### curl
```bash
curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/join \
  -H "Content-Type: application/json" \
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
|-------|------|----------|-------------|
| `agent_id` | UUID | ✅ Yes | Agent ID from `/join` response |

### curl
```bash
curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/deposit-fund \
  -H "Content-Type: application/json" \
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Missing User Warnings

Medium
Confidence
93% confidence
Finding
The swap endpoint documentation describes submitting a live on-chain Uniswap transaction but does not present a prominent pre-execution warning that funds will be spent irreversibly and subject to slippage, gas costs, and possible failure. In an agent skill context, omission of a clear consent and risk boundary materially increases the chance that an autonomous system or inattentive operator will trigger value-bearing transactions unintentionally.

External Transmission

Medium
Category
Data Exfiltration
Content
|-------|------|----------|-------------|
| `agent_id` | UUID | ✅ Yes | Agent ID from `/join` response |

### curl
```bash
curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/swap \
  -H "Content-Type: application/json" \
Confidence
86% confidence
Finding
While an external request example is normally benign, here it invokes an endpoint that submits a real on-chain swap transaction. In context, presenting a simple curl command without a strong safety barrier can facilitate accidental spending by operators or autonomous agents, making this external transmission materially risky.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The earn flow performs both an ERC-20 approval and a vault deposit, each of which is a real on-chain action with irreversible consequences, but the documentation lacks a strong warning before execution. Because approvals can grant asset-spending rights and deposits lock funds into a protocol, failing to foreground these risks is dangerous for agent-driven execution.

External Transmission

Medium
Category
Data Exfiltration
Content
|-------|------|----------|-------------|
| `agent_id` | UUID | ✅ Yes | Agent ID from `/join` response |

### curl
```bash
curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/earn \
  -H "Content-Type: application/json" \
Confidence
87% confidence
Finding
This example triggers an endpoint that performs approval and deposit transactions on-chain, so the external transmission is not just informational; it can directly cause asset movement. In the context of an agent skill, a one-line curl example lowers the barrier to unintended execution of financially meaningful actions.

Intent-Code Divergence

Medium
Confidence
96% confidence
Finding
The documented workflow says the fifth step is token deployment and claims it sets `step_deploy_token = true`, but the published schema only defines `step_social`. This inconsistency can cause agents or integrators to make incorrect trust decisions about completion state, NFT eligibility, or whether a high-risk on-chain action actually occurred, which is especially unsafe in a financial automation skill.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The deploy-token step can create a live token, incur fees, and potentially create reputational, legal, and financial exposure, yet the documentation does not clearly warn users before irreversible broadcast. In a skill aimed at autonomous agents, that omission makes accidental or unauthorized token launches significantly more likely.

External Transmission

Medium
Category
Data Exfiltration
Content
| `feeRecipient` | object | ❌ No | Fee routing (defaults to agent wallet). `{ "type": "wallet", "value": "0x..." }` |
| `simulateOnly` | boolean | ❌ No | When `true`, returns predicted address without broadcasting |

### curl
```bash
curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/deploy-token \
  -H "Content-Type: application/json" \
Confidence
88% confidence
Finding
This documented request can trigger live token deployment and fee usage through an external service. Because the skill states no authorization header is required and presents a ready-to-run example, the transmission path is more dangerous than a generic API call and can enable unintended or unauthorized high-impact actions.

External Transmission

Medium
Category
Data Exfiltration
Content
### What Happens
1. Moves agent to DeFi zone with status `"Deploying token via Bankr 🚀"`
2. Calls Bankr Deploy API (`POST https://api.bankr.bot/token-launches/deploy`)
3. Fees default to agent's wallet address
4. Logs `deploy_token` action with token address, pool ID, fee distribution
5. Sets `step_deploy_token = true`, `step_deploy_token_at = now()`
Confidence
84% confidence
Finding
The skill explicitly documents forwarding deployment requests to `https://api.bankr.bot/token-launches/deploy`, which is a third-party external transmission tied to a high-impact action. In this context, undocumented trust assumptions about the third party, fee routing, and live broadcasting increase operational and security risk for agents using the skill.

Intent-Code Divergence

Medium
Confidence
95% confidence
Finding
The progress example reports 5 steps including `deploy_token`, but the schema shown later does not contain a corresponding progress field. In a skill that triggers irreversible transactions, inconsistent progress semantics can mislead downstream agents into executing or skipping steps based on incorrect state, creating unsafe automation and audit gaps.

External Transmission

Medium
Category
Data Exfiltration
Content
}
```

### curl
```bash
curl -X POST https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api/progress \
  -H "Content-Type: application/json" \
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
BASE_URL="https://uxkikwwngosiiownhttr.supabase.co/functions/v1/api"

# 1. Join — get your agent_id
RESPONSE=$(curl -s -X POST $BASE_URL/join \
  -H "Content-Type: application/json" \
  -d '{"name": "MyAgent"}')
echo $RESPONSE
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

External Transmission

Medium
Category
Data Exfiltration
Content
AGENT_ID=$(echo $RESPONSE | jq -r '.agent.id')

# 2. Check deposit status (repeat after sending ETH)
curl -s -X POST $BASE_URL/deposit-fund \
  -H "Content-Type: application/json" \
  -d "{\"agent_id\": \"$AGENT_ID\"}"
Confidence
90% confidence
Finding
This end-to-end example chains deposit checking, swap, earn, and later deployment as runnable commands, effectively serving as a copy-paste automation path for real financial operations. In context, bundling these side-effecting external calls without strong interstitial warnings or confirmation controls materially increases the risk of accidental fund movement and protocol interaction.

Static analysis

No suspicious patterns detected.