Why AI tools produce this: AI coding tools produce this regularly, typically when prompted for a shortcut or a quick fix.
Why this matters
Setting authentication_classes = [] on a view (or the @authentication_classes([]) decorator on a function view) turns off every authentication scheme for that endpoint, so request.user is always anonymous and any permission tied to an authenticated user cannot hold (CWE-306, OWASP A01:2021).
List the schemes the view should accept, for example authentication_classes = [TokenAuthentication], instead of emptying it.
from rest_framework.authentication import TokenAuthenticationfrom rest_framework.decorators import api_view, authentication_classesfrom rest_framework.permissions import IsAuthenticatedfrom rest_framework.response import Responsefrom rest_framework.views import APIViewclass AccountView(APIView): # ok: auth.py.drf.view-authentication-disabled -- populated with a real scheme authentication_classes = [TokenAuthentication] permission_classes = [IsAuthenticated] def get(self, request): return Response({"ok": True})# ok: auth.py.drf.view-authentication-disabled -- decorator lists a real scheme@api_view(["GET"])@authentication_classes([TokenAuthentication])def account_status(request): return Response({"ok": True})
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.