T05 · Unauthorized Access and Privilege Escalation
Error
- Location
- scripts/trade.py:22
- Finding
- Undocumented Direct Live-Order Trading Capability<![CDATA[ ## Vulnerability Details **File Location**: `scripts/trade.py:22-46` **Vulnerability Type**: Undeclared privileged financial operation **Risk Level**: High ### Vulnerable Code ```python async def cmd_order(args): order_type = args.type.upper() if order_type == "LIMIT" and args.price is None: print("Error: --price is required for limit orders") sys.exit(1) print(f"⚠️ Placing {order_type} {args.side.upper()} order:") print(f" {args.amount} {args.pair} on {args.connector} ({args.account})") if args.price: print(f" Price: {args.price}") confirm = input("Confirm? [y/N] ").strip().lower() if confirm != "y": print("Cancelled.") return async with client() as c: result = await c.trading.place_order( account=args.account, connector=args.connector, trading_pair=args.pair, side=args.side.upper(), amount=float(args.amount), order_type=order_type, price=float(args.price) if args.price else None, ) ``` ### Technical Analysis The Skill manifest advertises only the `connect`, `balance`, `create`, `start`, `stop`, `status`, and `history` commands. However, the packaged `trade.py` script exposes a direct order-placement interface capable of submitting market and limit orders to connected exchange accounts. This materially exceeds the declared command scope and gives the Skill a direct mechanism for committing user funds. Although the function asks for interactive confirmation, it has no notional-value ceiling, balance check, slippage protection, price-band policy, or account-specific authorization check. Market orders are especially sensitive because they are submitted without a price constraint. The confirmation prompt reduces accidental execution but does not establish a reliable security boundary in an Agent environment, where input may be generated or relayed automatically. ### Attack ...[truncated 1070 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Remove `trade.py` if direct discretionary trading is not part of the intended Skill. - Otherwise, explicitly document the direct order, cancellation, position, and trade-history commands in `SKILL.md`. - Require an approval mechanism that cannot be automatically satisfied by the same Agent initiating the transaction. - Display and approve the estimated quote notional, applicable leverage, expected fees, and maximum slippage before submission. - Reject non-finite, zero, negative, or policy-exceeding amounts and prices. - Add configurable per-order and per-day notional limits. - Default to limit orders and require an additional explicit authorization for market orders. - Enforce account, connector, and trading-pair allowlists. - Use exchange credentials restricted to required markets and permissions, with withdrawals disabled. ]]>
