T09 · Insecure Skill Coding Practices
- Location
scripts/setup.js:54- Finding
Plaintext Private Key Is Created Before Restrictive Permissions Are Applied
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a coherent DeFi lending skill, but it needs Review because it creates and stores a raw wallet private key locally and can sign high-impact on-chain transactions with under-disclosed persistent approvals and limited safety controls.
Install only if you are comfortable with an agent-managed DeFi wallet. Use a dedicated low-balance wallet, protect or replace ~/.hyperliquid-wallet.json, review every transaction before using --yes, avoid relying on unimplemented advertised markets, and check or revoke ERC-20 allowances after repayments.
scripts/setup.js:54Plaintext Private Key Is Created Before Restrictive Permissions Are Applied
scripts/repay.js:152Repayment Grants a Persistent Unlimited Token Allowance
scripts/borrow.js:84Borrow Execution Lacks Requested-Amount and Projected Health-Factor Safety Checks
The reported behavior includes local wallet generation and persistent private-key storage, while the skill is presented primarily as a lending workflow. Hiding sensitive credential creation/storage behind a DeFi skill description materially increases risk because users may run setup steps without appreciating that private keys are being created on disk and then used for irreversible on-chain actions.
The reported behavior includes local wallet generation and persistent private-key storage, while the skill is presented primarily as a lending workflow. Hiding sensitive credential creation/storage behind a DeFi skill description materially increases risk because users may run setup steps without appreciating that private keys are being created on disk and then used for irreversible on-chain actions.
The reported behavior includes local wallet generation and persistent private-key storage, while the skill is presented primarily as a lending workflow. Hiding sensitive credential creation/storage behind a DeFi skill description materially increases risk because users may run setup steps without appreciating that private keys are being created on disk and then used for irreversible on-chain actions.
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/deposit.js pooled usdt0 100 --json
Referenced artifact was not completely inspected
node scripts/positions.js --json
Referenced artifact was not completely inspected
node scripts/withdraw.js <market> <token> <amount|max> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/withdraw.js <market> <token> <amount|max> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/withdraw.js <market> <token> <amount|max> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/borrow.js <market> <token> <amount> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/borrow.js <market> <token> <amount> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/borrow.js <market> <token> <amount> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/repay.js <market> <token> <amount|max> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/repay.js <market> <token> <amount|max> [--yes] [--json]
Referenced artifact was not completely inspected
node scripts/repay.js <market> <token> <amount|max> [--yes] [--json]
The lockfile pins ws to version 8.18.3, and the finding cites known advisories affecting that exact version. Because viem depends on ws, any skill functionality using WebSocket-based RPC or subscriptions could expose the agent process to memory disclosure or denial-of-service conditions if it connects to a malicious or compromised endpoint. In a DeFi skill, persistent RPC/WebSocket connections are plausible, which makes this more operationally dangerous than an unused library issue.
The skill describes executing local Node scripts that manage wallets and submit blockchain transactions, yet it declares no explicit tool scope or permissions. In an agent setting, missing scope boundaries can let the skill access environment data or execute code more broadly than a user expects, increasing the chance of unintended secret exposure or unsafe transaction flow.