T09 · Insecure Skill Coding Practices
- Location
skill.md:125- Finding
Private key stored in plaintext wallet file
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly a disclosed PancakeSwap trading guide, but it asks for persistent private-key handling and includes inconsistent optional ClawChain credential use that users should review carefully.
Install only if you are comfortable giving the agent a dedicated, low-balance BSC wallet and reviewing every swap before signing. Avoid using the optional ClawChain registration path unless you explicitly want that identity binding, and prefer an encrypted keystore or external signer over the default plaintext wallet file.
skill.md:125Private key stored in plaintext wallet file
skill.md:40Unpinned third-party dependency creates mutable supply-chain exposure
The skill declares access to a ClawChain credentials file unrelated to core PancakeSwap trading, expanding the credential boundary into another system. Even read-only access to authentication material is sensitive because the later instructions use it to authenticate on-chain operations, enabling unintended cross-system actions if the skill is over-permissioned or compromised.
description: "Contains the agent's BSC private key (encrypted or plaintext) and public address. Created once during wallet setup. The agent uses this to sign swap transactions on BSC. This file SHOULD be encrypted at rest — see Security section."
access: read
- name: ClawChain Credentials (optional)
path: "~/.config/clawchain/credentials.json"
description: "Chromia keypair used to authenticate on-chain operations. Only needed if registering the BSC public key on ClawChain for EVM event tracking. This file is created by the clawchain skill, not by this skill."
access: read
optional: true
Referenced artifact was not completely inspected
- It does **not** manage ClawChain agent registration. For that, see the `clawchain` skill (`skill.md` or `curl_skills.md`).
The skill claims optional access to ~/.config/clawchain/credentials.json, which grants visibility into another skill's authentication material and broadens the attack surface beyond BSC trading. In context, this is more dangerous because the same file later enables authenticated registration actions on ClawChain, not merely passive reads.
- It does **not** manage ClawChain agent registration. For that, see the `clawchain` skill (`skill.md` or `curl_skills.md`).
- It does **not** provide investment advice or execute trades without user confirmation.
- It does **not** access any files outside of `~/.config/bsc_agent/` and optionally `~/.config/clawchain/credentials.json` (read-only, for EVM key registration only).
### Transparency: Files Accessed
Documenting and permitting read-only access to ClawChain credentials still represents credential exposure because the skill can consume secrets from an unrelated trust domain. Since the skill's primary purpose is token trading, this extra credential path is unnecessary for most use cases and increases the consequences of misuse or prompt injection.
| File | Access | Purpose |
|------|--------|---------|
| `~/.config/bsc_agent/wallet.json` | Read/Write (created once) | Stores the agent's BSC private key and address for signing transactions |
| `~/.config/clawchain/credentials.json` | Read-only (optional) | Used only if registering BSC public key on ClawChain for EVM event tracking |
### Transparency: Network Calls
This section operationalizes use of the ClawChain credentials file as a prerequisite for authenticated actions, confirming that the skill is not merely documenting optional compatibility but actively depending on external secrets. Cross-system credential reuse increases the blast radius if the skill behaves unexpectedly or is socially engineered into performing unauthorized operations.
- A registered agent account on ClawChain (Chromia)
- An authenticated session (FT4 keypair from ClawChain registration)
- Your `wallet.json` file with `publicKey` (required) and optionally `address`
- The ClawChain credentials file at `~/.config/clawchain/credentials.json` (created by the `clawchain` skill)
### Environment Variables for ClawChain
The command passes --secret ~/.config/clawchain/credentials.json to perform authenticated ClawChain registration, demonstrating active use of sensitive credentials from another subsystem. This is dangerous because a PancakeSwap skill can now trigger privileged identity-binding operations outside its advertised core purpose, magnifying harm from misuse or unauthorized invocation.
56 \
"$ADDRESS" \
--ft-auth \
--secret ~/.config/clawchain/credentials.json \
-brid $CLAWCHAIN_BRID \
--api-url $CLAWCHAIN_NODE \
--await
The metadata and top-level description understate the skill's actual capabilities by omitting ClawChain/Chromia registration and querying behavior, while later sections instruct the agent to access external credentials and perform those operations. This kind of scope mismatch can bypass user expectations and policy gating, making sensitive cross-system actions more likely to occur without informed consent.
The document explicitly states it does not manage ClawChain agent registration, but later provides step-by-step registration and query commands using ClawChain credentials. This contradiction creates deceptive scope boundaries and can cause an agent or operator to authorize actions they believed were excluded.
The skill instructs the agent to create and persist a long-lived local wallet containing private key material for future reuse. Persistent session/key state is risky because compromise of the host, file, logs, or adjacent skills can lead to durable unauthorized transaction signing and fund loss.
---
## 1. Wallet Setup — Create Wallet and Save Keys
The agent needs a local wallet file containing a **private key** and **public address** so it can sign transactions. This file is created once during initial setup and reused for all subsequent operations.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
}
- **privateKey** — Used to sign transactions. This file is restricted to owner-only access (`chmod 600`). Never log or expose this value.
- **address** — The agent's BSC account. The user sends BNB/tokens to this address to fund the agent.
- **publicKey** — Derived from private key. Used optionally for ClawChain EVM event tracking registration.
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
}
- **privateKey** — Used to sign transactions. This file is restricted to owner-only access (`chmod 600`). Never log or expose this value.
- **address** — The agent's BSC account. The user sends BNB/tokens to this address to fund the agent.
- **publicKey** — Derived from private key. Used optionally for ClawChain EVM event tracking registration.
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
mode: 0o600 automatically. Verify with:
chmod 600 ~/.config/bsc_agent/wallet.json
ls -la ~/.config/bsc_agent/wallet.json
# Should show: -rw-------
No suspicious patterns detected.