Back to skill

Security audit

nautilus-sidecar-stops

Security checks for vulnerabilities and agentic risk

Overview

This skill is purpose-aligned for Polymarket stop-loss automation, but it asks users to run live trading code with wallet key access through under-contained npm wrappers.

Review this carefully before installing. Use dry-run first, do not paste a production private key into shell history or broad environment files, prefer a dedicated low-authority exit wallet, and only enable live exits after verifying the npm package, policy limits, kill switch, and rollback path.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T08 · Insecure Dependencies

Warning
Location
scripts/setup.mjs:11
Finding
Unverified Third-Party Execution and Mutable Out-of-Package Fallback<![CDATA[ ## Vulnerability Details **File Locations**: - `scripts/package.json:6-8` - `scripts/setup.mjs:11-23` - `scripts/start-mcp.mjs:9-30` - `scripts/start-watcher.mjs:9-27` - `SKILL.md:34-44` - `BOT.md:2-3,6` - `ELIZA-COMPANION.md:6-10` - `NAUTILUS-SIDECAR.md:6-18,56-66` **Vulnerability Type**: Execution of unverified dependency code and an external local fallback **Risk Level**: Medium ### Vulnerable Code `scripts/package.json:6-8` declares the executable third-party dependency without an accompanying lockfile in the audited project: ```json "dependencies": { "@hypelens/hypelens-agent-guard": "0.1.18" } ``` `scripts/setup.mjs:11-23` dynamically imports the dependency and falls back to JavaScript outside the project package: ```js let entry; try { const pkgJson = require.resolve('@hypelens/hypelens-agent-guard/package.json'); entry = join(dirname(pkgJson), 'bin', 'agent-guard.js'); } catch { entry = join(scriptsDir, '..', '..', 'bin', 'agent-guard.js'); } if (!existsSync(entry)) { console.error('Missing @hypelens/hypelens-agent-guard. Run: npm install'); process.exit(1); } process.argv = [process.argv[0], entry, 'setup', '--scripts-dir', scriptsDir, ...process.argv.slice(2)]; await import(pathToFileURL(entry).href); ``` `scripts/start-mcp.mjs:9-30` imports an executable selected by package metadata and falls back after any caught dependency error: ```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); } catch (e) { try { const localEntry = join( dirname(fileURLToPath(import.meta.url)), '..', '..', 'bin', 'agent-guard-mcp.js', ); await import(pathToFileURL(localEntry).href); } catch { console.error('Missing dep ...[truncated 4872 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. **Establish dependency integrity** - Commit a generated lockfile containing resolved package URLs and npm integrity hashes. - Require reproducible installation with `npm ci`. - Verify the expected package integrity in CI before publication and deployment. - Maintain an audited software bill of materials for the executable dependency and its transitive dependencies. 2. **Avoid direct `npx` execution for wallet-sensitive operations** - Install reviewed dependencies from a lockfile before runtime. - Execute the verified local installation rather than allowing installation and execution to occur in one command. - Consider vendoring the security-critical launcher implementation so that the reviewed artifact contains the effective code. 3. **Remove or secure the external fallback** - Remove the `../../bin` fallback paths if they are not strictly required. - If a fallback is necessary, resolve it from a canonical trusted installation root. - Use `realpath` and verify that the resolved executable remains inside an approved directory. - Verify a cryptographic digest or signature before importing fallback code. - Refuse execution when ownership or filesystem permissions permit modification by untrusted users. 4. **Narrow error handling** - Separate dependency resolution from dependency execution. - Fall back only for a specifically identified module-not-found condition. - Do not switch executable sources after syntax errors, initialization failures, or exceptions thrown by imported dependency code. 5. **Constrain package metadata paths** - Validate that the selected `pkg.bin` target resolves inside the verified package directory. - Reject absolute paths and paths that escape the package directory. 6. **Reduce credential exposure** - Run the watcher under a dedicated operating-system account with minimal filesystem access. - Use a narrowly scoped trading key or wallet permiss ...[truncated 373 chars]
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (4)

Missing User Warnings

Medium
Confidence
95% confidence
Finding
The documentation gives executable commands for enabling a live trading watcher and explicitly references a private-key-based exit mode (`AGENT_GUARD_EXIT_PK` and `exits.dryRun:false`) without any adjacent warning about real-money trades, key handling, or wallet-loss risk. In the context of an automated trading sidecar, this omission can cause operators to run live exit automation with production credentials before understanding the financial and key-management consequences.

Missing User Warnings

Medium
Confidence
97% confidence
Finding
The skill instructs the user to export a raw private key environment variable (`AGENT_GUARD_EXIT_PK`) for a process that can place live protective SELL orders from the funder context. Environment variables are commonly exposed through shell history, process inspection, logs, CI/CD output, container metadata, and misconfigured telemetry, so documenting this pattern without strong key-handling warnings or safer alternatives creates a real credential-exposure and unauthorized-trading risk.

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The document explicitly tells users to disable dry-run and notes that setup auto-enables live exits when `EXIT_PK` is present, meaning a copy/paste setup can arm automated real trading behavior with little friction. In the context of an unattended trading sidecar sharing the same funder wallet as a live Nautilus node, this raises the risk of irreversible sells, misconfiguration-triggered liquidation, or abuse if the process or policy is tampered with.

Vague Triggers

Medium
Confidence
93% confidence
Finding
The skill advertises a very broad set of activation keywords and aliases spanning Nautilus, Polymarket, stop-loss, sidecar, MCP, and related terms without clear gating conditions. In an agent ecosystem, this can cause the skill to be invoked in loosely related contexts, increasing the chance of unintended installation or execution of trading-sidecar instructions against a live wallet environment.

Static analysis

No suspicious patterns detected.