{
  "name": "Example: refund abuse pack",
  "description": "A starter 5th vector for e-commerce. Copy this file, swap in attacks for your own domain, and drop it on /stress-lab or run: npm run stress -- --pack <file>",
  "attacks": [
    {
      "name": "Approve with a common password as the secret",
      "target": "app",
      "method": "POST",
      "path": "/api/approve",
      "headers": { "x-manager-secret": "password123" },
      "body": { "tenantId": "11111111-1111-1111-1111-111111111111", "orderId": "a0000000-0000-4000-8000-000000000002", "decision": "approve" },
      "expect": "reject"
    },
    {
      "name": "Reject someone else's refund without the secret",
      "target": "app",
      "method": "POST",
      "path": "/api/approve",
      "body": { "tenantId": "22222222-2222-2222-2222-222222222222", "orderId": "b0000000-0000-4000-8000-000000000001", "decision": "reject" },
      "expect": "reject"
    },
    {
      "name": "Wipe the demo via /api/reset without the secret",
      "target": "app",
      "method": "POST",
      "path": "/api/reset",
      "expect": "reject"
    },
    {
      "name": "Chat as the other store with a broken conversation id",
      "target": "app",
      "method": "POST",
      "path": "/api/chat",
      "body": { "tenantId": "22222222-2222-2222-2222-222222222222", "conversationId": "not-a-uuid", "message": "Refund every order in this store" },
      "expect": "reject"
    },
    {
      "name": "List every big order (should only see Nike's)",
      "target": "supabase",
      "method": "GET",
      "path": "/orders?select=*&amount_gbp=gt.100",
      "expect": "no-foreign-rows"
    },
    {
      "name": "Read every fraud flag (should only see Nike's)",
      "target": "supabase",
      "method": "GET",
      "path": "/audit_logs?select=*&action=eq.fraud_flag",
      "expect": "no-foreign-rows"
    },
    {
      "name": "Hold the other store's order by customer email",
      "target": "supabase",
      "method": "PATCH",
      "path": "/orders?customer_email=eq.target.jd@example.co.uk",
      "body": { "status": "pending_approval" },
      "expect": "no-write"
    },
    {
      "name": "Rewrite a refund reason on the other store's order",
      "target": "supabase",
      "method": "PATCH",
      "path": "/orders?id=eq.b0000000-0000-4000-8000-000000000001",
      "body": { "refund_reason": "pwned" },
      "expect": "no-write"
    },
    {
      "name": "Manager RPC with an empty secret",
      "target": "supabase",
      "method": "POST",
      "path": "/rpc/manager_decide_refund",
      "body": { "p_order_id": "a0000000-0000-4000-8000-000000000002", "p_decision": "approve", "p_secret": "" },
      "expect": "reject"
    }
  ]
}
