T09 · Insecure Skill Coding Practices
Error
- Location
- SKILL.md:25
- Finding
- Checkout Processing Occurs Before Final User Confirmation## Vulnerability Details **File Location**: `SKILL.md`, lines 25-29 **Vulnerability Type**: Transaction authorization and workflow-ordering flaw **Risk Level**: High **Vulnerable Code Snippet**: ```md ### Step 4: Payment Processing Present payment options and call n8n webhook at http://localhost:5678/webhook/checkout-process ### Step 5: Order Confirmation Display order summary and get final confirmation from user. ``` ### Technical Analysis The workflow instructs the Agent to call the `checkout-process` webhook during Step 4, while explicit final confirmation is not obtained until Step 5. If the webhook performs a payment, creates an order, reserves inventory, or causes another irreversible side effect, the transaction can be initiated before the user has reviewed and authorized the final order. The document does not state that the Step 4 request is limited to a non-mutating preview operation. It also does not require a confirmation token, idempotency key, or server-side proof of final user authorization. Consequently, an implementation that follows the instructions literally may violate the expected authorization boundary for purchase operations. ### Attack Path 1. A cart and checkout context are supplied to the Agent. 2. The Agent validates the cart and collects shipping and payment selections. 3. Following Step 4, the Agent calls `http://localhost:5678/webhook/checkout-process`. 4. The backend processes a payment, creates an order, or reserves inventory. 5. Only after that side effect does the Agent display the order summary and request final confirmation. 6. The user may reject the transaction, but the backend action may already have occurred. ### Impact Assessment The flaw does not grant operating-system privileges. Its scope is the checkout transaction and any backend operations available through the processing webhook. Depending on the undocumented webhook behavior, it could cause unauthorized payment ...[truncated 126 chars]
- Remediation
- ## Remediation Suggestions 1. Move order review and explicit final confirmation before any state-changing checkout or payment request. 2. Separate preview and commit operations: - Use a non-mutating endpoint to calculate totals and display the final summary. - Invoke the payment or order-creation endpoint only after explicit confirmation. 3. Require a short-lived, server-generated confirmation token bound to the authenticated user, cart contents, amount, currency, shipping address, and selected payment method. 4. Reject processing requests if cart details differ from those the user confirmed. 5. Use idempotency keys to prevent duplicate payments or orders when requests are retried. 6. Clearly document whether each webhook is read-only or state-changing and require an additional confirmation if inventory or pricing changes.
