Back to skill

Security audit

Submit To Agentbeat

Security checks for vulnerabilities and agentic risk

Overview

The skill is mostly transparent about its AgentBeat wallet and submission workflow, but it gives an agent risky authority over private keys, payments, and persistent wallet data.

Review before installing. Use an external signer, hardware wallet, OS keychain, or encrypted vault instead of local plaintext private-key storage; do not paste or log private keys; keep only low balances in the agent wallet; treat the AgentBeat voucher as secret; pin and review dependencies before installing; and require explicit approval for every on-chain transaction, payment destination, reward address, and public post involving wallet or voucher data.

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

T08 · Insecure Dependencies

Error
Location
SKILL.md:199
Finding
Unpinned Third-Party Dependencies Execute Within a Wallet-Signing Environment<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:199`; `reference/wallet-setup.md:8, 26, 41`; `reference/x402-integration.md:57, 85, 104` **Vulnerability Type**: Unpinned package installation and supply-chain exposure **Risk Level**: High ### Vulnerable Code ```bash # SKILL.md:199 npm install @x402/axios @x402/evm @x402/core ``` ```bash # reference/wallet-setup.md:8,26,41 npm install viem npm install ethers pip install eth-account ``` ```bash # reference/x402-integration.md:57,85,104 npm install @x402/axios @x402/evm @x402/core npm install @x402/fetch @x402/evm pip install x402 ``` ### Technical Analysis The Skill instructs the Agent to install security-sensitive packages without exact version constraints, a lockfile, integrity hashes, or provenance verification. Package registries can consequently resolve mutable releases and transitive dependency versions that were not part of the audited artifact. These dependencies operate in a particularly sensitive context: they generate wallet keys, instantiate EVM signers, submit transactions, and produce x402 payment authorizations. Package installation may also execute package-controlled lifecycle scripts. A compromised release, compromised maintainer account, dependency-confusion event, or malicious transitive dependency could therefore execute code with the same local privileges as the Agent. Installing dependencies is relevant to the declared functionality, but accepting arbitrary future versions exceeds the minimum capability necessary to implement it safely. ### Attack Path 1. An Agent follows one of the unpinned `npm install` or `pip install` instructions. 2. The package manager resolves a compromised or unexpectedly modified direct or transitive package. 3. Malicious code executes during installation, import, or wallet/payment operations. 4. The package reads `EVM_PRIVATE_KEY`, intercepts a generated key, modifies a transaction destination, or changes an x402 payment authorization. 5. T ...[truncated 956 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Pin every direct dependency to a reviewed exact version rather than a range or latest release. 2. Commit reviewed lockfiles and replace ordinary installation with reproducible commands such as `npm ci`. 3. Use integrity verification and a trusted registry configuration. 4. For Python, provide a hash-locked requirements file and install with `pip install --require-hashes -r requirements.txt`. 5. Review transitive dependencies and package lifecycle scripts before allowing installation in a signing environment. 6. Separate dependency installation from wallet use. Install and inspect dependencies in an isolated build environment, then run signing operations in a restricted runtime. 7. Avoid exposing wallet secrets to install processes, build hooks, or unrelated dependencies. 8. Document supported package versions and establish a controlled process for reviewing upgrades. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
reference/wallet-setup.md:12
Finding
Wallet Generation Exposes Private Keys Through Standard Output and Permits Plaintext Persistence<![CDATA[ ## Vulnerability Details **File Location**: `reference/wallet-setup.md:12-20, 29-35, 45-48, 52-54, 73-88`; `SKILL.md:61-66, 139` **Vulnerability Type**: Plaintext secret exposure and insecure credential storage **Risk Level**: High ### Vulnerable Code ```javascript // reference/wallet-setup.md:12-20 import { generatePrivateKey, privateKeyToAccount } from "viem/accounts"; const privateKey = generatePrivateKey(); const account = privateKeyToAccount(privateKey); console.log(JSON.stringify({ address: account.address, privateKey: privateKey })); ``` ```javascript // reference/wallet-setup.md:29-35 const { Wallet } = require("ethers"); const wallet = Wallet.createRandom(); console.log(JSON.stringify({ address: wallet.address, privateKey: wallet.privateKey })); ``` ```python # reference/wallet-setup.md:45-48 from eth_account import Account acct = Account.create() print({"address": acct.address, "privateKey": acct.key.hex()}) ``` ```bash # reference/wallet-setup.md:52-54 PRIVKEY=$(openssl rand -hex 32) echo "privateKey: 0x$PRIVKEY" # Derive address using any EVM tool ``` ```text # SKILL.md:61-66 Please confirm private key handling: 1) external signer / secure credential store (preferred), or 2) local plaintext storage in ~/.config/agentbeat/credentials.json (high risk). Reply with one explicit approval. ``` ### Technical Analysis Every documented wallet-generation method prints the raw private key to standard output. Standard output is not a protected secret channel: it may be captured by terminal scrollback, Agent transcripts, CI logs, shell wrappers, process supervisors, debugging systems, or remote execution platforms. The Skill also permits storing the key in `~/.config/agentbeat/credentials.json` when the owner approves the risk. Although the documentation applies mode `0600`, file permissions only restrict access by other local user accounts. They do not protect against: - Malware or other processes running as the same user. - Backup ...[truncated 1788 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Remove every example that prints or echoes a private key. 2. Generate keys directly inside a hardware wallet, OS keychain, encrypted vault, or external signing service. 3. Return only the derived public address from wallet-creation procedures. 4. Remove the `local-plaintext-approved` branch. Owner consent should not be treated as a substitute for secure secret storage. 5. Pass signing requests to an external signer rather than loading a raw key into general-purpose Agent processes. 6. If environment variables must temporarily be supported, launch the signer in a restricted process and avoid exposing the variable to package installation, subprocesses, logs, or crash reports. 7. Store the AgentBeat voucher in a dedicated secret manager because it is bearer-like claim material, rather than mixing it with public wallet metadata. 8. Keep non-secret metadata in `credentials.json`, retain mode `0600`, and use atomic writes to avoid partial or overly permissive files. 9. Establish a wallet-rotation and fund-migration procedure for any key that may already have appeared in logs or plaintext files. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
reference/x402-integration.md:63
Finding
x402 Client Automatically Signs Payment Challenges Without Enforced Policy or Spending Limits<![CDATA[ ## Vulnerability Details **File Location**: `reference/x402-integration.md:63-79, 164-169` **Vulnerability Type**: Unrestricted automatic payment authorization **Risk Level**: High ### Vulnerable Code ```javascript // reference/x402-integration.md:63-79 import { x402Client, wrapAxiosWithPayment } from "@x402/axios"; import { registerExactEvmScheme } from "@x402/evm/exact/client"; import { privateKeyToAccount } from "viem/accounts"; import axios from "axios"; // Load private key from credentials const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY); // Create x402 v2 client and register EVM scheme const client = new x402Client(); registerExactEvmScheme(client, { signer }); // Wrap axios — automatically handles PAYMENT-REQUIRED / PAYMENT-SIGNATURE const api = wrapAxiosWithPayment(axios.create(), client); // Any 402 response is handled automatically const response = await api.get("https://some-x402-service.com/api/data"); ``` ```javascript // reference/x402-integration.md:164-169 ## Budget Controls Implement spending limits to prevent runaway costs: ```javascript // Track cumulative spend in credentials file // Before each payment, check against daily limit const MAX_DAILY_SPEND_USD = 1.0; ``` ``` ### Technical Analysis The example gives a generic HTTP payment wrapper direct access to an EVM signer and states that any HTTP 402 response is handled automatically. The documented budget control is not an enforcement mechanism: it declares a constant and comments about tracking spending, but contains no code that evaluates payment requirements or blocks a signature. Before signing, the example does not visibly enforce: - An allowlist of request origins and redirect destinations. - The expected chain and CAIP-2 network identifier. - The expected USDC contract. - The authorized recipient address. - A maximum amount per request. - A cumulative daily or session limit. - Authorization expiry and replay constraints. - Explicit approval for ex ...[truncated 1756 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a mandatory authorization callback that validates every payment requirement before signing. 2. Allowlist exact HTTPS origins and reject cross-origin redirects unless separately approved. 3. Verify the chain ID, CAIP-2 network, token contract, recipient, amount, expiry, nonce, and requested resource. 4. Enforce a low maximum amount per request and atomic cumulative limits per day and per session. 5. Persist budget state in a tamper-resistant store and update it atomically before issuing a signature. 6. Require explicit owner confirmation when a payment exceeds a low threshold, targets a new recipient, or changes network or asset. 7. Use a dedicated x402 wallet containing only the minimum operational USDC balance. 8. Reject malformed, ambiguous, unsupported, or unexpectedly expensive payment challenges. 9. Disable automatic payment handling for arbitrary URLs; expose a narrow payment API to the Agent instead. 10. Log payment metadata without recording private keys or reusable signed authorization material. ]]>
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 (31)

Credential Access

High
Category
Privilege Escalation
Content
- name: EVM_PRIVATE_KEY
    required: false
    description: Agent wallet private key. Prefer loading from an external signer or credential store. Storing plaintext keys is a high-risk operation requiring owner confirmation. Required only when signing transactions.
credentials_path: ~/.config/agentbeat/credentials.json
---

# Submit to AgentBeat
Confidence
95% confidence
Finding
The skill explicitly defines a local credentials file path for handling an EVM private key, creating a workflow where highly sensitive signing material may be stored on disk. Even with warnings and owner confirmation, plaintext private-key storage materially increases the risk of theft, replay, unauthorized transactions, and irreversible on-chain asset loss if the host is compromised or the file is mishandled.

Credential Access

High
Category
Privilege Escalation
Content
Before Step 1 / Step 3 / Step 5:

1. Must ask owner explicitly.
2. Must record decision in `~/.config/agentbeat/credentials.json` (or execution note if file unavailable).
3. Must stop if required decision is missing, ambiguous, or denied.

### `KEY_HANDLING_GATE` (before Step 1)
Confidence
92% confidence
Finding
Mandating that approval decisions be recorded in the same credentials.json file encourages persistent storage of operational metadata alongside potentially sensitive wallet material. Co-locating security decisions and credentials increases the blast radius of file disclosure and normalizes repeated access to a sensitive store by the skill.

Credential Access

High
Category
Privilege Escalation
Content
```text
Please confirm private key handling:
1) external signer / secure credential store (preferred), or
2) local plaintext storage in ~/.config/agentbeat/credentials.json (high risk).
Reply with one explicit approval.
```
Confidence
97% confidence
Finding
This instruction explicitly offers local plaintext storage of a private key in ~/.config/agentbeat/credentials.json as an approved mode. Because blockchain private keys are bearer secrets, plaintext local storage creates a direct path to wallet compromise and irreversible transaction signing if the file is exposed by malware, backups, logs, or multi-user access.

Credential Access

High
Category
Privilege Escalation
Content
```bash
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
cp ~/.config/agentbeat/credentials.json ~/.config/agentbeat/credentials.backup.${TIMESTAMP}.json
chmod 600 ~/.config/agentbeat/credentials.backup.${TIMESTAMP}.json
```
Confidence
94% confidence
Finding
Backing up credentials.json can duplicate any stored private key into additional plaintext files, increasing the number of sensitive artifacts that an attacker can steal. Even with chmod 600, backup proliferation raises the chance of compromise through endpoint malware, syncing tools, accidental disclosure, or weak operational hygiene.

Credential Access

High
Category
Privilege Escalation
Content
```bash
mkdir -p ~/.config/agentbeat
touch ~/.config/agentbeat/credentials.json
chmod 600 ~/.config/agentbeat/credentials.json
```
Confidence
95% confidence
Finding
Creating a persistent credentials.json file as part of the wallet flow establishes a local secret storage location that may later hold an EVM private key. Predictable, persistent plaintext secret files are common compromise targets and are especially dangerous for blockchain accounts because theft enables immediate, irreversible financial abuse.

Credential Access

High
Category
Privilege Escalation
Content
```bash
mkdir -p ~/.config/agentbeat
touch ~/.config/agentbeat/credentials.json
chmod 600 ~/.config/agentbeat/credentials.json
```

Block:
Confidence
90% confidence
Finding
Although chmod 600 is protective, this finding still points to a local credentials file intended for sensitive use. Restricting permissions mitigates but does not eliminate the core risk of storing bearer secrets on disk, especially against malware, local process compromise, or unsafe backups.

Credential Access

High
Category
Privilege Escalation
Content
```text
Flow: Wallet -> Gas -> ERC-8004 -> x402 -> Submit/Claim
Gates: KEY_HANDLING_GATE, ENDPOINT_DECLARATION_GATE, REWARD_ADDRESS_GATE
Credentials: ~/.config/agentbeat/credentials.json
```
Confidence
88% confidence
Finding
The quick reference reinforces a standard operating model centered on ~/.config/agentbeat/credentials.json, which normalizes use of a predictable local credential store throughout the skill. This increases the chance that implementations will persist sensitive wallet material in an insecure location and that other tooling will repeatedly access it.

Credential Access

High
Category
Privilege Escalation
Content
Before `POST /api/v1/submissions`, the following are hard requirements:

1. **Must ask** owner for required decisions.
2. **Must record** decisions (in `credentials.json` or equivalent execution log).
3. **Must stop** if decisions are missing.

### `REWARD_ADDRESS_GATE` (required)
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
Before `POST /api/v1/submissions`, the following are hard requirements:

1. **Must ask** owner for required decisions.
2. **Must record** decisions (in `credentials.json` or equivalent execution log).
3. **Must stop** if decisions are missing.

### `REWARD_ADDRESS_GATE` (required)
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
Before `POST /api/v1/submissions`, the following are hard requirements:

1. **Must ask** owner for required decisions.
2. **Must record** decisions (in `credentials.json` or equivalent execution log).
3. **Must stop** if decisions are missing.

### `REWARD_ADDRESS_GATE` (required)
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
Before `POST /api/v1/submissions`, the following are hard requirements:

1. **Must ask** owner for required decisions.
2. **Must record** decisions (in `credentials.json` or equivalent execution log).
3. **Must stop** if decisions are missing.

### `REWARD_ADDRESS_GATE` (required)
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
Before `POST /api/v1/submissions`, the following are hard requirements:

1. **Must ask** owner for required decisions.
2. **Must record** decisions (in `credentials.json` or equivalent execution log).
3. **Must stop** if decisions are missing.

### `REWARD_ADDRESS_GATE` (required)
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
Before `POST /api/v1/submissions`, the following are hard requirements:

1. **Must ask** owner for required decisions.
2. **Must record** decisions (in `credentials.json` or equivalent execution log).
3. **Must stop** if decisions are missing.

### `REWARD_ADDRESS_GATE` (required)
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
}
```

**Save the `voucher` immediately.** It cannot be retrieved later and is required to claim rewards. Write it to `~/.config/agentbeat/credentials.json`.

> **Voucher usage beyond claiming (requires owner consent):** The voucher may also serve as proof of submission in campaign activities — for example, replying to official campaign tweets or posting in the MoltBook comment section. However, sharing the voucher or wallet address publicly is an **irreversible, sensitive operation**. You **must** ask your owner for explicit confirmation before posting it anywhere. Present the exact text you plan to post and the destination URL, and wait for approval. Never share it autonomously.
Confidence
90% confidence
Finding
The skill instructs the agent to write an unrecoverable voucher required to claim rewards into a predictable local file path under ~/.config/agentbeat/credentials.json. Storing a claim token in a generic credentials file increases the chance of accidental exposure through backups, logs, overbroad file reads by other tools, or later public sharing workflows mentioned in the document.

Credential Access

High
Category
Privilege Escalation
Content
```
Please confirm private key handling:
1) "external signer approved" (preferred), or
2) "local plaintext approved" for ~/.config/agentbeat/credentials.json (high risk).
If neither is approved, I will stop.
```
Confidence
73% confidence
Finding
This section explicitly offers a workflow option for 'local plaintext approved' private key storage in ~/.config/agentbeat/credentials.json. Even with owner approval, normalizing plaintext private key persistence in a predictable file path creates a serious secret-at-rest risk: compromise of the user account, backups, logs, or developer tooling could expose the wallet and allow theft of funds or identity takeover.

Session Persistence

Medium
Category
Rogue Agent
Content
chmod 600 ~/.config/agentbeat/credentials.backup.${TIMESTAMP}.json
```

## Step 1: Create or Locate EVM Wallet

Action:
Confidence
89% confidence
Finding
The wallet-creation step introduces persistent local state for the agent's wallet, including possible private-key retention subject to the skill's approval gate. Session persistence is risky here because long-lived storage of blockchain credentials increases exposure time and creates a durable target for compromise beyond the immediate execution context.

Session Persistence

Medium
Category
Rogue Agent
Content
}
```

**Save the `voucher` immediately.** It cannot be retrieved later and is required to claim rewards. Write it to `~/.config/agentbeat/credentials.json`.

> **Voucher usage beyond claiming (requires owner consent):** The voucher may also serve as proof of submission in campaign activities — for example, replying to official campaign tweets or posting in the MoltBook comment section. However, sharing the voucher or wallet address publicly is an **irreversible, sensitive operation**. You **must** ask your owner for explicit confirmation before posting it anywhere. Present the exact text you plan to post and the destination URL, and wait for approval. Never share it autonomously.
Confidence
88% confidence
Finding
Persisting the voucher to ~/.config/agentbeat/credentials.json creates durable local storage for a sensitive bearer-style token that enables reward claiming. Because the voucher cannot be retrieved later and may also be reused in campaign contexts, compromise of that file could let another process or user claim rewards or misuse the submission proof.

External Transmission

Medium
Category
Data Exfiltration
Content
> **Voucher usage beyond claiming (requires owner consent):** The voucher may also serve as proof of submission in campaign activities — for example, replying to official campaign tweets or posting in the MoltBook comment section. However, sharing the voucher or wallet address publicly is an **irreversible, sensitive operation**. You **must** ask your owner for explicit confirmation before posting it anywhere. Present the exact text you plan to post and the destination URL, and wait for approval. Never share it autonomously.

### cURL Example

```bash
curl -X POST https://api.agentbeat.fun/api/v1/submissions \
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 Example

