Back to skill

Security audit

Polymarket Micro Spread Sniper Trader

Security checks for vulnerabilities and agentic risk

Overview

This is a real-money automated trading skill whose core behavior is disclosed, but its documented strategy and implemented safeguards do not line up well enough for low-risk installation.

Install only if you are comfortable reviewing and controlling an automated trading script. Use simulation first, avoid enabling --live until the thresholds, market-discovery claims, liquidity checks, and slippage/flip-flop safeguard are fixed, and use a dedicated low-limit SIMMER_API_KEY that can be revoked quickly.

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)

T09 · Insecure Skill Coding Practices

Error
Location
trader.py:139
Finding

Declared Slippage and Flip-Flop Safeguards Are Never Enforced

Content
View full analysis
tuple[bool, str]: """Check flip-flop and slippage safeguards.""" try: ctx = client.get_market_context(market_id) if not ctx: return True, "no context" if ctx.get("discipline", {}).get("is_flip_flop"): reason = ctx["discipline"].get("flip_flop_reason", "recent reversal") return False, f"Flip-flop: {reason}" slip = ctx.get("slippage", {}) if isinstance(slip, dict) and slip.get("slippage_pct", 0) > 0.15: return False, f"Slippage {slip['slippage_pct']:.1%}" for w in ctx.get("warnings", []): safe_print(f" [warn] {w}") except Exception as e: safe_print(f" [ctx] {market_id}: {e}") return True, "ok" ``` ```python # Pre-filter: only call context_ok on markets that pass signal check candidates = [] for m in markets: side, size, reasoning, sig = compute_signal(m) if side: candidates.append((m, side, size, reasoning, sig)) safe_print(f"[micro-spread-sniper] {len(candidates)} pass signal filter") placed = 0 attempts = 0 max_attempts = min(len(candidates), MAX_POSITIONS + 5) for m, side, size, reasoning, sig in candidates: if placed >= MAX_POSITIONS or attempts >= max_attempts: break attempts += 1 try: trade_kwargs = dict( market_id=m.id, side=side, amount=size, source=TRADE_SOURCE, skill_slug=SKILL_SLUG, reasoning=reasoning, ) if sig: trade_kwargs["signal_data"] = sig r = client.trade(**trade_kwargs) ``` ### Technical Analysis The `context_ok()` function implements two explicit trade-blocking controls: 1. It rejects a market when the context reports recent flip-f ...[truncated 1832 chars]
Remediation
View remediation
0.15`; - context API failure; - safe context results. 5. Assert in those tests that `client.trade()` is never called for rejected or unverifiable contexts. 6. Consider adding a configurable aggregate run-level loss or notional limit in addition to per-trade limits. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
trader.py:89
Finding

Missing Spread or Volume Data Bypasses Mandatory Liquidity Gates

Content
View full analysis
MAX_SPREAD: return None, 0, f"Spread {market.spread_cents/100:.1%} > {MAX_SPREAD:.1%}", None # Days-to-resolution gate — very permissive, we WANT fast resolution if market.resolves_at: try: resolves = datetime.fromisoformat(market.resolves_at.replace("Z", "+00:00")) days = (resolves - datetime.now(timezone.utc)).days if days < MIN_DAYS: return None, 0, f"Only {days} days to resolve", None except Exception: pass # Volume gate — need enough liquidity for tight spreads to be meaningful vol = getattr(market, "volume", None) or getattr(market, "volume_24h", None) if vol is not None and vol < MIN_VOLUME: return None, 0, f"Volume ${vol:.0f} < ${MIN_VOLUME:.0f}", None ``` ### Technical Analysis The strategy describes spread and volume as mandatory gates, but the implementation rejects a market only when the corresponding value is present and exceeds or falls below the configured boundary. If `market.spread_cents` is `None`, the spread check is skipped and the market remains eligible. Similarly, if both volume attributes are absent, `vol` becomes `None` and the volume check is skipped. The volume selection expression also uses Boolean fallback: ```python getattr(market, "volume", None) or getattr(market, "volume_24h", None) ``` Consequently, a legitimate numeric volume of zero is treated as absent and replaced by `volume_24h`. If that secondary value is also unavailable, the market bypasses the gate entirely. No finite-number or range validation is performed. Malformed values such as `NaN` may also evade ordinary comparison semantics because comparisons involving `NaN` evaluate false. # ...[truncated 1288 chars]
Remediation
View remediation
MAX_SPREAD: return None, 0, f"Spread {spread:.1%} outside allowed range", None vol = getattr(market, "volume", None) if vol is None: vol = getattr(market, "volume_24h", None) if not isinstance(vol, (int, float)) or not math.isfinite(vol): return None, 0, "Missing or invalid volume", None if vol < MIN_VOLUME: return None, 0, f"Volume ${vol:.0f} < ${MIN_VOLUME:.0f}", None ``` Further hardening should include: 1. Validate `current_probability` as a finite number in the range `[0, 1]`. 2. Reject negative spread and volume values. 3. Avoid Boolean `or` when zero is a valid numeric value. 4. Define whether total volume or 24-hour volume is authoritative and apply that definition consistently. 5. Reject malformed resolution timestamps when `MIN_DAYS` is a required gate rather than silently ignoring parsing errors. 6. Re-fetch and validate the order book immediately before live execution. 7. Add tests for `None`, zero, negative values, `NaN`, infinity, malformed strings, and absent attributes. ]]>

T08 · Insecure Dependencies

Warning
Location
clawhub.json:5
Finding

Trading SDK Dependency Is Unpinned and Executes with Credential Access

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (11)

Tp4

High
Category
MCP Tool Poisoning
Confidence
94% confidence
Finding

The skill's declared behavior materially differs from the documented/default operating logic: it claims broad market coverage and symmetric extreme-probability trading, but actually uses limited discovery and disables one trade branch by default. In a live trading context, this can mislead operators about strategy exposure, coverage, and risk, causing unintended financial decisions based on false assumptions.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documented strategy says it only trades at extreme probabilities around 15%/85%, but the live defaults are materially different at 0%/80%. In a real-money trading skill, this can cause the agent to place trades outside the advertised risk envelope, increasing exposure and making operator review or policy-based safeguards ineffective.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
87% confidence
Finding

The skill documents use of environment-based credentials (SIMMER_API_KEY) and live trading capability, but it does not declare an explicit tool/permission scope. That weakens least-privilege controls and makes it harder for a host platform or reviewer to understand what sensitive capabilities the skill needs, increasing the chance of over-broad execution rights.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

Claiming to scan all Polymarket categories when the documented logic only checks a small fixed keyword set plus limited fallback scans is a deceptive capability overstatement. In a trading skill, that can cause users to trust incomplete market discovery and miss concentration risk or blind spots in what the strategy actually evaluates.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The documentation presents inconsistent thresholds and trade-direction defaults, including conflicting probability bands and a YES-longshot mode that is effectively disabled by default. These contradictions can lead operators to deploy a materially different strategy than intended, undermining risk controls and informed consent in financial automation.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The skill enables live real-money trading with a --live flag and notes 'Real USDC,' but it does not provide an explicit, prominent warning about the possibility of financial loss from executing bets. For a trading skill, insufficient risk disclosure increases the chance of accidental or underinformed live deployment.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This manifest defines an automated trading skill that requires an API credential and can place autonomous positions, yet it provides no explicit warning about financial risk, live trading behavior, or credential sensitivity. In this context, missing safety disclosure increases the chance of unsafe deployment, accidental real-money trading, and mishandling of privileged API access.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill description says it places micro bets on near-certain outcomes using extreme probability thresholds of <=15% or >=85%. However, the tunables set the high threshold default to 0.8 and allow YES threshold default 0.0 (disabled), which materially broadens or alters the stated trading behavior rather than just implementing it.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The manifest says the skill 'scans all Polymarket categories,' implying broad category coverage. In practice, the explicit search strategy is limited to four crypto-related keywords, and the code does not enumerate or iterate through all categories; it supplements this with generic market-fetch endpoints rather than true category-wide scanning.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The file defines a context_ok safeguard for flip-flop and slippage checks, but run() never calls it before submitting trades. In this trading context, bypassing a declared pre-trade safeguard can directly lead to avoidable live trades in unstable or recently reversed markets, increasing financial loss risk.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The label 'YES longshot threshold (0 = disabled, NO-mode only)' asserts a NO-only mode when disabled, but the same manifest still presents a configurable YES-threshold mechanism for enabling YES bets. This documentation is not just incomplete; it describes the mode in a way that can mislead users about the actual available behavior.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.