T09 · Insecure Skill Coding Practices
- Location
scripts/ad_clone.py:193- Finding
Paid generation endpoint lacks an enforced user-confirmation gate
- Content
View full analysis
Vulnerability Details
File Location:
scripts/ad_clone.py, lines 193–199
Vulnerability Type: Unconfirmed credit-charging operation
Risk Level: MediumComplete Code Snippet
python def cmd_draft_submit(client, args) -> dict: receipt = client.post(DRAFT_SUBMIT, { "clone_id": args.clone_id, "edits": build_edits(args) or None, "video": build_video(args) or None, "callback_id": args.callback_id, "idempotency_key": args.idempotency_key, })Technical Analysis
The Skill documentation states that
draft-submitcharges credits and must only be invoked after the user has reviewed the quote returned bydraft-previewand explicitly confirmed submission. However, the executable submission path does not enforce that authorization requirement.Calling
draft-submitimmediately sends the supplied clone ID, edits, and generation options to the credit-charging/openapi/v2beta/adclone/submitendpoint. There is no required confirmation flag, expected-price check, preview receipt, or server-issued authorization token proving that the user approved the exact quoted operation.The confirmation requirement therefore exists only as an Agent-facing instruction. A mistaken Agent invocation or an untrusted workflow instruction that causes the Agent to select
draft-submitcan bypass the documented preview-and-confirm sequence.Attack Path
- A draft is created, producing a valid
clone_id. - An Agent workflow, including one influenced by untrusted task content, invokes
draft-submitdirectly rather than obtaining and presenting adraft-previewquote. - The CLI accepts the clone ID and generation parameters without requiring evidence of user approval.
cmd_draft_submitimmediately sends a POST request to/openapi/v2beta/adclone/submit.- The remote service charges credits and starts generation before the user has confirmed the price and exact generation settings.
This path require ...[truncated 581 chars]
- A draft is created, producing a valid
- Remediation
View remediation
Remediation Suggestions
- Require an explicit confirmation argument such as
--confirm-chargebefore permittingdraft-submit. - Require the caller to supply the expected quoted price and reject submission if it differs from the current server-side quote.
- Prefer a server-issued, short-lived preview token that cryptographically binds the approval to:
- the
clone_id; - the exact edits;
- video duration, resolution, aspect ratio, and quantity;
- the quoted credit cost;
- an expiration time.
- the
- Make the submission endpoint reject requests without a valid preview token.
- Display the final price and settings immediately before submission and require an affirmative user response in interactive use.
- Preserve idempotency protection so retries cannot create duplicate charges.
- Require an explicit confirmation argument such as
