Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/api/plane/api/views/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from rest_framework.generics import GenericAPIView

# Module imports
from plane.authentication.session import BaseSessionAuthentication
from plane.db.models.api import APIToken
from plane.api.middleware.api_authentication import APIKeyAuthentication
from plane.api.rate_limit import ApiKeyRateThrottle, ServiceTokenRateThrottle
Expand All @@ -48,7 +49,7 @@ def initial(self, request, *args, **kwargs):


class BaseAPIView(TimezoneMixin, GenericAPIView, ReadReplicaControlMixin, BasePaginator):
authentication_classes = [APIKeyAuthentication]
authentication_classes = [BaseSessionAuthentication, APIKeyAuthentication]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Medium (security). This brings the public /api/v1/ REST surface under BaseSessionAuthentication, whose enforce_csrf is a no-op ("Disable csrf for the rest apis" in plane/authentication/session.py). So any valid browser session cookie can now drive state-changing REST calls with no CSRF check — mitigated only by SameSite cookie policy + the mPass ForwardAuth edge.

Required for the plane-mcp forwarded-ID-token → oauth2-proxy → session flow, and consistent with plane/app/views/base.py / license / space, which already use this class. Please confirm the session + _oauth2_proxy cookies are SameSite=Lax/Strict here, and acknowledge the widened surface in the PR description.


Comment on lines 51 to 53
permission_classes = [IsAuthenticated]

Expand Down Expand Up @@ -167,7 +168,7 @@ def expand(self):
class BaseViewSet(TimezoneMixin, ReadReplicaControlMixin, ModelViewSet, BasePaginator):
model = None

authentication_classes = [APIKeyAuthentication]
authentication_classes = [BaseSessionAuthentication, APIKeyAuthentication]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Same CSRF-exempt note as BaseAPIView above — BaseViewSet now also accepts session cookies on /api/v1/ writes with CSRF disabled.

permission_classes = [
Comment on lines 168 to 172
IsAuthenticated,
]
Expand Down