Back to skill

Security audit

nautilus-polymarket-stops

Security checks for vulnerabilities and agentic risk

Overview

This skill is for protective Polymarket stop-loss trading, but it asks users to run privileged third-party trading code with live wallet keys and weak safety boundaries.

Review carefully before installing. Use only a dedicated low-value, least-privilege exit signer, keep dry-run enabled until fully tested, avoid placing private keys in shell history or Docker environment variables, and verify the exact @hypelens/hypelens-agent-guard package version and code before running the watcher or MCP server.

Vulnerability Patterns
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (3)

T08 · Insecure Dependencies

Error
Location
scripts/setup.mjs:12
Finding
Security-Critical Behavior Is Delegated to Unreviewed Third-Party Executable Code<![CDATA[ ## Vulnerability Details **File Location**: `scripts/package.json:6-8`, `scripts/setup.mjs:12-23`, `scripts/start-mcp.mjs:10-17`, `scripts/start-watcher.mjs:10-14` **Vulnerability Type**: Third-party supply-chain exposure and execution of code outside the audited project **Risk Level**: High ### Evidence `scripts/package.json:6-8`: ```json "dependencies": { "@hypelens/hypelens-agent-guard": "0.1.18" } ``` `scripts/setup.mjs:12-23`: ```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:10-17`: ```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 binRel = (pkg.bin && pkg.bin['agent-guard-watcher']) || 'bin/agent-guard-watcher.js'; const entry = join(dirname(pkgJson), binRel); await import(pathToFileURL(entry).href); ``` ### Technical Analysis The project contains almost no implementation of its claimed security and trading functions. Instead, setup, MCP operation, wallet monitoring, and transaction enforcement are delegated to executable files supplied by `@hypelens/hypelens-agent-guard`. The dependency's source ...[truncated 2604 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Vendor the exact reviewed dependency source or distribution artifact into the project. 2. Commit a lockfile that records package versions and registry integrity hashes. 3. Verify the downloaded package against an independently published checksum or signature before execution. 4. Audit all dependency lifecycle scripts, binary mappings, transitive dependencies, network endpoints, and private-key handling. 5. Remove the `../../bin` fallback paths or restrict execution to a canonical file located inside the installed and verified package. 6. Resolve expected binary names explicitly instead of trusting mutable package metadata. 7. Run the watcher in an isolated container or dedicated operating-system account with: - A read-only root filesystem. - Access only to required policy and state directories. - Restricted outbound network destinations. - No access to unrelated user files or host sockets. 8. Use automated dependency scanning and require review before changing the pinned package artifact. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
NAUTILUS-SIDECAR.md:7
Finding
Live Trading Private Key Is Passed Through Shell and Container Environment Variables<![CDATA[ ## Vulnerability Details **File Location**: `NAUTILUS-SIDECAR.md:7-10`, `NAUTILUS-SIDECAR.md:16-19`, `NAUTILUS-SIDECAR.md:57-63`, `SKILL.md:44-47`, `ELIZA-COMPANION.md:7-10` **Vulnerability Type**: Insecure handling of a private key capable of authorizing live financial transactions **Risk Level**: High ### Evidence `NAUTILUS-SIDECAR.md:7-10`: ```bash npx @hypelens/hypelens-agent-guard@0.1.18 setup --wallet 0xYourFunder export AGENT_GUARD_EXIT_PK=0xYourExitKey # can SELL funder positions # set exits.dryRun: false in the written policy npx @hypelens/hypelens-agent-guard@0.1.18 watcher ``` `NAUTILUS-SIDECAR.md:16-19`: ```bash npm pack @hypelens/hypelens-agent-guard@0.1.18 && tar -xzf hypelens-hypelens-agent-guard-0.1.18.tgz cp -r package/compose/* . && rm -rf package *.tgz export FUNDER=0xYourFunder EXIT_PK=0xYourExitKey ./up.sh ``` `NAUTILUS-SIDECAR.md:57-63`: ```yaml services: agent-guard-watcher: image: node:22-bookworm-slim working_dir: /app command: bash -lc "npm i @hypelens/hypelens-agent-guard@0.1.18 && npx hypelens-agent-guard setup --wallet $FUNDER && npx hypelens-agent-guard watcher" environment: - AGENT_GUARD_EXIT_PK=${EXIT_PK} ``` `SKILL.md:44-47`: ```bash npm pack @hypelens/hypelens-agent-guard@0.1.18 && tar -xzf hypelens-hypelens-agent-guard-0.1.18.tgz cp -r package/compose/* . && export FUNDER=0xYourFunder EXIT_PK=0xYourExitKey docker compose up -d --build # EXIT_PK → setup auto-flips dryRun:false (0.1.18+). Proof: AGENT_GUARD_EXIT_ON_BREACH=1 → exit 10 ``` ### Technical Analysis The documentation directs users to place a private key in `AGENT_GUARD_EXIT_PK` or `EXIT_PK`. The comments explicitly state that the key can sell positions associated with the funder wallet. The key is then inherited by third-party package code and, in the Docker configuration, inserted into the container environment. Environment variables are not an appropriate primary secret-storage mechanism for a high-value signing creden ...[truncated 2079 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Replace environment-variable key delivery with a secret manager, hardware signer, or isolated signing service. 2. If file-based delivery is unavoidable, mount a dedicated secret file read-only with restrictive permissions and ensure it is never committed or logged. 3. Use a dedicated low-value signer with the narrowest possible transaction authority, spending limits, market restrictions, and expiration time. 4. Separate possession of the key from activation of live trading. Require an explicit, independently validated live-mode setting. 5. Do not automatically change `exits.dryRun` merely because a private key is present. 6. Keep dry-run mode enabled by default and require clear operator confirmation before each transition to live operation. 7. Restrict access to Docker and orchestration APIs, because administrators of those systems can generally inspect or alter container execution. 8. Ensure logs, crash reports, telemetry, and debug output redact all secret values. 9. Rotate any key previously placed in insecure shell configuration, compose files, logs, or diagnostic output. 10. Document the exact authority required by the signer and warn users not to supply a primary wallet key. ]]>

T08 · Insecure Dependencies

Warning
Location
BOT.md:3
Finding
Documentation Executes Multiple Inconsistent Versions of a Security-Critical Package<![CDATA[ ## Vulnerability Details **File Location**: `BOT.md:3-6`, `ELIZA-COMPANION.md:7-10`, `scripts/package.json:6-8`, `SKILL.md:44-47` **Vulnerability Type**: Inconsistent and potentially obsolete executable dependency versions **Risk Level**: Medium ### Evidence `BOT.md:3-6`: ```text 2. Install: `clawhub install pm-desk` (or `clawhub install agent-guard` / `clawhub install polymarket-stops`) → `cd skills/*/scripts && npm install`. 3. Arm: `node setup.mjs --wallet 0xYourFundedPmProxy` (or `npx @hypelens/hypelens-agent-guard@0.1.15 setup --wallet 0x…`) — **dry-run stops arm immediately**; live = `EXIT_PK` + `exits.dryRun:false`. 4. Heartbeat: call MCP `heartbeat` (or `guard_heartbeat`) **before sizing** — if stale/`!ok`/disarmed, do not increase size. 5. Tools: `stop` · `trailing` · `portfolio` · `heartbeat` (+ `guard_tick` / watcher). Never trade `0x9548…`. HL protective FILLED = **1bp NOW**; PM builderCode baked (rates LIVE still **0/0** until flip). ``` `ELIZA-COMPANION.md:7-10`: ```bash npx @hypelens/hypelens-agent-guard@0.1.14 setup --wallet 0xYourFunder npx @hypelens/hypelens-agent-guard@0.1.14 watcher # live: AGENT_GUARD_EXIT_PK + exits.dryRun:false ``` `scripts/package.json:6-8`: ```json "dependencies": { "@hypelens/hypelens-agent-guard": "0.1.18" } ``` `SKILL.md:44-47`: ```bash npm pack @hypelens/hypelens-agent-guard@0.1.18 && tar -xzf hypelens-hypelens-agent-guard-0.1.18.tgz cp -r package/compose/* . && export FUNDER=0xYourFunder EXIT_PK=0xYourExitKey docker compose up -d --build # EXIT_PK → setup auto-flips dryRun:false (0.1.18+). Proof: AGENT_GUARD_EXIT_ON_BREACH=1 → exit 10 ``` ### Technical Analysis The project presents three different versions of the same security-critical package: - Version `0.1.14` in `ELIZA-COMPANION.md`. - Version `0.1.15` in `BOT.md`. - Version `0.1.18` in `scripts/package.json`, `SKILL.md`, and `NAUTILUS-SIDECAR.md`. The package handles setup, wallet monitoring, policy enforcement, and potentially live tr ...[truncated 1916 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Select one reviewed release and use it consistently in every document, script, container definition, and example. 2. Remove the obsolete `0.1.14` and `0.1.15` commands. 3. Avoid direct `npx` execution for wallet-sensitive software. Install from the lockfile and invoke the verified local binary instead. 4. Add a lockfile with integrity hashes and publish a checksum or signature for the approved artifact. 5. Add automated documentation tests that fail when package-version strings diverge. 6. Document security-relevant changes between releases, especially private-key handling, dry-run defaults, and live-mode activation. 7. Refuse to start when the installed package version differs from the explicitly approved version. ]]>
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 (5)

Missing User Warnings

Medium
Confidence
96% confidence
Finding
The documentation explicitly instructs users to enable live mode with `AGENT_GUARD_EXIT_PK + exits.dryRun:false`, which implies use of a real private key for trading actions, but it provides no adjacent warning about irreversible financial loss, private key handling, or operational safeguards. In a live trading sidecar context, this omission is materially dangerous because users may paste hot-wallet credentials into an automated process without understanding the exposure or the fact that real orders can be submitted.

Missing User Warnings

Medium
Confidence
92% confidence
Finding
The skill instructs the user to export a live private key (`AGENT_GUARD_EXIT_PK`) that can place SELL orders, but it does not provide a strong, prominent warning about custody, scope of authority, key isolation, or the consequences of compromise/misconfiguration. In a trading sidecar context, this can enable unauthorized or unintended liquidation of positions if the environment is exposed, logs leak, or the wrong key is supplied.

Missing User Warnings

High
Confidence
96% confidence
Finding
The document states that providing `EXIT_PK` causes setup to auto-flip `exits.dryRun:false` and describes immediate exit behavior on breach, which can lead to irreversible live trading actions without an explicit interactive confirmation or prominent safety warning. In this context, the skill is specifically designed to execute protective SELLs on a live market, so an accidental paste, misconfigured threshold, or misunderstood dry-run setting could trigger real orders and losses immediately.

Vague Triggers

Medium
Confidence
87% confidence
Finding
The skill advertises activation through a very broad set of aliases, keywords, and related terms without clear constraints on when it should be invoked. In an automated agent ecosystem, this can cause the skill to trigger in loosely related Nautilus/Polymarket contexts and steer an agent into setup or trading-adjacent actions the user did not explicitly request.

Missing User Warnings

High
Confidence
96% confidence
Finding
The skill provides operational instructions for live exits using an environment variable containing a private key (EXIT_PK) and explicitly notes that supplying it disables dry-run behavior. Because there is no prominent warning about irreversible financial actions, wallet-key handling, or safe key storage, an agent or user could move directly from reading documentation to executing real trades with exposed credentials.

Static analysis

No suspicious patterns detected.