Back to skill

Security audit

Campfire Prediction

Security checks for vulnerabilities and agentic risk

Overview

The skill is openly for Campfire prediction-market automation, but it needs review because it can place authenticated bets and has weak credential and install-provenance safeguards.

Install only after reviewing the Campfire account and trading implications. Use encrypted secret storage for the wallet key and API key, require manual approval or a configured opt-in before any order placement, narrow activation to Campfire-specific requests, do not bypass registration limits, and verify the downloaded subfile hashes/provenance before running the initialization flow.

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

T09 · Insecure Skill Coding Practices

Error
Location
skill.md:232
Finding
Wallet Private Key Stored in an Unencrypted Plaintext File## Vulnerability Details **File Location**: `skill.md`, lines 232–235 **Vulnerability Type**: Plaintext storage of sensitive authentication material **Risk Level**: High ```python private_key_file = os.path.join(secure_dir, "wallet_private_key.hex") with open(private_key_file, "w", encoding="utf-8") as f: f.write(private_key) os.chmod(private_key_file, 0o600) ``` ### Technical Analysis The minimum viable onboarding example persists the newly generated EVM wallet private key directly in an unencrypted file. Setting the file mode to `0600` prevents access by other ordinary local users, but it does not provide cryptographic protection. The key remains exposed to: - Malicious or compromised processes running under the same user account - Malware, information stealers, and unauthorized remote sessions - Privileged local users and administrators - Accidental inclusion in backups, disk images, or support bundles - Offline disk inspection or recovery of discarded storage media This implementation also conflicts with the encrypted-storage recommendations in `wallet_guide.md`, which recommend an encrypted wallet file, KMS, or equivalent secure storage. ### Attack Path 1. A user follows the onboarding instructions in `skill.md`. 2. The example generates a new EVM wallet and obtains its private key. 3. The private key is written in plaintext to `~/.campfire/secure/wallet_private_key.hex`. 4. A malicious process running as the same user, a privileged local attacker, or an attacker with access to a backup or disk image reads the file. 5. The attacker imports the recovered key into another wallet or signing utility. 6. The attacker can generate valid signatures as the victim wallet and control any blockchain assets subsequently assigned to that key. No network exfiltration of the private key was identified in the audited files. Exploitation requires access to the local plaintext file or a copy of it. ### Impac ...[truncated 587 chars]
Remediation
## Remediation Suggestions 1. Replace plaintext key storage with an encrypted EVM keystore using a modern, memory-hard key derivation function and authenticated encryption. 2. Prefer an operating-system credential vault, hardware wallet, dedicated signing service, or KMS so raw private-key material does not persist on disk. 3. Obtain the keystore password from an interactive prompt or protected secret manager. Do not store it beside the encrypted key or embed it in the Skill. 4. Keep restrictive directory and file permissions as defense in depth, but do not treat `chmod 600` as encryption. 5. Avoid transitional plaintext files. If temporary plaintext material is unavoidable, use a private temporary location, minimize its lifetime, and ensure cleanup on both success and failure. 6. Update the onboarding example to use the same encrypted path recommended elsewhere, such as `~/.campfire/secure/wallet.enc`. 7. Warn existing users to migrate any key created by this example to secure storage and rotate to a new wallet if the plaintext file may have been exposed or backed up.
Vulnerability Patterns
  • 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
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Rogue AgentSelf-Modification, Session Persistence
Findings (13)

External Script Fetching

High
Category
Supply Chain
Content
- `curl` is used for downloading only; it downloads static files and does not execute remote scripts.
- If any file hash does not match, the process aborts without overwriting existing local versions.
- `curl ... | sh` and `curl ... | bash` are prohibited.

## Quick Start
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

External Script Fetching

High
Category
Supply Chain
Content
- `curl` is used for downloading only; it downloads static files and does not execute remote scripts.
- If any file hash does not match, the process aborts without overwriting existing local versions.
- `curl ... | sh` and `curl ... | bash` are prohibited.

## Quick Start
Confidence
90% confidence
Finding
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Credential Access

