T09 · Insecure Skill Coding Practices
- Location
strategy-scheduler.js:84- Finding
Wallet Private-Key Prefix Disclosed in Scheduler Logs
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real autonomous DeFi trading skill that is mostly purpose-aligned, but it asks for wallet signing authority and can repeatedly submit live transactions without enough safety controls.
Review this carefully before installing. Use only a fresh testnet wallet or a wallet with funds you can afford to lose, do not put a mainnet private key in .env, avoid running the live scheduler unattended, and do not expose the API port to untrusted networks. This should be treated as experimental financial automation until it has bounded approvals, dry-run/manual approval defaults, transaction and gas limits, authenticated APIs, and audited mainnet controls.
strategy-scheduler.js:84Wallet Private-Key Prefix Disclosed in Scheduler Logs
defi-strategy-engine.js:75Missing Safety Controls and Undefined Rebalance Result Can Cause Repeated Real Transactions
pancakeswap-executor.js:49PancakeSwap Executor Grants Unlimited Persistent Token Allowance
server.js:16Unauthenticated API Exposes Wallet and Financial Execution Logs
The report identifies the skill as yield-farming-agent while the manifested skill is clawtrade-bnb, creating a clear identity mismatch. In an autonomous DeFi context, this can mislead operators about what code they are reviewing or deploying, weakening trust boundaries and potentially causing the wrong strategy or artifact to be approved for on-chain use.
The documentation advertises autonomous real blockchain execution and frequent conditional transactions without a prominent warning about financial risk, gas expenditure, and the possibility of unintended on-chain actions. Because this is a DeFi trading skill, omission of explicit safety warnings materially increases the chance that a user enables automation without understanding that it can submit live transactions affecting funds.
The installation instructions end with running the scheduler but do not clearly warn that doing so may immediately begin autonomous transaction activity. This is especially dangerous in a wallet-connected agent because users may treat the command as a harmless startup step when it can trigger live on-chain behavior and repeated execution cycles.
The document promotes autonomous blockchain transaction execution, including signing with a private wallet and executing deposit/withdraw/harvest/rebalance actions, without prominent warnings about irreversible financial loss, strategy failure, contract risk, or misconfiguration. In a DeFi trading skill context, this omission is dangerous because operators may enable live execution without understanding that the agent can directly move assets and incur losses.
The scheduler is described as running decision cycles automatically and executing blockchain transactions on a timer, but there is no explicit warning about unattended operation risk such as repeated bad trades, runaway retries, stale data, or draining funds during abnormal market conditions. Because this skill is intended for autonomous DeFi operation, lack of strong warnings and guardrails materially increases the chance of user harm.
Instructing users to edit .env and place a private key there promotes handling long-lived signing material in plaintext environment files. For a trading agent that can auto-execute on-chain actions, compromise of that file directly enables unauthorized transactions and asset theft.
cp .env.example .env
nano .env
The explicit instruction Add PRIVATE_KEY=your_key normalizes storing a blockchain private key directly in an environment file. In this skill's context, that credential authorizes autonomous trading, so leakage through local compromise, backups, logs, screenshots, or accidental commits can cause immediate fund loss.
cp .env.example .env
nano .env
This line explicitly instructs users to create a .env file containing a private key, which is credential material for a blockchain wallet. In this skill’s context, that credential enables direct financial actions, so normalizing plaintext secret placement without stronger controls increases the chance of credential compromise and unauthorized asset movement.
# Create .env (git-ignored automatically)
echo "PRIVATE_KEY=YOUR_TESTNET_PRIVATE_KEY" > .env
echo "RPC_URL=https://bsc-testnet.publicnode.com" >> .env
This verification command reads the private key from environment variables and derives the wallet address, reinforcing a workflow centered on raw private-key handling. Although it prints only the address, it encourages loading highly sensitive credentials into a general-purpose runtime and may be copied into unsafe environments, increasing exposure risk for a key that controls financial assets.
# Create .env (git-ignored automatically)
echo "PRIVATE_KEY=YOUR_TESTNET_PRIVATE_KEY" > .env
echo "RPC_URL=https://bsc-testnet.publicnode.com" >> .env
# Verify (should show your address)
node -e "require('dotenv').config(); const ethers = require('ethers'); const w = new ethers.Wallet(process.env.PRIVATE_KEY); console.log('Wallet:', w.address)"
Documenting the project structure with a .env file labeled as containing 'Your secrets' normalizes keeping sensitive wallet material in the repository workspace. In a DeFi agent context, this increases the likelihood that users store operational keys beside code, logs, and tooling where they may be accidentally backed up, shared, or exfiltrated by local compromise.
clawtrade-bnb/
├── .env # Your secrets (git-ignored)
├── .network.json # Network preference (auto-created)
├── execution-log.jsonl # Action history (auto-created)
├── performance-metrics.json # Metrics (auto-created)
This troubleshooting advice again instructs users to place a private key directly into a .env file, reinforcing insecure secret-handling habits. Repetition matters here because the skill is an autonomous financial agent, so any compromise of that key can immediately translate into unauthorized transactions and asset loss.
Solution: Create .env file with PRIVATE_KEY=your_key
echo "PRIVATE_KEY=0x..." > .env
The guide encourages moving an autonomous trading agent from testnet to mainnet and adding a real private key, while offering only a minimal cautionary note. In the context of an autonomous DeFi agent with network switching and self-optimizing behavior, this can lead users to expose real funds to unreviewed code, strategy bugs, malicious dependencies, or unsafe transactions, creating severe risk of irreversible financial loss.
This line explicitly tells users to add a real mainnet private key to a .env file, which is highly dangerous because it combines plaintext credential storage with production financial authority. In the context of an autonomous DeFi agent, compromise of that file could permit immediate, irreversible theft or misuse of real assets.
node agent-cli.js network mainnet
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cat > .gitignore << 'EOF'
node_modules/
.env
.env.local
*.log
.DS_Store
dist/
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
cat > .gitignore << 'EOF'
node_modules/
.env
.env.local
*.log
.DS_Store
dist/
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
The skill description makes strong claims about autonomous DeFi trading, network switching, and reinforcement learning, while the analyzed implementation evidence appears inconsistent and in many places limited to logging, dashboards, testing, vault operations, or transaction utilities. This mismatch is dangerous because users may grant wallet keys, enable automation, or run on mainnet under false assumptions about what the software actually does.
Detected: suspicious.dangerous_exec, suspicious.exposed_secret_literal