T09 · Insecure Skill Coding Practices
- Location
GITHUB-SETUP.md:11- Finding
Public Repository Workflow Can Commit and Expose Wallet Credentials
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a real Telegram-controlled testnet wallet bot, but it handles private keys and can trigger wallet-changing actions with weak safeguards.
Review this carefully before installing. Use only a low-value testnet key, keep .env out of source control, restrict who can message the bot, and do not run the send/session/limit commands until the bot has explicit confirmation, address validation, ownership verification, rate limits, and safer key storage.
GITHUB-SETUP.md:11Public Repository Workflow Can Commit and Expose Wallet Credentials
telegram-bot.js:97Telegram User IDs Are Passed Directly as Ethereum Addresses
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
The command chains network retrieval directly into a privileged write using a pipe, which reduces transparency and encourages execution without inspection. Even when intended for legitimate setup, this pattern is dangerous in adversarial or compromised environments because it combines remote content with immediate root-level effect.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
Tool calls are chained to bypass individual safety checks or escalate capabilities beyond what any single tool call would allow.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
The /session add and /limit set paths perform state-changing wallet operations immediately after parsing user input, with no confirmation, no secondary approval step, and no visible authorization checks tying userId to a verified blockchain owner identity. In a chat-driven interface, accidental invocation, spoofed identity mapping, or bot abuse could permanently weaken wallet security by adding session keys or changing spending limits.
The /send command immediately encodes transfer data and submits an on-chain execute call from the bot-controlled signer without any confirmation, transaction simulation, recipient validation, or user re-authentication. In this skill context, that makes the issue more dangerous than a normal UX flaw because a chat command can directly trigger irreversible asset movement, so a mistaken or unauthorized command can cause immediate fund loss.
The lockfile pins the transitive dependency ws to version 8.17.1, which the supplied analysis identifies as affected by memory disclosure and memory-exhaustion denial-of-service advisories. Because this skill appears to use ethers, which can rely on WebSocket connectivity for blockchain RPC/event subscriptions, a vulnerable ws library is relevant and could expose the agent to crashes, resource exhaustion, or unintended data exposure when handling hostile network input.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// Validate required config
if (!CONFIG.privateKey) {
console.error('❌ Error: PRIVATE_KEY is required');
console.log('Create .env file:');
console.log('PRIVATE_KEY=your_private_key');
console.log('TELEGRAM_BOT_TOKEN=your_bot_token');
process.exit(1);
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
// Validate required config
if (!CONFIG.privateKey) {
console.error('❌ Error: PRIVATE_KEY is required');
console.log('Create .env file:');
console.log('PRIVATE_KEY=your_private_key');
console.log('TELEGRAM_BOT_TOKEN=your_bot_token');
process.exit(1);
The bot performs state-changing blockchain operations such as adding session keys, changing spending limits, and sending funds immediately based only on incoming Telegram commands, with no authentication binding between Telegram users and blockchain owners, no confirmation step, and no transaction review. Because the signer is a single server-held private key, any Telegram user who can reach the bot may be able to trigger real on-chain actions from that key or its controlled wallets.
The instructions explicitly tell the user to create a public GitHub repository and push the entire local skill directory, but provide no warning to review contents, .gitignore, secrets, wallet material, or commit history first. In a skill/workspace context, this creates a realistic risk of accidental public disclosure of sensitive files or prior commits.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
2. 仓库名: `kite-agent-wallet`
3. 设为 Public
4. 不要勾选 README
5. 点击 Create repository
## 本地执行
This step pipes data fetched over the network directly into a root-privileged write operation under /usr/share/keyrings. Although adding a package signing key can be legitimate, combining remote retrieval with sudo in copy-paste instructions increases the blast radius of mistakes, tampering, or supply-chain compromise.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
This command writes a new apt source configuration with sudo, modifying system package trust settings. In context it is standard package setup, but it still asks users to make privileged system changes without verification guidance, which could enable supply-chain risk if copied from an untrusted document.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
# 登录
Commands invoke sudo or root privileges. Verify this elevated access is necessary and justified.
# 安装 gh CLI
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null
sudo apt update
sudo apt install gh
# 登录
The one-command workflow creates a public repository and immediately pushes the current directory, removing the user's chance to inspect what will be published. Because it operates on the active source tree, any sensitive files, generated artifacts, or embedded credentials present locally could be exposed publicly in a single step.
The README instructs users to place a raw private key and Telegram bot token directly into environment variables without any warning about secret handling, storage hygiene, or the consequences of leakage. In the context of a Telegram-controlled wallet, exposure of either secret can enable unauthorized wallet operations, and loss of the private key can directly compromise funds or delegated permissions.
The command list advertises wallet creation, session authorization, limit changes, and fund transfers without warning that these actions may be irreversible or security-sensitive. Because the skill is designed to control a wallet over Telegram, users may underestimate the risk of granting sessions, changing limits, or sending funds, increasing the chance of accidental loss or abuse if the bot or chat context is mishandled.
The skill instructs users to place a raw wallet private key in an environment file to operate a Telegram-controlled crypto wallet, but provides no security warning, no guidance on secure storage, and no mention of transaction-drain risk. In a cryptocurrency context, exposure or misuse of that key would directly enable irreversible theft of funds, and coupling it to a bot interface increases the sensitivity of the setup.
The guide instructs users to place a blockchain private key and Telegram bot token into a local .env file but provides no warning about the extreme sensitivity of those secrets, nor guidance on excluding the file from source control or restricting local access. In this context, disclosure of either secret can directly enable wallet compromise or bot takeover, and the private key can lead to irreversible asset theft.
The guide documents a /send command that transfers crypto funds without warning that transactions are value-bearing and typically irreversible once submitted. In a Telegram wallet workflow, users may invoke the command casually or under social engineering pressure, increasing the chance of mistaken or fraudulent transfers.
The command handler initializes a signer from KITE_WALLET_PRIVATE_KEY and then uses that signer to create wallets, add session keys, update limits, and execute transfers based on chat commands. In a Telegram-style bot context, this is dangerous because a single long-lived private key becomes the authority for all on-chain operations, and any authorization mistake, account mapping flaw, or bot compromise can lead to unauthorized blockchain actions.
The manifest explicitly advertises Telegram-based wallet control and smart-wallet capabilities but provides no prominent warning that the skill can initiate sensitive financial actions. In a wallet-control context, missing disclosure increases the risk of users invoking transfers, approvals, session-key grants, or spending-limit changes without appreciating the security consequences, especially through a chat interface that can blur intent and confirmation.
The code reads highly sensitive environment variables including PRIVATE_KEY and TELEGRAM_BOT_TOKEN, but only logs missing-config errors and never provides a user-facing warning or explanatory comment about handling credentials. For a code file, accessing credentials should have some disclosure unless clearly covered elsewhere in the skill description, which is not present here.
No suspicious patterns detected.