hardening(space): add project_id scope to destroy()/partial_update() lookups in public board views
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 59.6k
- Forks
- 5.8k
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 49
Description
Summary
IssueReactionPublicViewSet.destroy() and IssueCommentPublicViewSet.partial_update() / destroy() fetch objects by pk + actor=request.user without additionally scoping to the board's project_id. This is a defense-in-depth gap.
Current Behavior
# IssueCommentPublicViewSet.partial_update() and destroy()
comment = IssueComment.objects.get(pk=pk, actor=request.user)
# No project_id or workspace_id constraint
# IssueReactionPublicViewSet.destroy()
issue_reaction = IssueReaction.objects.get(
workspace_id=project_deploy_board.workspace_id,
issue_id=issue_id,
reaction=reaction_code,
actor=request.user,
)
# Missing: project_id=project_deploy_board.project_id
Security Impact
Low. All lookups include actor=request.user — users can only affect their own objects. However, without project_id scoping, a user could modify/delete their own comment via a board from a different project within the same workspace, or delete their own reaction via any board in the workspace.
Recommended Fix
# IssueCommentPublicViewSet.partial_update() and destroy()
comment = IssueComment.objects.get(
pk=pk,
actor=request.user,
project_id=project_deploy_board.project_id,
workspace_id=project_deploy_board.workspace_id,
)
# IssueReactionPublicViewSet.destroy()
issue_reaction = IssueReaction.objects.get(
workspace_id=project_deploy_board.workspace_id,
project_id=project_deploy_board.project_id, # add
issue_id=issue_id,
reaction=reaction_code,
actor=request.user,
)
Affected File
apps/api/plane/space/views/issue.py
Related
Identified during security audit of PR #9498. Pre-existing issue, not introduced by that PR.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open apps/api/plane/space/views/issue.py and locate IssueCommentPublicViewSet.partial_update(), IssueCommentPublicViewSet.destroy(), and IssueReactionPublicViewSet.destroy(). Ensure the object lookups include the board's project_id while retaining the stated actor and workspace constraints, then verify that operations cannot cross project boundaries within a workspace.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- django, python
- Domain
- api, backend, security
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100