T08 · Insecure Dependencies
Error
- Location
- scripts/package.json:5
- Finding
- Security-Sensitive Trading Components Are Installed and Executed Without Reproducible Integrity Verification<![CDATA[ ## Vulnerability Details **File Location**: `scripts/package.json:5-9`; `SKILL.md:38-43`; `scripts/setup.mjs:43-49`; `scripts/start-place-mcp.mjs:9-15`; `scripts/start-guard-mcp.mjs:10-16`; `scripts/start-watcher.mjs:10-14`; `NAUTILUS-SIDECAR.md:6-19,54-63` **Vulnerability Type**: T08: Insecure Dependencies **Risk Level**: High ### Complete Code Snippets `scripts/package.json:5-9`: ```json "dependencies": { "@hypelens/polymarket-place": "0.1.17", "@hypelens/hypelens-agent-guard": "0.1.18" } ``` `SKILL.md:38-43`: ```bash clawhub install polymarket-trade cd skills/polymarket-trade/scripts && npm install node setup.mjs --wallet 0xYourFundedPmProxy node start-place-mcp.mjs node start-watcher.mjs ``` `scripts/setup.mjs:43-49`: ```js console.log(' place OK @', dirname(placePkg)); console.log(' running agent-guard setup (arms dry-run stops)…'); console.log(''); process.argv = [process.argv[0], guardEntry, 'setup', '--scripts-dir', scriptsDir, ...process.argv.slice(2)]; await import(pathToFileURL(guardEntry).href); ``` `scripts/start-place-mcp.mjs:9-15`: ```js try { const pkgJson = require.resolve('@hypelens/polymarket-place/package.json'); const pkg = require(pkgJson); const binRel = (pkg.bin && (pkg.bin['polymarket-place-mcp'] || pkg.bin['polymarket-place'])) || 'bin/polymarket-place-mcp.js'; const entry = join(dirname(pkgJson), binRel); await import(pathToFileURL(entry).href); ``` `scripts/start-guard-mcp.mjs:10-16`: ```js try { const pkgJson = require.resolve('@hypelens/hypelens-agent-guard/package.json'); const pkg = require(pkgJson); const binRel = (pkg.bin && (pkg.bin['agent-guard-mcp'] || pkg.bin['agent-guard'])) || 'bin/agent-guard-mcp.js'; const entry = join(dirname(pkgJson), binRel); await import(pathToFileURL(entry).href); ``` `scripts/start-watcher.mjs:10-14`: ```js try { const pkgJson = require.resolve('@hypelens/hypelens-agent-guard/package.json'); const pkg = require(pkgJson); const bi ...[truncated 3514 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Commit `package-lock.json` generated from a trusted environment and require deterministic installation through `npm ci`. 2. Verify and review the complete resolved dependency graph, including transitive packages and lockfile integrity values. 3. Use `npm ci --ignore-scripts` where possible to prevent dependency lifecycle scripts from executing during installation. 4. Replace `npx` instructions with installation from a reviewed lockfile or a locally verified artifact. 5. Verify npm provenance or signed release attestations for the exact package versions. 6. Vendor and audit the security-sensitive package source, or publish reproducible build instructions and checksums for reviewed artifacts. 7. Run trading components in a restricted process or container with: - A minimal environment-variable allowlist. - Read-only filesystem access except for dedicated state directories. - Restricted outbound network access. - A non-privileged operating-system account. 8. Avoid exposing a broadly authorized private key. Use a narrowly scoped signing mechanism, separate exit-only credentials where supported, transaction limits, and explicit confirmation for sensitive operations. 9. Validate the resolved executable path against a fixed allowlist and verified digest before importing it. 10. Document the dependency trust boundary and require package re-audit before any version or lockfile update. ]]>