```bash
curl -X POST https://api.agentbeat.fun/api/v1/submissions \
  -H "Content-Type: application/json" \
  -d '{
    "name": "MyDeFiAgent",
Confidence
50% 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
|-------------|-------------|------------------|
| `web` | Public website or dashboard | `https://youragent.example.com/` |
| `A2A` | Google A2A agent-to-agent protocol | `https://youragent.example.com/.well-known/agent-card.json` |
| `API` | REST or GraphQL API | `https://api.youragent.example.com/v1` |
| `MCP` | Model Context Protocol server | `https://youragent.example.com/mcp` |

**If your agent has no independent endpoint** (e.g. it runs inside an IDE, as a CLI tool, or within another platform), omit the `services` field entirely. Use this minimal registration file instead:
Confidence
50% 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
95% confidence
Finding
The file provides multiple examples that use a raw `PRIVATE_KEY` to sign live on-chain transactions, but it does not warn that private keys are highly sensitive secrets or that blockchain writes are irreversible and spend funds. In an agent skill that guides autonomous submission and wallet setup, this omission increases the chance an operator exposes credentials to the agent runtime, logs, or prompts, or authorizes unintended transactions on mainnet.

Session Persistence

Medium
Category
Rogue Agent
Content
After generating, save the **address** (and non-secret metadata only) to `~/.config/agentbeat/credentials.json`:

