Back to skill

Security audit

Yield Farming Agent

Security checks for vulnerabilities and agentic risk

Overview

This skill is a disclosed autonomous DeFi agent, but it can run recurring wallet-signed transactions with weak safety controls and insecure contract/accounting assumptions.

Review carefully before installing. Treat this as testnet-only unless the executor is constrained, the contracts are audited and fixed, private-key handling is hardened, live execution requires explicit approval, and per-cycle spending, gas, contract allowlists, slippage, monitoring, and emergency stop controls are added.

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

T09 · Insecure Skill Coding Practices

Error
Location
contracts/artifacts/build-info/a5d75f9256251cc8c46c7f853791cdf4.json:1
Finding
Repeated harvest calls can drain deposited vault assets<![CDATA[ ## Vulnerability Details **File Location**: `contracts/artifacts/build-info/a5d75f9256251cc8c46c7f853791cdf4.json:1` **Vulnerability Type**: Broken reward accounting **Risk Level**: Critical ### Vulnerable Code ```solidity function harvest() external whenNotPaused returns (uint256 yieldAmount) { require(shareBalance[msg.sender] > 0, "No shares to harvest"); yieldAmount = calculateUserYield(msg.sender); require(yieldAmount > 0, "No yield available"); require( IERC20(underlying).transfer(msg.sender, yieldAmount), "Yield transfer failed" ); accumulatedYield += yieldAmount; return yieldAmount; } function calculateUserYield(address user) public view returns (uint256) { if (shareBalance[user] == 0) { return 0; } uint256 userAssets = calculateAssetsFromShares(shareBalance[user]); return (userAssets * 27) / 100000; } ``` ### Technical Analysis The packaged compiler build information embeds the source of `YieldVault.sol`. Its reward calculation depends only on the caller's current shares. It does not track the caller's previously claimed rewards, reward debt, or elapsed accrual period. Calling `harvest()` transfers tokens to the caller but does not decrease `totalAssets`, clear accrued rewards, or advance a per-user reward checkpoint. Consequently, the same nominal yield remains claimable after every successful call. The transfer is funded from the vault's underlying-token balance, which includes user deposits rather than a separately accounted reward reserve. ### Attack Path 1. The attacker acquires underlying tokens and approves the vault. 2. The attacker deposits enough tokens to receive a positive share balance. 3. The attacker calls `harvest()`. 4. The contract calculates a positive reward from the unchanged share balance. 5. The attacker repeats `harvest()` without waiting for any new yield. 6. Each call transfers additional underlying tokens from the vault. 7. Ca ...[truncated 404 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Track reward debt and the last accrual checkpoint for every user. - Calculate rewards only over elapsed time and settle the checkpoint before transferring tokens. - Fund payouts only from realized protocol profits or a separately accounted reward reserve. - Reduce the appropriate reward liability when rewards are harvested. - Verify that actual token balances cover all user principal and reward liabilities. - Apply checks-effects-interactions and reentrancy protection. - Add tests proving that an immediate second harvest cannot claim the same reward and that one user's harvest cannot consume another user's principal. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
contracts/artifacts/build-info/a5d75f9256251cc8c46c7f853791cdf4.json:1
Finding
Compound creates unbacked assets and shares<![CDATA[ ## Vulnerability Details **File Location**: `contracts/artifacts/build-info/a5d75f9256251cc8c46c7f853791cdf4.json:1` **Vulnerability Type**: Unbacked share minting and accounting insolvency **Risk Level**: Critical ### Vulnerable Code ```solidity function compound() external whenNotPaused returns (uint256 newShares) { require(shareBalance[msg.sender] > 0, "No shares to compound"); uint256 yieldAmount = calculateUserYield(msg.sender); require(yieldAmount > 0, "No yield to compound"); newShares = calculateSharesFromAssets(yieldAmount); shareBalance[msg.sender] += newShares; totalShares += newShares; totalAssets += yieldAmount; accumulatedYield += yieldAmount; return newShares; } ``` ### Technical Analysis The function increases `totalAssets` and mints shares without receiving tokens or realizing yield from an external protocol. The calculated `yieldAmount` is an accounting value derived from the caller's existing shares; it is not backed by a corresponding increase in the vault's actual underlying-token balance. There is also no reward checkpoint. A caller can repeatedly invoke `compound()` and mint additional shares from the same nominal yield. The newly minted shares then increase the caller's future calculated assets and yield, allowing the discrepancy between accounting and actual token holdings to grow. ### Attack Path 1. The attacker deposits underlying tokens and receives shares. 2. The attacker calls `compound()`. 3. The contract calculates nominal yield without collecting any new tokens. 4. The contract increases both the attacker's shares and `totalAssets`. 5. The attacker repeatedly calls `compound()` to create additional unbacked shares. 6. The attacker withdraws shares while the vault still holds real tokens deposited by other users. 7. The vault eventually becomes insolvent or later withdrawals fail. ### Impact Assessment The flaw allows artificial inflation of a caller's claim on ...[truncated 252 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Mint shares only after verifiable underlying assets have entered the vault. - Claim rewards from the underlying strategy and measure the actual balance increase before updating accounting. - Introduce per-user reward checkpoints so the same yield cannot be compounded repeatedly. - Enforce the invariant that accounted assets do not exceed the vault's actual managed assets. - Use a recognized vault standard and audited accounting model, such as an appropriately implemented ERC-4626 design. - Add invariant and fuzz tests covering repeated compound calls, deposits, withdrawals, and adverse ordering between multiple users. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
tx-executor.js:11
Finding
Autonomous transaction execution lacks chain, destination, spending, gas, and slippage safeguards<![CDATA[ ## Vulnerability Details **File Location**: `tx-executor.js:11-135`, `scheduler.js:185-200`, `config.scheduler.json:16-20` **Vulnerability Type**: Unsafe autonomous transaction signing **Risk Level**: High ### Vulnerable Code ```javascript this.provider = new ethers.providers.JsonRpcProvider( config.rpcUrl || 'https://data-seed-prebsc-1-b.binance.org:8545' ); if (config.walletPrivateKey) { this.wallet = new ethers.Wallet(config.walletPrivateKey, this.provider); } ``` ```javascript tx = await contract.deposit( ethers.utils.parseEther(params.amount || '0'), { gasLimit: 500000 } ); ``` ```javascript tx = await contract.compound( ethers.utils.parseEther(params.min_output_amount || '0'), { gasLimit: 400000 } ); ``` ```javascript const result = await this.executor.execute( action.type, action.vault_id, action.params ); ``` ```javascript params: { min_output_amount: '0' } ``` The configuration declares controls that the executor does not enforce: ```json { "gas_limit_multiplier": 1.1, "max_gas_price_gwei": 100, "max_retries": 3, "retry_backoff_base_ms": 3000 } ``` ### Technical Analysis The scheduler automatically signs and broadcasts transactions with a raw private key. Before signing, it does not verify the provider's chain ID, compare deployed bytecode against an allowlisted code hash, validate that the target address is an approved contract, or enforce maximum transaction and daily spending limits. All token values are converted with `parseEther`, incorrectly assuming 18 decimals. The configured maximum gas price and retry values are not applied to transaction construction. Compound actions use a zero minimum output, providing no effective slippage protection. No user confirmation or mainnet-specific fail-safe is present. These deficiencies are particularly dangerous because the Skill's declared purpose is unattended periodic execution. ### Attack Path 1. The agent is configured with a funded private key and RPC ...[truncated 1025 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Verify the provider's chain ID before initialization and before every transaction. - Allowlist contract addresses and deployed bytecode hashes. - Reject zero addresses, externally owned accounts, and contracts with unexpected runtime code. - Use each underlying token's actual decimals rather than `parseEther`. - Enforce maximum value per transaction, per vault, and per day. - Enforce the configured maximum gas price and calculate gas limits from simulation with bounded multipliers. - Require nonzero minimum outputs and explicit slippage limits. - Simulate transactions and validate state changes before signing. - Require manual or multisignature approval for mainnet and high-value actions. - Use a restricted signing service or smart-account policy instead of keeping an unrestricted raw key in the process. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scheduler.js:163
Finding
Scheduler and decision engine use incompatible result schemas<![CDATA[ ## Vulnerability Details **File Location**: `index.js:147-158`, `scheduler.js:163-167`, `scheduler.js:355-365` **Vulnerability Type**: Fail-open validation and broken authorization logic **Risk Level**: High ### Vulnerable Code The decision engine returns a nested execution record: ```javascript const executionRecord = { ...recordWithoutExecHash, execution_hash: executionHash }; return executionRecord; ``` The nested record contains its action under `decision.action`, but the scheduler expects unrelated top-level fields: ```javascript console.log(` ├─ Recommendation: ${decision.recommended_action}`); console.log(` ├─ Target vault: ${decision.target_vault_id}`); console.log(` ├─ Confidence: ${(decision.confidence_score * 100).toFixed(1)}%`); console.log(` └─ Risk: ${(decision.rebalance_risk * 100).toFixed(1)}%`); ``` ```javascript if (decision.confidence_score < 0.6) { return actions; } if (decision.rebalance_risk > 0.3) { return actions; } switch (decision.recommended_action) { case 'HARVEST': case 'COMPOUND': case 'REBALANCE': // ... } ``` ### Technical Analysis `YieldFarmingAgent.decide()` does not return `recommended_action`, `target_vault_id`, `confidence_score`, or `rebalance_risk` at the top level. Its action is represented as `executionRecord.decision.action.action`. The scheduler consequently reads undefined fields. Formatting the undefined confidence value can throw, while safety comparisons against `undefined` evaluate to false rather than rejecting the action. This is a fail-open pattern: absent risk fields do not trigger the intended confidence or risk barriers. The current mismatch generally prevents documented autonomous operation, but partial future integration changes could activate execution while leaving the missing-field checks ineffective. ### Attack Path 1. The scheduler calls `YieldFarmingAgent.decide()`. 2. The engine returns the nested execution-record schema. 3. The scheduler reads nonexiste ...[truncated 669 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Define one versioned decision schema shared by the engine and scheduler. - Validate the complete result with a runtime schema before constructing actions. - Require action, target, confidence, risk, units, and amount fields to have explicit types and finite values. - Fail closed when any safety field is absent, malformed, `NaN`, or outside its permitted range. - Remove duplicate representations of the same action. - Add end-to-end tests covering every decision type from blockchain input through action construction and transaction simulation. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scheduler.js:137
Finding
Scheduler makes decisions without reading the signing wallet's actual position<![CDATA[ ## Vulnerability Details **File Location**: `scheduler.js:137-151`, `blockchain-reader.js:50-65` **Vulnerability Type**: Incorrect account and asset accounting **Risk Level**: High ### Vulnerable Code The scheduler does not provide a user address: ```javascript for (const vault of this.vaults) { const data = await this.reader.getVaultData(vault.id); vaultData[vault.id] = { id: vault.id, apr: vault.apr, fees: vault.fees, risk_score: vault.risk_score, tvl: data.total_assets, user_shares: data.user_data.shares, user_amount: data.user_data.amount_usd, user_pending_rewards: data.user_data.pending_rewards_usd, timestamp: data.timestamp }; } ``` The reader therefore retains its zero defaults: ```javascript let userData = { shares: "0", amount_usd: "0", pending_rewards_usd: "0" }; if (userAddress && ethers.utils.isAddress(userAddress)) { const shares = await contract.getShareBalance(userAddress); const yieldAmount = await contract.calculateUserYield(userAddress); userData = { shares: shares.toString(), amount_usd: ethers.utils.formatEther(totalAssets) || "0", pending_rewards_usd: ethers.utils.formatEther(yieldAmount) || "0" }; } ``` ### Technical Analysis The scheduler controls a wallet through `TransactionExecutor`, but it never passes that wallet's address to `getVaultData()`. Its decisions are therefore based on zero shares, zero position value, and zero pending rewards. Even when a user address is supplied, the reader assigns the entire vault's `totalAssets` to `amount_usd`. That value is neither the user's proportional asset amount nor necessarily denominated in USD. The code also assumes 18 token decimals. As a result, the system cannot safely determine how much the signing wallet owns or should move. ### Attack Path 1. A funded wallet is supplied to the transaction executor. 2. The scheduler reads each vault without the wallet address. 3. The reader returns zero-valued user ...[truncated 635 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Pass the executor's verified wallet address to every user-specific blockchain read. - Calculate user assets from the user's shares and the vault's share price. - Keep raw token amounts separate from fiat valuations. - Obtain USD prices from a validated oracle before naming any value `amount_usd`. - Query and apply the token's actual decimals. - Reject missing, non-finite, stale, or inconsistent position data. - Reconcile calculated positions against direct wallet and vault balances before executing transactions. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scheduler.js:406
Finding
Rebalance confuses asset value with share quantity and performs a non-atomic transfer<![CDATA[ ## Vulnerability Details **File Location**: `scheduler.js:406-432` **Vulnerability Type**: Unit confusion and non-atomic fund movement **Risk Level**: High ### Vulnerable Code ```javascript const rebalanceAmount = ( parseFloat(fromVault.user_amount || 0) * 0.25 ).toString(); actions.push({ type: 'WITHDRAW', vault_id: decision.from_vault_id, params: { shares_to_withdraw: rebalanceAmount } }); actions.push({ type: 'DEPOSIT', vault_id: decision.to_vault_id, params: { amount: rebalanceAmount } }); ``` ### Technical Analysis `fromVault.user_amount` is treated as an asset or USD amount, but the same numeric value is sent to `withdraw()` as a number of shares. It is then reused as an underlying-token deposit amount. Shares, token units, and fiat values are distinct quantities and cannot safely be interchanged. The code also converts values through JavaScript floating-point numbers and later through 18-decimal parsing, introducing rounding and unit errors. Withdrawal and deposit are separate transactions. If the withdrawal succeeds and the deposit fails, the operation is only partially completed. ### Attack Path 1. The decision engine recommends moving funds from one vault to another. 2. The scheduler calculates 25% of a field described as the user's asset amount. 3. It interprets that value as shares for the withdrawal. 4. The withdrawal may revert or redeem an unintended asset amount. 5. If it succeeds, the scheduler separately submits a deposit using the same value as token units. 6. The deposit can fail because of missing approval, wrong decimals, gas conditions, or an invalid destination. 7. Funds remain outside the target vault and the portfolio is left in an unintended state. ### Impact Assessment The flaw can cause incorrect withdrawals, failed deposits, stranded assets, precision loss, and unnecessary transaction fees. Its scope is the portion of the signing wallet selected for autonomous rebalancing. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Represent shares, token amounts, and fiat values with distinct typed fields. - Use integer `BigNumber` values throughout; do not pass financial quantities through `parseFloat`. - Derive withdrawal shares using the vault's conversion function. - Derive the deposit amount from the actual tokens received after withdrawal. - Validate token compatibility and approvals before starting the rebalance. - Prefer an audited atomic router that can withdraw and deposit in one transaction. - If atomic execution is unavailable, implement a recoverable state machine with explicit partial-failure handling and user notification. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
tx-executor.js:116
Finding
Transaction executor calls do not match the packaged contract interface<![CDATA[ ## Vulnerability Details **File Location**: `tx-executor.js:116-135` **Vulnerability Type**: ABI and implementation mismatch **Risk Level**: Medium ### Vulnerable Code ```javascript case 'COMPOUND': tx = await contract.compound( ethers.utils.parseEther(params.min_output_amount || '0'), { gasLimit: 400000 } ); break; case 'REBALANCE': tx = await contract.rebalance( params.from_vault || '', params.to_vault || '', ethers.utils.parseEther(params.amount || '0'), { gasLimit: 500000 } ); break; ``` The packaged Solidity implementation defines a no-argument compound function: ```solidity function compound() external whenNotPaused returns (uint256 newShares) ``` It does not define a `rebalance()` function. ### Technical Analysis The executor invokes `compound(uint256)` while the included contract exposes `compound()`. It also invokes a `rebalance` method that is absent from the included implementation. Depending on the ABI metadata passed into `initializeContracts()`, ethers.js will either reject the missing method locally or encode a selector that the deployed contract does not implement. Gas estimation and transaction execution therefore cannot reliably complete. ### Attack Path 1. The agent recommends COMPOUND or REBALANCE. 2. The scheduler passes the action to the executor. 3. The executor calls a signature not supported by the packaged contract. 4. Gas estimation or execution fails. 5. Repeated scheduled attempts can create continuing service disruption and operational noise. 6. If estimation is bypassed and a transaction is broadcast, gas may be spent on a reverting call. ### Impact Assessment The direct impact is failure of autonomous compounding and rebalancing. It can cause repeated failed cycles, denial of intended service, and potentially wasted gas. It also demonstrates that runtime metadata is not reliably tied to the reviewed contract artifact. ]]>
Remediation
<![CDATA[ ## Remediation Suggestions - Generate the runtime ABI directly from the same compiled artifact that is deployed. - Import that ABI rather than maintaining handwritten action assumptions. - Change COMPOUND to call the actual no-argument function or change and redeploy the contract through a reviewed migration. - Remove REBALANCE until the contract or an audited router explicitly supports it. - Verify runtime bytecode and supported function selectors during initialization. - Add testnet integration tests for every executor action against the exact deployed bytecode. ]]>

T09 · Insecure Skill Coding Practices

Warning
Location
notifications.js:195
Finding
Arbitrary error context can be transmitted to Telegram without redaction<![CDATA[ ## Vulnerability Details **File Location**: `notifications.js:195-218` **Vulnerability Type**: Unrestricted sensitive-data disclosure to a third party **Risk Level**: Medium ### Vulnerable Code ```javascript async notifyError(severity, component, message, context = {}) { let emoji = '⚠️'; if (severity === 'ERROR') emoji = '🔴'; if (severity === 'INFO') emoji = 'ℹ️'; let notifMessage = `${emoji} *${severity}*\n\n`; notifMessage += `🔧 Component: \`${component}\`\n`; notifMessage += `📝 Message: \`${message}\`\n`; if (Object.keys(context).length > 0) { notifMessage += `\n📋 Context:\n`; Object.entries(context).forEach(([key, value]) => { const valueStr = typeof value === 'string' ? value : JSON.stringify(value); notifMessage += ` • ${key}: \`${valueStr}\`\n`; }); } const result = await this.sendTelegram(notifMessage); } ``` The destination is Telegram: ```javascript const options = { hostname: 'api.telegram.org', port: 443, path: `/bot${this.telegramBotToken}/sendMessage`, method: 'POST' }; ``` ### Technical Analysis `notifyError()` serializes every property in the supplied context and sends the resulting message to Telegram. There is no field allowlist, recursive secret redaction, size limit, or confirmation requirement. The audited scheduler does not currently invoke this method, so a direct private-key exfiltration path from the existing scheduler was not confirmed. Nevertheless, the exported notification API is unsafe for its documented purpose because callers commonly attach configuration objects, request details, stack metadata, provider URLs, or authentication information to error context. The bot token is also included in the HTTPS URL path. This is required by Telegram's API format but makes local HTTP debug logs and proxy logs sensitive. ### Attack Path 1. Notifications are configured with a Telegram bot token and chat ID. 2. An integration catches an error and calls `notif ...[truncated 714 chars]
Remediation
<![CDATA[ ## Remediation Suggestions - Replace arbitrary context serialization with a strict allowlist of non-sensitive fields. - Recursively redact keys matching patterns such as `privateKey`, `secret`, `token`, `password`, `authorization`, `mnemonic`, `seed`, and `apiKey`. - Redact credentials and query parameters from URLs. - Truncate messages and nested values to bounded lengths. - Escape Telegram Markdown control characters in all untrusted values. - Require explicit opt-in before transmitting detailed diagnostics. - Keep sensitive diagnostics in access-controlled local logs and send only opaque incident identifiers to Telegram. - Document Telegram as a third-party data recipient and apply suitable retention and access controls. ]]>
Vulnerability Patterns
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
Findings (125)

Missing User Warnings

High
Confidence
97% confidence
Finding
The scheduler is documented as running autonomously every hour through a read-decide-execute loop that can deploy HARVEST, COMPOUND, and REBALANCE transactions, yet there is no clear recurring-execution warning or strong guardrails. Because this is an automated blockchain agent, the lack of warning materially increases the chance of unattended transaction submission, repeated losses, or cascading failures if configuration, decision logic, or upstream data are wrong.

Missing User Warnings

High
Confidence
98% confidence
Finding
The 'Next Steps for Full Automation' section gives concrete instructions for unattended transaction execution, private-key signing, scheduled execution, and notification wiring without requiring human approval, guardrails, or warning language. In the context of an autonomous DeFi agent, this directly facilitates deployment of a bot that can move assets continuously based on incomplete or manipulated inputs, turning design flaws or bad assumptions into repeated on-chain losses.

Credential Access

High
Category
Privilege Escalation
Content
cat > .gitignore << 'EOF'
node_modules/
.env
.env.local
*.log
.DS_Store
dist/
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Credential Access

High
Category
Privilege Escalation
Content
cat > .gitignore << 'EOF'
node_modules/
.env
.env.local
*.log
.DS_Store
dist/
Confidence
60% confidence
Finding
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding
The description suggests an autonomous yield farming agent that makes decisions and executes actions on BNB Chain. The code does not implement agent behavior, strategy logic, or deterministic execution of farming transactions. Instead, it is a read-only blockchain reader for BNB testnet contracts: it loads contract instances, queries vault/user data, listens to events, and performs non-transactional simulations. While smart contract integration on BNB Chain is present, the primary purpose is materially narrower and different from the declared autonomous yield farming functionality.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description describes a fully functional autonomous yield farming agent operating on BNB Chain. However, the supplied code chunk is only a TypeScript declaration file for a contract ABI export. It defines type-level/module-level exports and does not implement farming logic, transaction execution, decision-making, chain access, triggers, or any runtime smart contract interactions. This is a material mismatch in primary purpose and implemented capabilities.

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding
The description claims an autonomous yield farming agent, but the code chunk is just an ABI specification describing callable contract functions and events for a vault. While the ABI is related to yield farming and smart contract integration at an interface level, it does not itself implement an agent, decision logic, scheduling, execution flow, or BNB Chain-specific behavior. Therefore the declared description materially overstates what this code actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding
The declared description suggests an operational autonomous yield farming agent that interacts with smart contracts and makes automated execution decisions on BNB Chain. The supplied code instead is a deployment helper/stub: it loads environment variables, defines an ABI and vault configuration mapping, checks account balance, simulates per-vault deployment readiness, and saves a JSON report. Although it references smart contract integration concepts and BNB Testnet resources, its primary purpose is deployment preparation/documentation rather than autonomous yield farming. There are no triggers, scheduling, strategy logic, on-chain deposit/withdraw/harvest/compound calls, or decision-making mechanisms implemented. Therefore the description materially overstates and misrepresents the actual behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The supplied code does not implement a yield farming agent or any autonomous on-chain strategy behavior. It only defines project configuration for Hardhat: compiler options, network endpoints, account loading from environment variables, chain IDs, local/testnet settings, and block explorer verification configuration. While this may support smart contract development on BNB Chain, it is not itself an autonomous agent, does not perform yield farming, and contains no execution or decision-making logic. Therefore the description materially overstates and misrepresents the actual behavior of this code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description suggests a full autonomous yield farming agent operating on BNB Chain, likely involving strategy logic, contract interactions, and automated execution. The supplied code does not perform yield farming, strategy management, or transactional smart contract operations. Instead, it is a utility script for checking a deployer wallet's BNB Testnet balance and current gas price, then estimating deployment cost. This is a materially different primary purpose, so the description does not accurately represent the code.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description suggests an operational autonomous yield farming agent that would make decisions and interact with deployed contracts to execute farming strategies. The supplied code does not implement such behavior. Instead, it is a deployment utility script for Hardhat that iterates over static vault configurations, deploys YieldVault contracts, checks wallet balance, logs results, and saves deployment data locally. While this does involve smart contract integration on BNB Testnet, the primary purpose is materially different from an autonomous agent, and there is no evidence of deterministic strategy execution or automated decision-making. Therefore the description does not accurately represent the code chunk.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The supplied code does not implement an autonomous yield farming agent. It does not connect to BNB Chain, monitor conditions, make decisions, or execute smart contract transactions. Instead, it is a development/build-time helper that writes ABI-related files and documentation to the local filesystem. While the embedded ABI describes vault functions like deposit, withdraw, harvest, and compound, the script itself only exports metadata and usage docs; it does not perform those actions. Therefore the declared description materially overstates and misrepresents the code’s actual behavior.

Tp4

High
Category
MCP Tool Poisoning
Confidence
91% confidence
Finding
The core theme matches yield-farming decision-making: the code evaluates vaults, applies APR/risk logic, and outputs action recommendations. However, the declared description materially overstates behavior. There is no on-chain connectivity, RPC usage, wallet/signing, contract calls, or transaction submission, so 'smart contract integration' and practical 'autonomous yield farming' are not implemented. The code is an off-chain policy/decision module plus audit-hash generation and verification. It also claims deterministic execution, but the output includes a live timestamp and cycle number derived from Date.now(), so results are not fully deterministic across runs for identical inputs. Therefore the description does not accurately represent what the code chunk actually does.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding
The declared description presents the skill as a BNB Chain autonomous yield farming agent with deterministic execution, contract integration, and automated decision-making. However, the supplied code chunk is specifically a notification subsystem: it formats and sends Telegram messages over HTTPS, logs notification events to a local file, tracks APR-change thresholds for alerts, and exposes notification history/stats. It does not implement yield farming, blockchain interaction, smart contract calls, or autonomous execution logic. While notifications could be a supporting component of such an agent, this chunk itself performs materially different behavior and uses undeclared resources (Telegram network access and local file writes). Therefore this code does not accurately match the declared purpose.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding
The declared description presents the skill as an operational autonomous yield farming agent with deterministic execution, smart contract integration, and automated decision-making on BNB Chain. However, the supplied code chunk is specifically a test file (`test.js`) whose primary purpose is validating another module's behavior using mock data. While the tests do exercise decision-making logic and determinism-related properties, the code shown does not itself execute farming strategies, interact with smart contracts, or access BNB Chain resources. This is a material description-behavior mismatch because the actual chunk's primary function is testing, not autonomous yield farming.

Tp4

High
Category
MCP Tool Poisoning
Confidence
93% confidence
Finding
The declared description presents the skill as the autonomous yield farming agent itself, implying operational decision-making and smart contract integration on BNB Chain. However, the supplied code chunk is specifically a test script (`test.live.mock.js`) for mocked/offline validation. Its primary function is to run tests against configuration, mock data, agent decision output, hash verification, ABI events, and risk filtering, then report results. While it does call `YieldFarmingAgent.decide()` and `verifyRecord()`, this is in a testing context with static mock inputs and no live RPC or contract execution. Therefore the code chunk's actual purpose is materially different from the declared operational agent behavior.

Credential Access

High
Category
Privilege Escalation
Content
### 1. Configure

```bash
cp config.deployed.json .env.local
# Edit with your contract addresses and RPC endpoint
```
Confidence
88% confidence
Finding
The setup instructions direct users to create and edit a .env.local file for configuration, which strongly implies storage of sensitive data such as RPC credentials, bot tokens, or wallet-related secrets. In an autonomous on-chain agent context, encouraging secret handling through local environment files without accompanying hardening guidance increases the chance of credential leakage, accidental commits, or compromise leading to unauthorized transactions or monitoring abuse.

Ae1

High
Category
analysis-evasion
Content
- `SKILL.md` - This file
Confidence
100% confidence
Finding
Referenced artifact was not completely inspected

Missing User Warnings

High
Confidence
96% confidence
Finding
The document advertises autonomous transaction execution for deposit, withdraw, harvest, compound, and rebalance actions without a prominent warning that the system can move funds on-chain without per-action user approval. In a DeFi agent context, normalizing unattended execution materially increases the risk of unintended financial loss from bad strategy logic, compromised config, wrong vault addresses, or operator misunderstanding.

Missing User Warnings

High
Confidence
98% confidence
Finding
The usage example calls scheduler.start() immediately after initialization, which encourages operators to enable unattended transaction execution with minimal friction and no nearby warning. In this skill's context, that can directly trigger live on-chain actions and losses if the configuration, vault set, wallet, or network selection is wrong.

Credential Access

High
Category
Privilege Escalation
Content
```bash
cd contracts
cp .env.example .env
```

### 2. Edit `.env` with Your Values
Confidence
91% confidence
Finding
Creating and relying on a .env file for deployment secrets is a real credential-handling risk in this context because the same guide later instructs users to place a private key there. For autonomous yield-farming infrastructure, compromise of local plaintext secrets can enable wallet takeover and unauthorized contract interactions.

Credential Access

High
Category
Privilege Escalation
Content
### 2. Edit `.env` with Your Values

```bash
nano .env
# or
vim .env
```
Confidence
93% confidence
Finding
Telling users to open .env directly for editing is part of a workflow that handles raw private keys in plaintext on disk. In this agent's smart-contract deployment context, that raises the risk of accidental exposure through editors, swap files, backups, malware, or shoulder-surfing.

Credential Access

High
Category
Privilege Escalation
Content
```bash
nano .env
# or
vim .env
```

**Fill in:**
Confidence
93% confidence
Finding
The instruction to fill .env with sensitive values, including a raw private key, creates a credential exposure issue rather than merely referencing configuration. Because this project concerns blockchain automation, any leaked deployer key can be immediately abused for transactions and fund theft.

Credential Access

High
Category
Privilege Escalation
Content
#### 1. **"PRIVATE_KEY is not set"**

```bash
# Ensure .env file exists and has PRIVATE_KEY
cat .env | grep PRIVATE_KEY

# Should output: PRIVATE_KEY=1234567890...
Confidence
94% confidence
Finding
The troubleshooting advice explicitly encourages inspecting .env for PRIVATE_KEY presence, reinforcing a plaintext secret workflow. This increases the chance of exposing or mishandling the key during debugging, especially on shared terminals, recorded sessions, or compromised workstations.

Credential Access

High
Category
Privilege Escalation
Content
```bash
# Ensure .env file exists and has PRIVATE_KEY
cat .env | grep PRIVATE_KEY

# Should output: PRIVATE_KEY=1234567890...
```
Confidence
95% confidence
Finding
Showing expected output that includes the PRIVATE_KEY value normalizes printing or revealing secret material during troubleshooting. Even partial examples can encourage unsafe operator behavior that leads to shell scrollback, logs, screenshots, or terminal recording leaks.