T09 · Insecure Skill Coding Practices
- Location
scripts/bricklink.py:1159- Finding
Authenticated BrickLink mutations execute without enforced confirmation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/bricklink.py:1159-1269; supporting behavior documented atSETUP.md:51-54
Vulnerability Type: Missing authorization confirmation for destructive and externally visible operations
Risk Level: MediumTechnical Analysis
The CLI exposes authenticated operations that immediately delete inventory, alter order and payment state, send customer email, or publish feedback. The implementation does not require an interactive confirmation, an explicit
--confirmcapability, or a dry-run stage.Representative destructive operation:
python def cmd_delete_inventory(args) -> int: creds = load_creds(args) base = API_BASE_DEFAULT inv_id = int(args.inventory_id) url = f"{base}/inventories/{inv_id}" data = api_call(creds, "DELETE", url) print(json.dumps(data, ensure_ascii=False, indent=2)) return 0Other authenticated mutations follow the same immediate-execution pattern:
python def cmd_update_order_status(args) -> int: creds = load_creds(args) base = API_BASE_DEFAULT oid = int(args.order_id) url = f"{base}/orders/{oid}/status" body = {"field": "status", "value": args.status} data = api_call(creds, "PUT", url, body_json=body) print(json.dumps(data, ensure_ascii=False, indent=2)) return 0 def cmd_update_payment_status(args) -> int: creds = load_creds(args) base = API_BASE_DEFAULT oid = int(args.order_id) url = f"{base}/orders/{oid}/payment_status" body = {"field": "payment_status", "value": args.payment_status} data = api_call(creds, "PUT", url, body_json=body) print(json.dumps(data, ensure_ascii=False, indent=2)) return 0 def cmd_send_drive_thru(args) -> int: creds = load_creds(args) base = API_BASE_DEFAULT oid = int(args.order_id) params = {} if args.mail_me: params["mail_me"] = "true" ...[truncated 2349 chars]- Remediation
View remediation
Remediation Suggestions
- Make mutating commands dry-run by default and print the HTTP method, resource, target identifier, and proposed changes without sending the request.
- Require a deliberate
--confirmor--executeflag before anyPOST,PUT, orDELETEoperation. - For destructive operations such as inventory deletion, require an operation-specific confirmation value, such as
--confirm-delete <inventory_id>, and verify that it matches the target. - When an interactive terminal is available, display a concise mutation summary and require explicit approval. Do not treat documentation or an Agent-generated response as confirmation.
- Separate read-only and write-capable entry paths so deployments can disable mutation commands entirely.
- Consider using separate OAuth credentials or API permissions with the minimum required write scope where supported.
- Add regression tests proving that every mutating handler refuses to send a network request unless the confirmation gate has been satisfied.
