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
16 changes: 11 additions & 5 deletions apps/api/plane/app/views/project/invite.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,16 @@ def create(self, request, slug):
workspace_role = workspace_member.role
workspace = workspace_member.workspace

# Use the workspace-scoped, network-validated project IDs only.
# Raw project_ids may contain UUIDs from other workspaces; those are
# absent from the `projects` queryset and therefore bypass the SECRET
# network check above (GHSA-45hc-q4mw-jhxm).
validated_project_ids = [str(p.id) for p in projects]

# If the user was already part of workspace
_ = ProjectMember.objects.filter(workspace__slug=slug, project_id__in=project_ids, member=request.user).update(
is_active=True
)
_ = ProjectMember.objects.filter(
workspace__slug=slug, project_id__in=validated_project_ids, member=request.user
).update(is_active=True)

ProjectMember.objects.bulk_create(
[
Expand All @@ -159,7 +165,7 @@ def create(self, request, slug):
workspace=workspace,
created_by=request.user,
)
for project_id in project_ids
for project_id in validated_project_ids
],
ignore_conflicts=True,
)
Expand All @@ -172,7 +178,7 @@ def create(self, request, slug):
workspace=workspace,
created_by=request.user,
)
for project_id in project_ids
for project_id in validated_project_ids
],
ignore_conflicts=True,
)
Expand Down
Loading