T09 · Insecure Skill Coding Practices
- Location
scripts/config.mjs:21- Finding
Hardcoded Ethereum Private Key Used as the Default Transaction Signer
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This Sepolia DeFi skill mostly matches its stated purpose, but it needs Review because it ships a default signing key and can make persistent blockchain approvals and transactions.
Install only if you are comfortable with Sepolia-only transaction scripts. Do not use a production wallet or a key with mainnet funds, rotate or replace the embedded demo key before relying on it, use your own restricted RPC endpoint, review allowances after adding liquidity, and prefer a version with pinned dependencies and explicit transaction confirmations.
scripts/config.mjs:21Hardcoded Ethereum Private Key Used as the Default Transaction Signer
scripts/config.mjs:21Authenticated Alchemy RPC Credential Embedded in Source Code
scripts/package.json:1Non-Reproducible Dependency Installation Without a Lockfile
scripts/add-liquidity.mjs:40Excessive Token Allowances and Zero Slippage Protection in Liquidity Transactions
The file embeds a default private key and immediately derives an account and wallet client from it, which gives the skill transaction-signing capability even when no secret is intentionally provided by the operator. In a DeFi automation context, this is especially dangerous because anyone with the code can use the same key, and the agent may sign on-chain actions with a shared or exposed identity, leading to fund loss, abuse, or unauthorized transactions.
Using a hardcoded private key as a silent fallback means the system can operate with a sensitive credential without operator awareness or explicit consent. In this skill, which manages Uniswap liquidity and trading-related actions, that increases the chance of unintended live transactions, shared-key compromise, and misleading assumptions about which wallet is actually controlling assets.
The skill description is broad enough to activate on generic DeFi and AMM topics, not just narrowly scoped GhostBot operations. Because this skill includes transaction-capable scripts and wallet-related setup, over-triggering can route users into unnecessary blockchain actions or expose them to risky operational guidance when they only wanted general information.
The markdown provides concrete commands for adding liquidity and posting oracle signals, plus guidance for setting a private key, without prominent warnings about transaction signing, key handling, approval risk, or the danger of using a built-in demo wallet. Even on Sepolia, this normalizes unsafe secret management and can lead users to run signing actions they do not fully understand, a risk amplified if users adapt the workflow to mainnet or reuse sensitive keys.
The manifest describes managing Uniswap v4 liquidity positions, rebalancing, fee optimization, and order/oracle-driven actions. In this file, if the user lacks enough tokens, the script directly calls token mint functions to create assets before adding liquidity, which is a materially different capability than managing existing LP capital.
The top comments present this as an add-liquidity utility, implying the action is limited to supplying liquidity. However, the code conditionally performs additional state-changing token mint operations, so the inline documentation understates and misrepresents what the script actually does.
The dependency version for viem is specified with a caret range, which allows newer minor and patch releases to be installed automatically. This can introduce supply-chain risk and non-reproducible builds if an upstream release is compromised or contains a breaking security regression, especially in a DeFi-related skill that may interact with blockchain transactions and funds.
"type": "module",
"private": true,
"dependencies": {
"viem": "^2.20.0"
}
}
No suspicious patterns detected.