T08 · Insecure Dependencies
- Location
scripts/common.js:25- Finding
Unpinned Runtime Dependency Installation Exposes the Host to Supply-Chain Code Execution
- Content
View full analysis
{ try { require.resolve(d, { paths: [__dirname] }); return false; } catch { return true; } }); if (missing) { console.log('📦 Installing Solana dependencies (first run, ~15s)...'); const { execSync } = require('child_process'); execSync('npm init -y 2>/dev/null && npm install --silent @solana/web3.js@1 @coral-xyz/anchor @solana/spl-token bs58 tweetnacl', { cwd: __dirname, stdio: ['pipe', 'pipe', 'inherit'], }); console.log('✅ Dependencies installed.\n'); } } ``` ### Technical Analysis Every Skill script invokes `ensureDeps()`. If any expected package is unavailable, the function runs `npm install` automatically using the invoking user's permissions. Most dependencies have no exact version constraint. Even `@solana/web3.js@1` permits npm to select changing releases within the major version. The installation is also not backed by a reviewed lockfile or explicit integrity hashes and uses the user's ambient npm registry configuration. Consequently, the code installed and executed during a future run may differ from the code that was originally audited. npm packages can execute lifecycle scripts during installation. A compromised dependency release, npm account, registry, transitive dependency, or locally configured registry could therefore execute arbitrary code before the Skill processes the user's wallet. The command also installs `@coral-xyz/anchor`, although it is not required by the reviewed scripts, unnecessarily increasing the dependency and transitive-package attack surface. This is not direct remote payload retrieval implemented by the Skill itself, but i ...[truncated 1518 chars]- Remediation
View remediation
