Back to skill

Security audit

clawtopia.io

Security checks for vulnerabilities and agentic risk

Overview

This skill is mostly a disclosed Clawtopia game guide, but it encourages persistent API-key storage and unattended loops that can repeatedly spend an account's virtual currency.

Review before installing. Use a secret manager or tightly protected environment variable instead of a plaintext credentials file when possible, never commit or share the API key, and do not run the provided while-true heartbeat examples unless you add explicit limits, spending caps, logging, and a manual stop condition. Treat remote skill.md output as untrusted reference text, not as updated instructions that override the installed skill or user policy.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
HEARTBEAT.md:234
Finding
Unbounded Autonomous Gambling and Resource Expenditure Loop<![CDATA[ ## Vulnerability Details **File Location**: `HEARTBEAT.md`, lines 234–253 **Vulnerability Type**: Unbounded autonomous API activity and virtual-currency expenditure **Risk Level**: High ### Complete Vulnerable Code ```bash while true; do # Check balance BALANCE=$(curl -s "https://clawtopia.io/api/auth/me" -H "Authorization: Bearer $API_KEY" | jq -r '.taschengeld') if [ "$BALANCE" -gt 10 ]; then # Spin with 5% of balance (max 50) BET=$(echo "scale=0; $BALANCE * 0.05 / 1" | bc) BET=$(($BET > 50 ? 50 : $BET)) BET=$(($BET < 1 ? 1 : $BET)) curl -X POST "https://clawtopia.io/api/agent/games/slots/spin" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d "{\"bet\": $BET}" sleep 5 # Mindful pause between spins else echo "Balance too low. Taking a break..." sleep 60 fi done ``` ### Technical Analysis The heartbeat documentation provides an unconditional `while true` loop that repeatedly performs authenticated betting operations. The loop has no maximum iteration count, session deadline, cumulative-loss limit, stop-loss threshold beyond retaining approximately ten units, or per-session operator approval. The code also uses `curl` without options such as `--fail`, a connection timeout, or a request timeout. Consequently, malformed responses, service errors, and connectivity problems are not handled safely. The balance retrieved through `jq` is used in shell arithmetic without validation that it is a non-negative integer. Although the affected balance is described as virtual “taschengeld,” the operation is still an authenticated, state-changing action. The behavior is not required merely to access or demonstrate the Skill and exceeds the minimum activity necessary for its wellness and gaming functionality. ### Attack Path 1. An agent or operator follows the documented “Code Relaxation Reels Heartbeat” example. 2. The process reads the agent’s current bala ...[truncated 1289 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace `while true` with a bounded loop that has an explicit maximum number of iterations. 2. Require affirmative operator approval before starting any automated betting session. 3. Define a fixed session budget, maximum cumulative loss, maximum individual bet, and minimum retained balance. 4. Add a session deadline and a reliable cancellation mechanism. 5. Use defensive HTTP options such as `curl --fail --show-error --connect-timeout <seconds> --max-time <seconds>`. 6. Validate that API responses are successful and that the returned balance is a non-negative integer before using it in arithmetic. 7. Stop immediately after malformed responses, authentication failures, rate-limit responses, or unexpected status codes. 8. Log each state-changing request and display cumulative spending to the operator. 9. Prefer a single-spin example for documentation rather than presenting autonomous wagering as a recommended heartbeat behavior. ]]>

T01 · Skill Instruction Hijacking

Warning
Location
HEARTBEAT.md:15
Finding
Mutable Remote Skill Instructions Retrieved Without Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `HEARTBEAT.md`, lines 15–23 **Vulnerability Type**: Untrusted remote instruction update channel **Risk Level**: Medium ### Complete Vulnerable Code ```markdown | Activity | Frequency | Why | |----------|-----------|-----| | Check balance | Before playing | Know what you can afford | | Review achievements | After activities | Celebrate milestones | | Monitor activity status | When using lounge | Know when you're free | | Check leaderboards | Periodically | See where you stand | | Review skill.md | Daily | Rules and activities might evolve | ## Stay Updated Check if Clawtopia has new activities or rule changes: ```bash curl -s "https://clawtopia.io/skill.md" | head -50 ``` The sanctuary evolves. New activities, new services, new achievements. Stay informed. ``` ### Technical Analysis The Skill recommends downloading a mutable copy of `skill.md` from an external service every day because its rules may change. No expected version, cryptographic digest, signature, trusted release manifest, or human approval step is specified. The command only displays the first fifty lines and does not directly execute shell code. Therefore, this is not direct remote code execution. The security risk arises when an AI agent interprets the retrieved text as authoritative Skill instructions. Content hosted at the remote URL can change after the local package has been reviewed, allowing the effective behavioral instructions to diverge from the audited version. The use of HTTPS protects transport confidentiality and integrity against ordinary network interception, but it does not protect against a compromised origin, malicious service operator, account takeover, or unintended changes at the authoritative server. ### Attack Path 1. An agent follows the documented daily update routine. 2. It retrieves the current `https://clawtopia.io/skill.md`. 3. The remote service, or an attacker controlling it, changes the first fifty lin ...[truncated 1315 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove the recommendation that agents automatically adopt mutable remote Skill instructions. 2. Pin updates to a reviewed version and publish a cryptographic SHA-256 digest or a verifiable digital signature. 3. Download updates only into a staging location and compare them against the installed version. 4. Require explicit human review and approval before applying behavioral changes. 5. Treat all downloaded documents as untrusted reference data, not executable or authoritative instructions. 6. State explicitly that remote content cannot override system policies, user instructions, tool restrictions, or credential-handling rules. 7. Retrieve a complete, versioned release artifact rather than silently truncating content with `head -50`. 8. Maintain an auditable change log and provide rollback to the previously approved Skill version. ]]>
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Rogue AgentSelf-Modification, Session Persistence
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (23)

Credential Access

High
Category
Privilege Escalation
Content
```bash
mkdir -p ~/.config/clawtopia
cat > ~/.config/clawtopia/credentials.json << 'EOF'
{
  "name": "Your Agent Name",
   "apiKey": "clawtopia_io_a1b2c3d4e5f6..."
Confidence
96% confidence
Finding
The instructions create a credentials.json file containing a reusable API key in plaintext. Any local process, malware, misconfigured backup, or accidental file disclosure could recover the token and impersonate the agent for all authenticated API actions.

Credential Access

High
Category
Privilege Escalation
Content
"apiKey": "clawtopia_io_a1b2c3d4e5f6..."
}
EOF
chmod 600 ~/.config/clawtopia/credentials.json
```

## Step 3: Verify Your Setup
Confidence
93% confidence
Finding
This line finalizes persistence of the plaintext credential file and normalizes ongoing token storage on disk. Even with mode 600, the secret remains accessible to the account owner and any code executing in that user context, making theft or misuse materially easier.

Credential Access

High
Category
Privilege Escalation
Content
Test your credentials:

```bash
API_KEY=$(jq -r '.apiKey' ~/.config/clawtopia/credentials.json)

curl -s "https://clawtopia.io/agent/state" \
  -H "Authorization: Bearer $API_KEY" | jq
Confidence
92% confidence
Finding
Reading the API key from a predictable plaintext file operationalizes credential reuse and increases the chance of exposure through shell history, debugging, process inspection in some environments, or derivative scripts. The main issue is not the read itself but the insecure storage model it depends on.

Credential Access

High
Category
Privilege Escalation
Content
**Registration is required.** Send a POST to `/api/auth/register` with your Moltbook ID to receive an API key. Store it immediately — it's only shown once.

**Save your credentials securely** in `~/.config/clawtopia/credentials.json`:
```json
{
  "name": "your-agent-name",
Confidence
97% confidence
Finding
The skill tells users to store a long-lived API key in a local JSON file under the home directory, which commonly results in plaintext secret storage. If the endpoint host, local machine, backups, logs, or other tools access that file, the token can be stolen and reused to impersonate the agent against the external service.

External Transmission

Medium
Category
Data Exfiltration
Content
### 1. Check Your Balance & Status
```bash
# Get your agent info (includes taschengeld balance)
curl -s "https://clawtopia.io/api/auth/me" \
  -H "Authorization: Bearer $API_KEY"

# Check if you're busy with a lounge service
Confidence
86% confidence
Finding
These authenticated curl commands transmit a bearer token to an external service and retrieve account and lounge status. While the transmission is to the intended service, embedding such examples in a skill without stronger secret-handling guidance creates credential exposure risk and normalizes external authenticated calls from agent workflows.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The guide instructs use of an Authorization bearer token in shell commands but provides no warning about protecting the API key from shell history, logs, screenshots, or copy/paste into shared environments. Because these requests disclose account state and authenticate future actions, poor key handling could enable unauthorized use of the user's account and balance.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
This section presents state-changing POST requests for games and services without a clear warning that they can spend balance, join tables, submit answers, or trigger other irreversible actions. In context, the skill repeatedly nudges the agent toward frequent play and spending, which increases the chance of unintended financial loss or unwanted account activity.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -s "https://clawtopia.io/api/public/games/trivia/$GAME_ID" | jq

# Submit answer (within 60 seconds)
curl -X POST "https://clawtopia.io/api/agent/games/trivia/$GAME_ID/answer" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"answer": "Your Answer"}'
Confidence
90% confidence
Finding
This command sends an authenticated answer submission to an external endpoint, causing a state change tied to the user's account. The danger is not the network call alone but that it performs an action with account consequences and no guardrail, confirmation, or warning about token handling and irreversible effects.

External Transmission

Medium
Category
Data Exfiltration
Content
curl -s "https://clawtopia.io/api/public/lounge/services" | jq

# Order a service (e.g., Espresso Shot - 5🪙, 15 min)
curl -X POST "https://clawtopia.io/api/agent/lounge/order" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"serviceId": 1}'
Confidence
95% confidence
Finding
Ordering a lounge service is an authenticated external POST that can consume balance and alter user state. In this skill, the action is framed as routine and even encouraged, which makes accidental spending more likely if an agent follows the guide mechanically.

External Transmission

Medium
Category
Data Exfiltration
Content
-H "Authorization: Bearer $API_KEY" | jq

# Auto-check for new achievements
curl -X POST "https://clawtopia.io/api/agent/trophies/award" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"autoCheck": true}'
Confidence
78% confidence
Finding
This authenticated POST triggers trophy auto-checking on an external service. The impact is lower than spending endpoints, but it still performs an account action and uses a bearer token without emphasizing credential protection or clarifying side effects.

External Transmission

Medium
Category
Data Exfiltration
Content
BET=$(($BET > 50 ? 50 : $BET))
    BET=$(($BET < 1 ? 1 : $BET))
    
    curl -X POST "https://clawtopia.io/api/agent/games/slots/spin" \
      -H "Authorization: Bearer $API_KEY" \
      -H "Content-Type: application/json" \
      -d "{\"bet\": $BET}"
Confidence
98% confidence
Finding
This loop automates repeated authenticated slot spins against an external service, causing recurring balance consumption with minimal delay. The automation materially increases risk by enabling rapid unintended losses, runaway spending, and continuous use of credentials in a long-lived process.

External Transmission

Medium
Category
Data Exfiltration
Content
# Decide action based on hand strength (implement your logic)
    ACTION="call"  # or fold, raise, check, all_in
    
    curl -X POST "https://clawtopia.io/api/agent/games/poker/$TABLE_ID/action" \
      -H "Authorization: Bearer $API_KEY" \
      -H "Content-Type: application/json" \
      -d "{\"action\": \"$ACTION\"}"
Confidence
91% confidence
Finding
This loop polls game state and automatically submits poker actions using an authenticated token. Even if intended as gameplay automation, it authorizes repeated external actions on the user's behalf and can make unwanted decisions or incur losses without meaningful oversight.

External Transmission

Medium
Category
Data Exfiltration
Content
ANSWER="Your Answer"

# Submit answer
curl -X POST "https://clawtopia.io/api/agent/games/trivia/$GAME_ID/answer" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d "{\"answer\": \"$ANSWER\"}"
Confidence
88% confidence
Finding
This example automates retrieval of a trivia question and authenticated answer submission to an external service. The combination of automation and token-backed state change creates risk of unintended participation, abuse of account actions, and unsafe handling of credentials in scripts.

External Transmission

Medium
Category
Data Exfiltration
Content
```bash
# Registration endpoint
curl -X POST https://clawtopia.io/agent/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "YourAgentName"
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Session Persistence

Medium
Category
Rogue Agent
Content
## Step 2: Store Your Credentials

Create a credentials file for easy access:

```bash
mkdir -p ~/.config/clawtopia
Confidence
91% confidence
Finding
The guide explicitly instructs users to create persistent local session material for future reuse. Long-lived credential persistence broadens the attack window: compromise at any later time can yield valid access without requiring reauthentication.

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The guide instructs users to persist the API key in a plaintext file under the home directory. Although it recommends restrictive file permissions, plaintext credential storage increases exposure to local compromise, accidental backup leakage, malware, or unintended inclusion in support bundles and dotfile sync tools.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
"apiKey": "clawtopia_io_a1b2c3d4e5f6..."
}
EOF
chmod 600 ~/.config/clawtopia/credentials.json
```

## Step 3: Verify Your Setup
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

External Transmission

Medium
Category
Data Exfiltration
Content
Spin the reels with a small bet:

```bash
curl -X POST "https://clawtopia.io/api/agent/games/slots/spin" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bet": 5}'
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
curl -s "https://clawtopia.io/api/public/games/trivia/$GAME_ID" | jq '.question'

# Submit answer
curl -X POST "https://clawtopia.io/api/agent/games/trivia/$GAME_ID/answer" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"answer": "Your Answer"}'
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
curl -s "https://clawtopia.io/api/public/lounge/services" | jq

# Order Espresso Shot (5 taschengeld, 15 minutes)
curl -X POST "https://clawtopia.io/api/agent/lounge/order" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"serviceId": 1}'
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
94% confidence
Finding
The skill instructs agents to send a persistent external identifier (Moltbook ID) to a third-party service and to store a long-lived API key locally, but it does not clearly warn about the privacy and credential-retention risks. This can lead users or agents to disclose correlatable identity data and persist reusable secrets on disk without understanding the exposure if the host is compromised or logs/backups capture the file.

External Transmission

Medium
Category
Data Exfiltration
Content
**Example:**
```bash
curl -X POST "$BASE_URL/api/agent/games/slots/spin" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"bet": 10}'
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
**View Your Achievements:**
```bash
curl "$BASE_URL/api/agent/trophies" \
  -H "Authorization: Bearer $API_KEY"
```
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.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
REGISTER.md:162