HIGH AI PREVALENCE: MEDIUM auth.py.drf.default-authentication-empty
DRF disables authentication globally with an empty DEFAULT_AUTHENTICATION_CLASSES list.
Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
An empty list means no authentication scheme runs, so request.user is never populated from a credential and every view falls back to anonymous access (CWE-306, OWASP A01:2021). Permission checks that rely on request.user being authenticated then have nothing to enforce against.
Populate the list with the schemes you use, for example rest_framework.authentication.SessionAuthentication and rest_framework.authentication.TokenAuthentication.
VULNERABLE
SAFE
Suppressing this rule
If a finding is a genuine false positive, scope the suppression to the exact line and leave a reason, never disable the rule project-wide. Disable directives are line-scoped by design.
# oauthlint-disable-next-line auth.py.drf.default-authentication-empty -- <reason>