{
  "id": "python/flask-wtf-csrf-token-missing",
  "signature": "BadRequest: The CSRF token is missing.",
  "signature_zh": "BadRequest: CSRF 令牌缺失。",
  "regex": "BadRequest:\\ The\\ CSRF\\ token\\ is\\ missing\\.",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "POST/PUT/DELETE request lacks the `csrf_token` form field or `X-CSRFToken` header, or CSRFProtect is enabled without token in template.",
  "root_cause_type": "generic",
  "root_cause_zh": "POST/PUT/DELETE 请求缺少 `csrf_token` 表单字段或 `X-CSRFToken` 头，或启用了 CSRFProtect 但模板中未包含令牌。",
  "versions": [
    {
      "version": "1.2.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Removes protection; opens CSRF vulnerability.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Same as disabling; negates the extension.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "In template: `<form method=\"post\">{{ csrf_token() }}...` or `<meta name=\"csrf-token\" content=\"{{ csrf_token() }}\">` and send as `X-CSRFToken` header from JS.",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.85,
      "how": "For APIs using token auth, exempt only token-protected blueprints: `csrf.exempt(api_bp)`.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-05-02",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}