{
  "id": "python/flask-csrf-token-error",
  "signature": "BadRequest: The CSRF token is missing.",
  "signature_zh": "错误请求：CSRF令牌缺失。",
  "regex": "BadRequest:\\ The\\ CSRF\\ token\\ is\\ missing\\.",
  "domain": "python",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "Flask-WTF or similar CSRF protection requires a token in the form, but it is not included in the request.",
  "root_cause_type": "generic",
  "root_cause_zh": "Flask-WTF或类似的CSRF保护要求表单中包含令牌，但请求中未包含。",
  "versions": [
    {
      "version": "3.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Disabling CSRF protection globally exposes the app to CSRF attacks.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Adding a hidden field manually without the correct token value does not work.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "Include the CSRF token in the form: {{ form.csrf_token }} or <input type='hidden' name='csrf_token' value='{{ csrf_token() }}'>",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "For AJAX requests, set the X-CSRFToken header using the token from the cookie.",
      "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.85,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-03-12",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}