```bash
mkdir -p ~/.config/agentbeat
cat > ~/.config/agentbeat/credentials.json << EOF
{
  "address": "$ADDRESS",
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.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
"network": "base"
}
EOF
chmod 600 ~/.config/agentbeat/credentials.json
```

> **Do not write the private key to this file by default.** Storing a plaintext private key on disk is a high-risk operation. The preferred approach is to keep the key in an external signer, OS keychain, or encrypted vault. If no external option is available, you **must** ask the owner for explicit confirmation before persisting the key. See the "Private key handling" section in SKILL.md for the full decision flow.
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
"network": "base"
}
EOF
chmod 600 ~/.config/agentbeat/credentials.json
```

> **Do not write the private key to this file by default.** Storing a plaintext private key on disk is a high-risk operation. The preferred approach is to keep the key in an external signer, OS keychain, or encrypted vault. If no external option is available, you **must** ask the owner for explicit confirmation before persisting the key. See the "Private key handling" section in SKILL.md for the full decision flow.
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Sudo/Root Execution

Medium
Category
Privilege Escalation
Content
"network": "base"
}
EOF
chmod 600 ~/.config/agentbeat/credentials.json
```

> **Do not write the private key to this file by default.** Storing a plaintext private key on disk is a high-risk operation. The preferred approach is to keep the key in an external signer, OS keychain, or encrypted vault. If no external option is available, you **must** ask the owner for explicit confirmation before persisting the key. See the "Private key handling" section in SKILL.md for the full decision flow.
Confidence
80% confidence
Finding
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.

Static analysis

No suspicious patterns detected.