Back to skill

Security audit

Polymarket Fee Aware Divergence

Security checks for vulnerabilities and agentic risk

Overview

This is an automated trading skill with disclosed purpose, but its live-trading authority and weak safety validation warrant careful review before installation.

Install only in a tightly limited trading environment. Keep the default sim venue until you have reviewed results, set account-side spending/order limits, expose only the required API key, avoid providing a wallet private key unless needed, and review or patch the validation gaps before enabling real-money trading.

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
fee_aware_divergence.py:96
Finding

Missing Fee and Spread Data Fail Open During Trade Evaluation

Content
View full analysis
MAX_SPREAD: return None, f"spread-too-wide:{spread:.3f}", {} ``` The resulting values are later used to authorize a trade: ```python raw_div = ai - price cost = fee + spread + SAFETY_MARGIN net_edge = abs(raw_div) - cost if net_edge < MIN_NET_EDGE: return None, f"insufficient-net-edge:{net_edge:.3f}<{MIN_NET_EDGE:.3f}", math side = "yes" if raw_div > 0 else "no" return side, "ok", math ``` ### Technical Analysis The evaluation logic treats a missing, null, or otherwise false-valued `fee_rate_bps` or `spread_pct` as a verified cost of zero. This is a fail-open design for data that directly controls whether a financial transaction is allowed. Consequently, an incomplete market-context response can artificially increase `net_edge`. The implementation may therefore approve a trade without accounting for the actual fee or bid-ask spread. This conflicts with the skill's documented purpose of placing trades only after fees and spread have been included. The code also does not verify that these fields are numeric, finite, and non-negative. The absence of explicit validation weakens the trust boundary between the remote SDK response and the trade authorization logic. ### Attack Path 1. The process requests market context through `client.get_market_context(m.id)`. 2. The returned context omits `fee_rate_bps`, omits `spread_pct`, or supplies a null value. 3. The code converts the missing cost component to `0`. 4. The computed `cost` is lower than the actual transaction cost. 5. The inflated `net_edge` passes the configured minimum- ...[truncated 729 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
fee_aware_divergence.py:22
Finding

Unvalidated Environment Configuration Can Disable Trading Safeguards

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
clawhub.json:4
Finding

Security-Sensitive Trading SDK Dependency Is Unpinned

Content
View full analysis
Remediation
View remediation
"] ``` The exact version must be selected after validating the authentic package and testing compatibility. ]]>
Vulnerability Patterns
  • 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
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (2)

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
86% confidence
Finding

The skill references environment-variable configuration but does not declare an explicit tool/permission scope, which creates ambiguity about what runtime capabilities the agent may access. In an automated trading context, undeclared env access can expose secrets or allow broader-than-expected operational behavior, especially if execution frameworks infer capabilities implicitly.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The manifest describes the skill as Polymarket-only, but the body explicitly supports routing trades to sim, Polymarket, or Kalshi via TRADING_VENUE. This mismatch can cause operators or policy engines to approve the skill under narrower assumptions than its actual behavior, leading to unintended live trading on unsupported venues.

Content

No source excerpt is available for this finding.