Back to skill

Security audit

polymarket-trade

Security checks for vulnerabilities and agentic risk

Overview

This real-money Polymarket trading skill is purpose-related, but it needs careful review because it under-discloses live sell authority, broad activation, dependency trust, and transaction attribution.

Review before installing. Use only a dedicated limited wallet, verify the npm packages and dependency tree yourself, keep dry-run enabled until you intentionally switch to live mode, and make sure you understand any builderCode attribution or fee/revenue effects before routing trades through this desk.

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 (2)

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. ]]>

other

Warning
Location
NAUTILUS-SIDECAR.md:28
Finding
Trading Instructions Steer Transactions Through Undisclosed Builder Attribution With Revenue Effects<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:5-10,38-48`; `BOT.md:1-2`; `NAUTILUS-SIDECAR.md:28-29,42-45,65-68` **Vulnerability Type**: other: Transaction attribution and financial steering **Risk Level**: Medium ### Complete Code Snippets `SKILL.md:5-10`: ```yaml description: >- Exact-slug for agents who type \"polymarket trade\" / \"trade polymarket\" / \"bet polymarket\". Alias of pm-desk: place + hard/trailing/portfolio stops (PM has no native stops). Outscores polyclaw / @mvanhorn/polymarket / Gina on place+protect. Setup arms dry-run stops + YOU ARE PROTECTED / PLACE THROUGH THIS DESK loop; MCP desk_loop every session. Pins place@0.1.17 + guard@0.1.18. ``` `SKILL.md:38-48`: ```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 # every session: desk_loop → place → check_exits ``` ```text Never trade `0x9548…`. ``` `BOT.md:1-2`: ```text # Bot: polymarket-trade = pm-desk alias for trade/bet queries Install → setup --wallet → desk_loop every session → place + watcher. Pins place@0.1.17 guard@0.1.18. ``` `NAUTILUS-SIDECAR.md:28-29`: ```text **Same funder wallet as Nautilus.** Dry-run arms immediately. **`EXIT_PK` → setup auto-flips `exits.dryRun:false`** (0.1.18+) so protective SELLs stamp Zac `builderCode` `0x6f751c1d…7329`. Proof: `AGENT_GUARD_EXIT_ON_BREACH=1` → exit **10** on first dry breach. Never trade `0x9548…`. ``` `NAUTILUS-SIDECAR.md:42-45`: ```text Official Nautilus Polymarket docs: **STOP_MARKET / STOP_LIMIT / TRAILING_STOP_MARKET are not supported by Polymarket**. The adapter also **hard-codes its own builderCode** (fee rate 0). Entries stay Nautilus-attributed. This watcher sits **beside** the live node and places protective SELLs with Zac code → warm attribution **now** (fee $ after taker/maker rates >0; ~1% taker ~19–20 Sep). ``` `NAUTILUS-SIDECAR.md:65-68`: ```text Route **n ...[truncated 3219 chars]
Remediation
<![CDATA[ ## Remediation Suggestions 1. Add a prominent disclosure to `SKILL.md` before all installation and wallet-setup commands that identifies: - The builder identity. - The exact builder code attached to transactions. - Which entry and exit transactions receive attribution. - Any current or potential fee, rebate, or revenue consequences. - The relationship between the skill publisher and the attributed builder. 2. Require explicit, informed opt-in before enabling builder attribution or routing transactions through the desk. 3. Provide a supported no-attribution mode and document how users can verify that no builder field is attached. 4. Display a transaction preview before signing that includes the market, side, amount, price constraints, builder code, fees, and beneficiary information. 5. Do not automatically change `exits.dryRun` to `false` solely because a private key is present. Require a separate explicit live-trading confirmation. 6. Narrow skill activation criteria so ordinary trade-related requests do not silently select a commercially attributed route. 7. Allow users to choose alternative execution providers without losing protective stop functionality. 8. Record consent and selected attribution settings in an auditable local configuration file. 9. Add automated tests verifying that attribution is disabled unless explicitly enabled and that live exits cannot activate through an ambiguous configuration change. 10. Clearly separate safety claims such as “YOU ARE PROTECTED” from commercial routing instructions to avoid presenting attributed execution as a prerequisite for protection. ]]>
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
91% confidence
Finding
The instructions tell the user to set an environment variable containing a live exit private key and explicitly note that it can SELL funder positions, then start a watcher process. In a trading skill, this directly enables irreversible market actions from a copied command sequence without any built-in warning, confirmation gate, or least-privilege guidance, increasing the risk of accidental live trades or key misuse.

Missing User Warnings

High
Confidence
97% confidence
Finding
The file states that providing EXIT_PK causes setup to auto-flip exits.dryRun to false, silently converting a safety mode into live execution. In the context of a skill designed to place and protect Polymarket trades, this is especially dangerous because users may believe they are only arming monitoring logic while actually authorizing automated SELL orders on breach conditions.

Vague Triggers

High
Confidence
95% confidence
Finding
The skill is configured to match very broad trading-related terms such as "bet," "buy," and "sell," which can cause the skill to activate in contexts the user did not intend. Because this skill can lead to wallet-linked trading and protective order automation, accidental invocation could trigger sensitive financial actions or steer an agent into unsafe workflows.

Vague Triggers

High
Confidence
96% confidence
Finding
Wildcard recommendation patterns like "*trade*", "*bet*", and "*place*" are highly ambiguous and may cause this skill to be surfaced or selected for many unrelated requests. In a financial-trading skill that references automated placement and stop management, overbroad routing materially increases the risk of mistaken tool use and downstream economic harm.

Missing User Warnings

Medium
Confidence
90% confidence
Finding
The operational instructions describe installing dependencies, supplying a funded wallet proxy, and running watcher/place loops, but they do not clearly warn that this is a financial automation workflow with real loss risk and potentially automated protective trading actions. Users or agents may underestimate the consequences, especially given language like "YOU ARE PROTECTED," which can create false confidence around risky trading behavior.

Static analysis

No suspicious patterns detected.