Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 6 additions & 4 deletions apps/api/plane/space/views/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ class ProjectMembersEndpoint(BaseAPIView):

def get(self, request, anchor):
deploy_board = DeployBoard.objects.filter(anchor=anchor).first()
Copy link
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# 1. Check DeployBoard model definition and entity_name field
echo "=== DeployBoard Model Definition ==="
rg -n "class DeployBoard" --type py -A 30 apps/api/plane/db/models/

echo ""
echo "=== entity_name field constraints ==="
rg -n "entity_name" --type py -B 2 -A 2 apps/api/plane/db/models/ | head -60

Repository: makeplane/plane

Length of output: 7389


🏁 Script executed:

#!/bin/bash

# 2. Check the specific file to see all DeployBoard lookups
echo "=== All DeployBoard lookups in project.py ==="
rg -n "DeployBoard" --type py -B 2 -A 2 apps/api/plane/space/views/project.py

Repository: makeplane/plane

Length of output: 1775


🏁 Script executed:

#!/bin/bash

# 3. Verify lines 23, 37, 59, and 69 to see the exact filter patterns
echo "=== Lines around 23, 37, 59, 69 in project.py ==="
sed -n '20,30p' apps/api/plane/space/views/project.py
echo "---"
sed -n '34,42p' apps/api/plane/space/views/project.py
echo "---"
sed -n '56,64p' apps/api/plane/space/views/project.py
echo "---"
sed -n '66,78p' apps/api/plane/space/views/project.py

Repository: makeplane/plane

Length of output: 1633


🏁 Script executed:

#!/bin/bash

# 4. Check what entity types can have deploy boards
echo "=== Possible entity_name values and where they're used ==="
rg "entity_name\s*=" --type py apps/api/plane/ | grep -E "(project|cycle|module)" | head -20

Repository: makeplane/plane

Length of output: 2911


Missing entity_name="project" filter on line 69 allows unauthorized member disclosure.

The ProjectMembersEndpoint is the only endpoint in this file that omits the entity_name="project" filter. Since the anchor field is globally unique, an attacker can supply an anchor for a non-project deploy board (e.g., a cycle or module board that also has a project FK). The endpoint will still resolve deploy_board.project and return the full member list—circumventing the intended access control for project-specific boards.

Every other endpoint in this file and across the space views explicitly filters by entity_name="project". This endpoint must do the same.

🛡️ Proposed fix
-        deploy_board = DeployBoard.objects.filter(anchor=anchor).first()
+        deploy_board = DeployBoard.objects.filter(anchor=anchor, entity_name="project").first()
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
deploy_board = DeployBoard.objects.filter(anchor=anchor).first()
deploy_board = DeployBoard.objects.filter(anchor=anchor, entity_name="project").first()
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/api/plane/space/views/project.py` at line 69, ProjectMembersEndpoint
omits the entity_name filter allowing cross-entity member disclosure; update the
DeployBoard lookup in ProjectMembersEndpoint to include entity_name="project" so
it only resolves project deploy boards (replace
DeployBoard.objects.filter(anchor=anchor).first() with a filtered query
including entity_name="project"), ensuring subsequent use of
deploy_board.project returns members only for project-scoped boards.

if not deploy_board:
return Response(
{"error": "Invalid anchor"},
status=status.HTTP_404_NOT_FOUND,
)

members = ProjectMember.objects.filter(
project=deploy_board.project,
Expand All @@ -75,10 +80,7 @@ def get(self, request, anchor):
).values(
"id",
"member",
"member__first_name",
"member__last_name",
"member__display_name",
"project",
"workspace",
"member__avatar",
)
return Response(members, status=status.HTTP_200_OK)
6 changes: 1 addition & 5 deletions apps/space/core/types/member.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
export type TPublicMember = {
id: string;
member: string;
member__avatar: string;
member__first_name: string;
member__last_name: string;
member__display_name: string;
project: string;
workspace: string;
member__avatar: string;
};
6 changes: 1 addition & 5 deletions packages/types/src/users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,8 @@ export type TProfileViews = "assigned" | "created" | "subscribed";
export type TPublicMember = {
id: string;
member: string;
member__avatar: string;
member__first_name: string;
member__last_name: string;
member__display_name: string;
project: string;
workspace: string;
member__avatar: string;
};

// export interface ICurrentUser {
Expand Down
Loading