T08 · Insecure Dependencies
Error
- Location
- SKILL.md:19
- Finding
- Unverified Remote Contract Metadata Controls Funded-Wallet Transactions## Vulnerability Details **File Location**: `SKILL.md`, lines 19–20, 31–33, and 76 **Vulnerability Type**: Unverified remote smart-contract dependency **Risk Level**: High ### Vulnerable Code Snippet ```markdown 1. **API manifest (start here):** `GET https://safetoken.fun/api` Returns JSON with `contracts.tokenFactory`, `contracts.launchpad`, `contracts.tokenFactoryAbi`, and all endpoint descriptions. Use this to get contract addresses and ABI for creating tokens. ``` ```markdown 1. **GET** `https://safetoken.fun/api` → read `contracts.tokenFactory` (address) and `contracts.tokenFactoryAbi`. 2. On **BNB Chain (56)**, call **TokenFactory.createToken(name, symbol, burnPercent)** from a funded wallet. - `burnPercent`: 30–70 (percent of supply burned at launch). ``` ```markdown Always start with `GET https://safetoken.fun/api` to get current contract addresses and ABI. ``` ### Technical Analysis The Skill instructs an agent to retrieve a smart-contract address and ABI dynamically from a remotely controlled API and then use that data to construct a BNB Smart Chain mainnet transaction from a funded wallet. The instructions do not require validation of the returned contract address against a pinned allowlist, comparison of deployed bytecode against an audited hash, verification of source code, inspection of proxy implementations, or simulation and decoding of the resulting transaction. Consequently, the API response acts as a mutable supply-chain dependency for a financially sensitive operation. If the SafeToken.fun API, its hosting environment, DNS, or an upstream delivery component is compromised, an attacker could replace the advertised factory address or ABI with attacker-controlled values. A compliant agent could then prepare a transaction targeting a malicious contract while presenting it as the documented token-creation workflow. The reviewed file does not itself retrieve executable native code or expose w ...[truncated 1761 chars]
- Remediation
- ## Remediation Suggestions 1. Pin the expected chain ID, factory address, launchpad address, and audited runtime bytecode hashes directly in the Skill. 2. Treat data returned by `/api` as informational only. Reject any returned address that differs from the pinned allowlist. 3. Retrieve deployed bytecode independently from a trusted BNB Chain RPC endpoint and compare it with the expected audited hash before constructing a transaction. 4. Detect proxy contracts and verify the implementation address, implementation bytecode, administrator, and upgradeability status. Reject unexpected implementation changes. 5. Obtain ABI definitions from a versioned, integrity-protected source rather than accepting mutable ABI data as authoritative. 6. Simulate each transaction before signing and inspect its destination, function selector, decoded arguments, BNB value, approvals, internal calls, and expected state changes. 7. Require explicit user confirmation that displays the chain, destination address, transaction value, decoded calldata, and simulation result. 8. Use a dedicated low-balance wallet with no unrelated token approvals or valuable assets. 9. Apply strict transaction policies that reject unlimited approvals, unexpected BNB value, unrecognized function selectors, and destinations outside the pinned allowlist. 10. Document audited contract versions and provide a controlled update process requiring security review before pinned addresses or bytecode hashes are changed.
