T08 · Insecure Dependencies
- Location
scripts/package.json:6- Finding
Wallet-Sensitive Setup and Trading Operations Delegated to an Unverified Third-Party Dependency
- Content
View full analysis
=10)')\"", ``` `scripts/setup.mjs:11-25`: ```js async function main() { let entry; try { const pkgJson = require.resolve('@hypelens/hypelens-agent-rail/package.json'); entry = join(dirname(pkgJson), 'bin', 'hypelens-setup.js'); } catch { entry = null; } if (!entry || !existsSync(entry)) { console.error('Missing @hypelens/hypelens-agent-rail. Run: npm install (in this scripts/ folder)'); process.exit(1); } // Pass --scripts-dir so MCP entry points at local start-mcp.mjs process.argv.push('--scripts-dir', scriptsDir); await import(pathToFileURL(entry).href); } ``` `scripts/start-mcp.mjs:31-40`: ```js console.error('Recovery: export HYPERLIQUID_PRIVATE_KEY= && node setup.mjs'); console.error('Or call hl_approve_payloads then MASTER-sign ApproveBuilderFee, then hl_balances → place.'); console.error('Funnel: setup → maxBuilderFee>=10 → equity>0 → hl_place_order(..., confirmTrade:true) → FILLED.'); } } catch (_) { /* ignore corrupt marker */ } } const require = createRequire(import.meta.url); try { const pkgJson = require.resolve('@hypelens/hypelens-agent-rail/package.json'); const pkg = require(pkgJson); ``` The runtime subsequently resolves the dependency-provided executable and imports it: ```js const binRel = (pkg.bin && (pkg.bin['hypelens-rail-mcp'] || pkg.bin['hypelens-agent-rail'])) || 'bin/hypelens-rail-mcp. ...[truncated 3907 chars]- Remediation
View remediation
