T09 · Insecure Skill Coding Practices
- Location
trader.py:244- Finding
Configured Minimum-Volume Safeguard Is Never Enforced
- Content
View full analysis
list: """Find active markets matching strategy keywords, deduplicated.""" seen, unique = set(), [] for kw in KEYWORDS: try: for m in client.find_markets(query=kw): if m.id not in seen: seen.add(m.id) unique.append(m) except Exception as e: safe_print(f"[search] {kw!r}: {e}") return unique ``` ### Technical Analysis The skill defines and exposes `MIN_VOLUME` as a configurable risk parameter. The documentation describes it as the minimum market-volume filter, but neither `find_markets()` nor `compute_signal()` inspects a market's volume. Consequently, every discovered market that satisfies the other signal conditions remains eligible for an order, regardless of liquidity. This is an ineffective security and financial-risk control rather than merely an undocumented feature. ### Attack Path 1. An attacker creates, promotes, or influences a low-volume prediction market. 2. The market question contains a keyword accepted by `KEYWORDS` and `_GEOPOLITICS_RE`. 3. `find_markets()` adds the market without evaluating its volume. 4. The probability, spread, and resolution checks produce a trade signal. 5. In live mode, the skill submits a real order into the illiquid market. 6. The attacker may exploit the shallow market through price manipulation or unfavorable liquidity. ### Impact Assessment The issue does not grant operating-system privileges. Its scope is the trading account authorized by `SIMMER_API_KEY`. Potential consequences include: - Orders in illiquid or easily manipulated markets. - Greater realized slippage than expected ...[truncated 144 chars]- Remediation
View remediation
tuple[bool, str]: try: volume = float(market.volume) except (AttributeError, TypeError, ValueError): return False, "Missing or invalid market volume" if volume < MIN_VOLUME: return False, f"Volume ${volume:,.2f} below ${MIN_VOLUME:,.2f}" return True, "ok" ``` Apply this check before `compute_signal()` or as the first gate inside it. ]]>
