Fix project member update authorization#9300
Conversation
|
Gaurav Singhal seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
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 (2)
📝 WalkthroughWalkthroughThe ChangesPermission Restriction on ProjectMember partial_update
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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 |
Finding
Niro
TC-1A95641Afound that a project guest could PATCH another project member record with{ "is_active": false }, deactivating that user's project membership.Original PoC
As a project guest, PATCH
/api/workspaces/<slug>/projects/<project_id>/members/<victim_membership_id>/with JSON body{ "is_active": false }. Before this fix the API returned200 OK, persistedis_active=false, and the victim lost access to project member endpoints.Red test on unfixed code
Green test on fixed code
Fix
Restrict
ProjectMemberViewSet.partial_updateto project admins, matching membership create/delete behavior. Added a regression test asserting guests cannot deactivate another project member and the victim remains active.Pentested and fixed by Niro
Summary by CodeRabbit