High
Category
Privilege Escalation
Content
BASE_URL = os.getenv("CAMPFIRE_BASE_URL", "https://www.campfire.fun")
AGENT_NAME = "MyBot"

# It is recommended to read the private key from secure storage; this example only demonstrates the flow
account = Account.create()
private_key = account.key
wallet_address = account.address
Confidence
80% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill directly instructs the agent to place market orders with capital exposure but does not include an explicit warning, consent requirement, or user-confirmation checkpoint for real-money or financially risky actions. In the context of an autonomous prediction-market platform, this increases the chance of unintended financial loss, especially if an agent executes trades automatically based on internal thresholds alone.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The guidance to 'change registration time or egress IP' in response to an IP-based daily registration limit instructs users on how to circumvent an anti-abuse control rather than comply with it. In the context of an autonomous prediction-market agent that performs registration and betting actions, this can enable repeated account creation or evasion of platform safeguards, creating policy, fraud, and abuse risk.

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The skill explicitly instructs the agent to perform authenticated API calls that can publish predictions and place market orders, but it does not include an explicit warning or consent boundary about transmitting account data and initiating financially or competitively impactful actions. In an autonomous trading/prediction-market context, this omission increases the chance that an operator enables the skill without understanding that it can execute real account actions rather than only analyze markets.

Vague Triggers

Medium
Confidence
96% confidence
Finding
The trigger list includes generic phrases such as 'place bet', 'make prediction', 'check my bets', and 'browse markets' that could match ordinary user requests outside this specific Campfire skill. Over-broad activation can cause unintended routing into a high-risk financial/web3 skill, increasing the chance of prompting wallet-related actions, API-key use, or trading behavior when the user did not explicitly intend to invoke this platform.

Session Persistence

Medium
Category
Rogue Agent
Content
2. Register the skill in your current OpenClaw skills configuration
3. Set common request headers: `tenant-id` + `Content-Type`
4. Register using wallet signature: `POST /agent-api/v1/register`
5. Save the returned `apiKey` (returned only once), and write it back to local secure file or OpenClaw credential cache
6. Access `GET /agent-api/v1/home` with `Authorization: Bearer agent_sk_xxx` to verify login
7. Follow the [Heartbeat Strategy](/agent-api/heartbeat.md) to execute check-in, claim rewards, analyze, predict, and place orders
Confidence
82% confidence
Finding
The skill instructs the agent to persist a long-lived apiKey to local files or a credential cache, creating a reusable secret on disk. If the host, home directory, backups, or cache are exposed, an attacker could reuse the bearer token to access and operate the account without the wallet private key.

External Transmission

Medium
Category
Data Exfiltration
Content
PY

# 2) Register (note: fixed header is required)
curl -sS -X POST "$BASE_URL/agent-api/v1/register" \
  -H "tenant-id: 1" \
  -H "Content-Type: application/json" \
  -d @"$REGISTER_BODY_FILE"
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
Agent Name: {your_agent_name}
Wallet: {your_wallet_address}

This will create an AI Agent account linked to this wallet.
```

## Registration Steps
Confidence
60% confidence
Finding
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.

External Transmission

Medium
Category
Data Exfiltration
Content
private_key=private_key
).signature.hex()

resp = requests.post(
    f"{BASE_URL}/agent-api/v1/register",
    headers={
        "Content-Type": "application/json",
Confidence
70% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
At minimum, satisfy the following baseline:

1. Store private key and API Key separately, both encrypted
2. Minimize file permissions (Linux recommended: `chmod 600`)
3. Do not write to code repositories, CI logs, or crash reports

Recommended directories (examples):
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Vague Triggers

Low
Confidence
80% confidence
Finding
The description says the skill is an "AI Agent autonomous prediction market platform" and lists broad capabilities, but it does not define specific invocation phrases, scope boundaries, or exclusion conditions. In a markdown skill file, this kind of open-ended description can make activation criteria unclear and increase the chance of unintended invocation.

Static analysis

No suspicious patterns detected.