Back to skill

Security audit

SafeToken.fun

Security checks for vulnerabilities and agentic risk

Overview

The skill is a clear SafeToken.fun integration, but it guides agents to make real BNB Chain mainnet wallet transactions using mutable remote contract metadata without enough validation or confirmation safeguards.

Review carefully before installing or using this skill. Only use it with an explicit human approval step, a dedicated low-balance wallet, verified contract addresses and ABI, transaction simulation, and a clear understanding that BNB Chain mainnet transactions can spend real funds and cannot be undone.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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 (1)

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.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
Findings (1)

Missing User Warnings

Medium
Confidence
94% confidence
Finding
The skill instructs agents to perform real on-chain token creation and registration on BNB Smart Chain mainnet, including use of a funded wallet, but does not clearly warn that transactions spend real funds and are irreversible. In an agent context, this increases the chance of unintended financial loss, accidental token deployment, or unauthorized use of wallet capabilities if the skill is invoked automatically or by an uninformed user.

Static analysis

No suspicious patterns detected.