[PM-32594] Add authorization to admin-initiated sponsorship endpoints#7095
[PM-32594] Add authorization to admin-initiated sponsorship endpoints#7095cturnbull-bitwarden wants to merge 4 commits intomainfrom
Conversation
|
Claude finished @cturnbull-bitwarden's task in 2m 20s —— View job Pull Request Review: PM-32594 Add authorization to admin-initiated sponsorship endpointsSummaryThis PR fixes a security vulnerability (VULN-441) where the Changes Reviewed
AnalysisSecurity fix is correct. The Route parameter renaming is necessary. The rename from Both deployment targets are covered. The cloud controller ( Test coverage is thorough. The 13 new integration tests cover both endpoints across all relevant authorization scenarios: non-member (forbidden), regular member without ManageUsers (forbidden), owner (allowed), admin (allowed), custom user with ManageUsers (allowed), and cross-organization attack (forbidden). VerdictNo issues found. This is a focused, well-implemented security fix with excellent test coverage. Reviewed by Claude (Anthropic) | Model: Opus 4.6 |
|
Great job! No new security vulnerabilities introduced in this pull request |
kdenney
left a comment
There was a problem hiding this comment.
Looks good; just one question to confirm first.
src/Api/Controllers/SelfHosted/SelfHostedOrganizationSponsorshipsController.cs
Show resolved
Hide resolved
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7095 +/- ##
==========================================
+ Coverage 56.45% 56.52% +0.07%
==========================================
Files 2013 2013
Lines 88112 88112
Branches 7863 7863
==========================================
+ Hits 49742 49804 +62
+ Misses 36554 36487 -67
- Partials 1816 1821 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-32594
📔 Objective
Adds authorization checks to the
AdminInitiatedRevokeSponsorshipAsyncandResendSponsorshipOfferendpoints in both the cloud and self-hosted sponsorship controllers. Previously, these endpoints only required[Authorize("Application")], meaning any authenticated user could call them regardless of their relationship to thesponsoring organization.
Now uses
[Authorize<ManageUsersRequirement>]to enforce that the caller is an Owner, Admin, or has the ManageUsers permission in the sponsoring organization — consistent with the existingGetSponsoredOrganizationsendpoint andCreateSponsorshipCommandvalidation.Route parameters on the affected endpoints were renamed from
{sponsoringOrgId}to{organizationId}to work with the existing authorization handler infrastructure. The C# parameter names remain unchanged.