T09 · Insecure Skill Coding Practices
Error
- Location
- scripts/ari.py:1109
- Finding
- Server-Controlled Auto-Confirmation Can Trigger Paid Operations Without Transaction-Specific Consent<![CDATA[ ## Vulnerability Details **File Location**: `scripts/ari.py:1109-1114` **Additional Location**: `scripts/ari.py:1318-1323`, `SKILL.md:79-81`, `SKILL.md:132-133` **Vulnerability Type**: `T09: Insecure Skill Coding Practices` **Risk Level**: High ### Vulnerable Code ```python auto_confirmed = False if not confirm and q_data.get("autoConfirm") and q_data.get("sufficient"): confirm = True auto_confirmed = True if not confirm: return {"success": True, "data": {"confirmationRequired": True, "quote": q_data, ``` The same behavior is implemented in the combined collection and VOC workflow: ```python auto_max = int(analysis_quote.get("autoConfirmMaxCredits") or 0) auto_confirmed = (not args.confirm and bool(analysis_quote.get("autoConfirm")) and sufficient and total_credits <= auto_max) if not args.confirm and not auto_confirmed: ``` ### Technical Analysis The CLI allows a value supplied by the remote service, `autoConfirm`, to substitute for explicit confirmation of a chargeable operation. When the quote response reports both `autoConfirm: true` and sufficient credits, the local code changes `confirm` to `True` even though the user did not provide `--confirm`. This violates the security principle that authorization for a financial or quota-consuming action should be: 1. Explicitly supplied by the user. 2. Bound to the specific transaction and quoted amount. 3. Enforced locally at the final execution boundary. 4. Independent of untrusted or remotely mutable response data. The Skill instructions reinforce this behavior by directing the Agent to execute eligible paid operations without asking for transaction-specific confirmation. Although this may be an intended account feature, the remote service controls whether it is activated for a particular quote. Consequently, a compromised service, configuration error, stale account policy, or unexpected quote response can authorize spending without a fresh user decision. ### Att ...[truncated 1564 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Require `--confirm` for every chargeable operation at the final execution boundary. 2. Do not convert a remotely supplied `autoConfirm` value into local authorization. 3. If automatic spending is retained, require the user to enable it explicitly through a local configuration action. 4. Store the locally approved spending policy securely and bind it to: - A maximum amount per operation. - A maximum cumulative amount per session or day. - Specific operation types. - The intended service origin. 5. Before execution, compare the final operation amount against the locally approved limit rather than relying solely on quote fields. 6. Return the exact quote and require confirmation whenever the amount, operation type, ASIN, site, or competitor differs from the user's prior authorization. 7. Add an idempotency key to every paid request and reject accidental duplicate submissions. 8. Record a local audit entry containing the operation, quoted amount, confirmation source, timestamp, and request identifier without storing the full API key. 9. Change the Skill instructions so that an absent `--confirm` always means quote-only unless the user has explicitly enabled a clearly disclosed local spending policy. ]]>
