[WEB-7855] fix(security): prevent project invite email disclosure via unauthenticated GET#9305
[WEB-7855] fix(security): prevent project invite email disclosure via unauthenticated GET#9305mguptahub wants to merge 1 commit into
Conversation
…cated GET ProjectJoinEndpoint.get() was AllowAny and used ProjectMemberInviteSerializer (fields = "__all__"), leaking the invitee's email and token to anyone who knew the workspace slug, project ID, and invite UUID (GHSA-2r58-hgv7-635q). Introduce ProjectMemberInvitePublicSerializer with an explicit safe field list that excludes `email` and `token`, and swap it in for the public GET endpoint. The full serializer is retained for authenticated admin viewsets. Co-authored-by: Plane AI <noreply@plane.so>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughA new read-only serializer, ChangesPublic Invite GET Serializer
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Linked to Plane Work Item(s) References This comment was auto-generated by Plane |
Summary
Fixes GHSA-2r58-hgv7-635q — Cluster L part 2.
ProjectJoinEndpoint.get()isAllowAnyand was serializing withfields = "__all__"viaProjectMemberInviteSerializer. Anyone who knew the workspace slug, project ID, and invite UUID could retrieve the invitee's email address unauthenticated.Changes
serializers/project.py— addsProjectMemberInvitePublicSerializerwith an explicit safe field list (id,project,workspace,role,message,accepted,responded_at) that intentionally excludesemailandtokenserializers/__init__.py— exports the new serializerviews/project/invite.py—ProjectJoinEndpoint.get()now usesProjectMemberInvitePublicSerializer; the full serializer is retained for authenticated admin viewsetspost()is unchanged — it still requires the caller to supply the invitee email in the request body as verification.Pattern
Mirrors the fix applied in WEB-7854 (
WorkSpaceMemberInvitePublicSerializer) for workspace-level invites.Test plan
GET /api/v1/<slug>/projects/<project_id>/invite/<pk>/returns noemailortokenfieldsPOST /api/v1/<slug>/projects/<project_id>/invite/<pk>/with correct email still accepts/declines the invitePOSTwith wrong email still returns 403ProjectInvitationsViewset) still return full invite data including emailSummary by CodeRabbit
New Features
Bug Fixes