T09 · Insecure Skill Coding Practices
- Location
trade.py:140- Finding
Unscoped Exit Logic Can Liquidate Unrelated YES Positions
- Content
View full analysis
0 and prob is not None and prob >= EXIT_THRESHOLD: ctx = get_context(mid) if args.strict_warnings and has_blocking_warnings(ctx): print(f"Skip EXIT due to warnings: {mid} warnings={ctx.get('warnings')}") continue reasoning = f"Exit: prob {prob:.0%} >= {EXIT_THRESHOLD:.0%}. Selling entire YES position." res = trade( mid, "yes", action="sell", venue="sim", shares=shares_yes, reasoning=reasoning, live=live, ) print("EXIT result:", res) exits_done += 1 ``` ### Technical Analysis The exit pass retrieves all simulation positions associated with the authenticated account and considers every positive YES position eligible for liquidation once its probability reaches 45%. Unlike the entry pass, the exit logic does not: - Confirm that the associated market is related to weather or temperature. - Confirm that the position was opened by this skill. - Check the position's `source` or `skill_slug`. - Maintain a local allowlist of market IDs opened by the strategy. Consequently, the skill's authority is broader than its documented weather-market strategy. The trade payload sells the full `shares_yes` balance, so an unrelated qualifying position can be liquidated completely. ### Att ...[truncated 914 chars]- Remediation
View remediation
