[WEB-7895] fix: scope UserProjectInvitationsViewset to workspace-validated project IDs (GHSA-45hc-q4mw-jhxm)#9333
[WEB-7895] fix: scope UserProjectInvitationsViewset to workspace-validated project IDs (GHSA-45hc-q4mw-jhxm)#9333mguptahub wants to merge 1 commit into
Conversation
…dated project IDs (GHSA-45hc-q4mw-jhxm) The `create` handler validated the network (SECRET/PUBLIC) check against a workspace-scoped queryset but then used the raw client-supplied `project_ids` list in the subsequent bulk_create and update calls. An attacker could include UUIDs of projects from other workspaces: those are absent from the validation queryset (no network check performed), yet get inserted as ProjectMember rows via bulk_create(ignore_conflicts=True), granting cross-workspace project access. Fix: derive `validated_project_ids` from the filtered queryset (projects already scoped to the requested workspace and passed the SECRET check), and use it exclusively for all subsequent DB writes. 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 (1)
📝 WalkthroughWalkthroughIn ChangesProject Invitation ID Validation Fix
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ 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) This comment was auto-generated by Plane |
Summary
UserProjectInvitationsViewset.create()validated thenetwork(SECRET/PUBLIC) check against a workspace-scoped queryset, but used the raw client-suppliedproject_idslist for all subsequent DB writes. An attacker could include UUIDs of projects from other workspaces — those are absent from the validation queryset (bypassing the SECRET check) yet get inserted asProjectMemberrows viabulk_create(ignore_conflicts=True), granting cross-workspace project access.validated_project_ids = [str(p.id) for p in projects]from the already workspace-scoped, network-checked queryset, and use it exclusively for allProjectMemberandProjectUserPropertywrites.Changes
apps/api/plane/app/views/project/invite.pyvalidated_project_idsderived from the workspace-filteredprojectsquerysetproject_idswithvalidated_project_idsin theProjectMember.objects.filter().update(),ProjectMember.objects.bulk_create(), andProjectUserProperty.objects.bulk_create()callsTest plan
project_idscontaining UUID of a project in a different workspace → not joined (absent fromvalidated_project_ids)Co-authored-by: Plane AI noreply@plane.so
Summary by CodeRabbit