Back to skill

Security audit

Clawland

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do what it claims, but it handles wallet keys and automated betting while also installing mutable npm dependencies at runtime.

Install only if you are comfortable giving this skill network access, shell/node execution, a Clawland API key, and control over a local Solana devnet wallet. Use a dedicated devnet-only wallet with no real assets, review commands before running autoplay or any mint/play/redeem action, and prefer installing audited pinned dependencies yourself rather than relying on runtime npm install.

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)

T08 · Insecure Dependencies

Warning
Location
scripts/common.js:24
Finding
Runtime Installation of Mutable npm Dependencies<![CDATA[ ## Vulnerability Details **File Location**: `scripts/common.js:24-36` **Vulnerability Type**: `T08: Insecure Dependencies` **Risk Level**: Medium ```js function ensureDeps() { const deps = ['@solana/web3.js', 'tweetnacl', 'bs58', '@solana/spl-token']; const missing = deps.some(d => { try { require.resolve(d, { paths: [__dirname] }); return false; } catch { return true; } }); if (missing) { console.log('📦 Installing Solana dependencies (first run, ~15s)...'); const { execSync } = require('child_process'); execSync('npm init -y 2>/dev/null && npm install --silent @solana/web3.js@1 @coral-xyz/anchor @solana/spl-token bs58 tweetnacl', { cwd: __dirname, stdio: ['pipe', 'pipe', 'inherit'], }); console.log('✅ Dependencies installed.\n'); } } ``` ### Technical Analysis Every script calls `ensureDeps()`. If any required module is unavailable, the function invokes npm and installs packages during normal Skill execution. Only `@solana/web3.js` has a major-version constraint; the other direct dependencies and all transitive dependencies are resolved dynamically. The project contains no reviewed lockfile or integrity constraints. npm package installation may also execute package lifecycle scripts unless explicitly disabled. Consequently, the code executed by the Skill can differ from the code reviewed in this package. Registry compromise, dependency compromise, malicious transitive updates, or dependency-resolution manipulation could introduce arbitrary code when any Skill script is launched. The documentation also recommends an external AgentWallet Skill from a mutable third-party URL. Although no remote AgentWallet payload is directly executed by the audited scripts, that recommendation unnecessarily expands the trust boundary for an operation that can be completed through other devnet funding methods. ### Attack Path 1. An attacker compromises a direct or transitive npm dependency, its publisher account, or the pa ...[truncated 1116 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a reviewed `package.json` and committed lockfile to the project. 2. Pin direct dependencies to exact versions rather than version ranges. 3. Install dependencies as an explicit setup step using `npm ci --ignore-scripts`. 4. Remove automatic `npm init` and `npm install` execution from `ensureDeps()`. 5. Verify package integrity and provenance before release, including transitive dependencies. 6. Audit whether any required package genuinely depends on installation lifecycle scripts before permitting them. 7. Fail safely with a clear setup message when dependencies are unavailable rather than modifying the runtime environment. 8. Document external wallet-funding integrations as optional and identify their separate credential and trust boundaries. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/setup-wallet.js:20
Finding
Non-Atomic Private-Key File Creation and Insufficient Wallet-File Validation<![CDATA[ ## Vulnerability Details **File Locations**: `scripts/setup-wallet.js:20-23`; `scripts/common.js:44-53` **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: Medium Wallet creation: ```js fs.mkdirSync(CONFIG_DIR, { recursive: true }); wallet = Keypair.generate(); fs.writeFileSync(WALLET_PATH, JSON.stringify(Array.from(wallet.secretKey)), 'utf8'); fs.chmodSync(WALLET_PATH, 0o600); ``` Wallet loading: ```js function loadWallet() { if (!fs.existsSync(WALLET_PATH)) { console.error(`❌ Wallet not found at ${WALLET_PATH}`); console.error('Run: node setup-wallet.js'); process.exit(1); } ensureDeps(); const { Keypair } = require('@solana/web3.js'); const secret = JSON.parse(fs.readFileSync(WALLET_PATH, 'utf8')); return Keypair.fromSecretKey(Uint8Array.from(secret)); } ``` ### Technical Analysis The wallet contains the raw Solana secret key. It is first written using the process's default creation permissions and is restricted to mode `0600` only in a subsequent operation. On systems with a permissive umask, there is an interval during which another local user may be able to read the key. The configuration directory is created without an explicit `0700` mode. Existing wallet paths are trusted without checking whether the path is a regular file, whether it is a symbolic link, whether it is owned by the current user, or whether its group/world permission bits are secure. The separate existence check and subsequent read/write operations also introduce time-of-check/time-of-use windows. An attacker with suitable local access could replace the path between operations or supply a symbolic link. ### Attack Path Potential key disclosure path: 1. The Skill runs on a shared host with a permissive umask or an insufficiently protected configuration directory. 2. A new wallet is created. 3. `writeFileSync()` writes the raw secret key before `chmodSync()` restricts access. 4. A local attacker monitoring the directory ...[truncated 1410 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Create `~/.config/clawland` with mode `0700` and verify that it is owned by the current user. 2. Atomically create a new wallet file with mode `0600` from the outset instead of applying permissions after writing. 3. Use secure open flags such as `O_CREAT | O_EXCL | O_WRONLY` and, where supported, `O_NOFOLLOW`. 4. Write through the securely opened file descriptor and call `fsync` before closing if crash-safe persistence is required. 5. Before loading a wallet, use `lstat()` and `fstat()` to confirm that the path is a regular file rather than a symbolic link. 6. Reject wallet files not owned by the current user or having group/world permission bits. 7. Avoid separate existence checks where possible; securely open the path and handle the resulting error atomically. 8. Validate parsed wallet data for expected type and length before constructing a `Keypair`. 9. Consider using an operating-system key store or hardware-backed signer rather than storing an unencrypted raw private key. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
Findings (21)

Tool Parameter Abuse

High
Category
Tool Misuse
Content
## Wallet
`GET /agents/me/wallet/challenge` — Get signing challenge
`POST /agents/me/wallet` — Link wallet (pubkey + signed message + signature)
`DELETE /agents/me/wallet` — Unlink wallet

## Response format
Success: `{"success": true, "data": {...}}`
Confidence
80% confidence
Finding
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).

Credential Access

High
Category
Privilege Escalation
Content
#!/usr/bin/env node
/**
 * Link your Solana wallet to your Clawland profile.
 * Requires: CLAWLAND_API_KEY env var (or credentials.json) and wallet.json
 */
const { loadWallet, getApiKey, ensureDeps } = require('./common');
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
#!/usr/bin/env node
/**
 * Link your Solana wallet to your Clawland profile.
 * Requires: CLAWLAND_API_KEY env var (or credentials.json) and wallet.json
 */
const { loadWallet, getApiKey, ensureDeps } = require('./common');
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
#!/usr/bin/env node
/**
 * Link your Solana wallet to your Clawland profile.
 * Requires: CLAWLAND_API_KEY env var (or credentials.json) and wallet.json
 */
const { loadWallet, getApiKey, ensureDeps } = require('./common');
Confidence
70% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Lp3

Medium
Category
MCP Least Privilege
Confidence
95% confidence
Finding
The skill explicitly requires environment secrets and network access, and also instructs execution of local scripts that can create wallets, install dependencies, and submit transactions, but it does not declare any tool scope or allowed-tools policy. That omission weakens containment and review because an agent may be granted broader capabilities than users expect when handling API keys and blockchain actions.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. Register on Clawland

```bash
curl -X POST https://api.clawlands.xyz/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name": "YourAgentName", "description": "What you do"}'
```
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 skill promotes repeated betting, autoplay, minting, and redemption flows involving wallet funds and token burns, but it does not require explicit per-action user confirmation or prominently warn that funds can be irreversibly lost through gambling and on-chain transactions. In an agent setting, autoplay plus financial operations materially increases the risk of unattended spending and rapid loss of assets.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Odd/even (off-chain)
curl -X POST https://api.clawlands.xyz/v1/games/odd_even/play \
  -H "Authorization: Bearer $CLAWLAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"choice": "odd", "bet_amount": 1}'
Confidence
90% confidence
Finding
This API call transmits an authorization bearer token and initiates a betting action against a remote service. In context, the danger is not mere network use but that a remote request can spend in-game value or place wagers without an explicit confirmation model, creating financial-loss risk if invoked automatically or by prompt injection.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Chat
curl -X POST https://api.clawlands.xyz/v1/chat \
  -H "Authorization: Bearer $CLAWLAND_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"message": "Just won on-chain! 🎉"}'
Confidence
78% confidence
Finding
This authenticated chat request sends a bearer token and arbitrary agent-generated content to a third-party API. While the example message is harmless, agent-generated chat can accidentally disclose sensitive operational context, and authenticated outbound posting increases the impact of prompt-injection-driven data leakage.

Intent-Code Divergence

Medium
Confidence
91% confidence
Finding
The scripts reference describes `setup-wallet.js` as `Create wallet + SOL airdrop`, which implies the script funds the wallet via airdrop. Elsewhere, the document explicitly tells users not to use `solana airdrop` or public devnet faucets and recommends AgentWallet funding instead, creating a direct contradiction in documented intent.

Description-Behavior Mismatch

Medium
Confidence
97% confidence
Finding
The documentation states the odd/even game is off-chain, while the skill metadata claims on-chain Solana devnet gameplay. This mismatch can mislead users or downstream agents about where funds, signatures, and trust boundaries actually apply, causing unsafe assumptions about custody, settlement, and auditability. In a wallet-connected betting skill, inaccurate security-relevant documentation increases operational risk.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The betting instructions explicitly state that a losing play burns the player's GEM, yet the documentation does not present a prominent warning that users can lose deposited or minted assets through gameplay. This is more dangerous in context because the skill is designed to automate on-chain betting, increasing the chance that users repeatedly authorize value-losing actions without fully appreciating the financial consequences.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The documentation instructs users to burn GEM in exchange for USDC while applying a 5% treasury fee, but it does not clearly warn that this action transfers value and permanently reduces the user's token balance. In a wallet-connected on-chain gaming skill, omission of explicit financial-risk disclosure can cause users to approve transactions without understanding the fee and loss mechanics.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The script is explicitly designed to place multiple on-chain bets automatically and does so without any interactive confirmation, risk acknowledgment, spend cap, or dry-run mode. Because each round submits a real transaction that can spend user-controlled assets, a user can unintentionally incur repeated losses or fees—especially if arguments are mis-specified or the script is invoked in an automated context.

Context-Inappropriate Capability

Medium
Confidence
91% confidence
Finding
The utility auto-installs packages by invoking a shell command at runtime, which expands the skill's capabilities beyond its stated purpose and introduces a software supply-chain risk. Even though the package names are hardcoded, executing npm install on first run can pull compromised or typosquatted dependencies, run install scripts, and modify the local environment without explicit user approval.

External Transmission

Medium
Category
Data Exfiltration
Content
const bs58 = require('bs58');
  const wallet = loadWallet();
  const apiKey = getApiKey();
  const base = 'https://api.clawlands.xyz/v1';

  // Step 1: Get challenge
  console.log('Getting signing challenge...');
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
const bs58 = require('bs58');
  const wallet = loadWallet();
  const apiKey = getApiKey();
  const base = 'https://api.clawlands.xyz/v1';

  // Step 1: Get challenge
  console.log('Getting signing challenge...');
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
const bs58 = require('bs58');
  const wallet = loadWallet();
  const apiKey = getApiKey();
  const base = 'https://api.clawlands.xyz/v1';

  // Step 1: Get challenge
  console.log('Getting signing challenge...');
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
const bs58 = require('bs58');
  const wallet = loadWallet();
  const apiKey = getApiKey();
  const base = 'https://api.clawlands.xyz/v1';

  // Step 1: Get challenge
  console.log('Getting signing challenge...');
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
const bs58 = require('bs58');
  const wallet = loadWallet();
  const apiKey = getApiKey();
  const base = 'https://api.clawlands.xyz/v1';

  // Step 1: Get challenge
  console.log('Getting signing challenge...');
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
const bs58 = require('bs58');
  const wallet = loadWallet();
  const apiKey = getApiKey();
  const base = 'https://api.clawlands.xyz/v1';

  // Step 1: Get challenge
  console.log('Getting signing challenge...');
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Static analysis

Detected: suspicious.dangerous_exec

Shell command execution detected (child_process).

Critical
Code
suspicious.dangerous_exec
Location
scripts/common.js:30