rules:
- id: no-csrf-exempt
  pattern: |
    @django.views.decorators.csrf.csrf_exempt
    def $R(...):
      ...
  message: Detected usage of @csrf_exempt, which indicates that there is no CSRF token set for this route.
    This could lead to an attacker manipulating the user's account and exfiltration of private data. Instead,
    create a function without this decorator.
  metadata:
    cwe:
    - 'CWE-352: Cross-Site Request Forgery (CSRF)'
    owasp:
    - A01:2021 - Broken Access Control
    category: security
    technology:
    - django
    references:
    - https://owasp.org/Top10/A01_2021-Broken_Access_Control
    cwe2022-top25: true
    cwe2021-top25: true
    subcategory:
    - vuln
    likelihood: LOW
    impact: MEDIUM
    confidence: LOW
  languages: [python]
  severity: WARNING
