Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-16777] Fix exception when bulk restoring revoked users who never accepted invitations #5224

Merged
merged 5 commits into from
Jan 20, 2025

Conversation

r-tome
Copy link
Contributor

@r-tome r-tome commented Jan 7, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-16777

📔 Objective

When attempting to bulk restore users who were invited to an organization but revoked before accepting the invitation, an exception is thrown. This prevents the restore process from completing successfully.

This is caused by trying to check if those users have 2FA enabled which requires a UserId which they have as null.

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

Copy link

codecov bot commented Jan 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 44.07%. Comparing base (5423e5d) to head (5e46d51).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5224      +/-   ##
==========================================
+ Coverage   44.02%   44.07%   +0.05%     
==========================================
  Files        1476     1476              
  Lines       68260    68262       +2     
  Branches     6179     6180       +1     
==========================================
+ Hits        30052    30089      +37     
+ Misses      36902    36864      -38     
- Partials     1306     1309       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

github-actions bot commented Jan 13, 2025

Logo
Checkmarx One – Scan Summary & Details276d109a-7c4d-44f9-8500-fe4dba1b0270

New Issues (9)

Checkmarx found the following issues in this Pull Request

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Billing/Controllers/PayPalController.cs: 66
detailsMethod PostIpn at line 66 of /src/Billing/Controllers/PayPalController.cs gets a parameter from a user request from Body. This parameter value flow...
Attack Vector
MEDIUM Privacy_Violation /src/Core/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs: 84
detailsMethod UpdateAsync at line 84 of /src/Core/AdminConsole/OrganizationAuth/UpdateOrganizationAuthRequestCommand.cs sends user information outside the...
Attack Vector
MEDIUM Privacy_Violation /src/Core/NotificationHub/NotificationHubPushNotificationService.cs: 195
detailsMethod PushAuthRequestAsync at line 195 of /src/Core/NotificationHub/NotificationHubPushNotificationService.cs sends user information outside the a...
Attack Vector
MEDIUM Privacy_Violation /src/Api/Vault/Models/Request/CipherRequestModel.cs: 173
detailsMethod ToCipherLoginData at line 173 of /src/Api/Vault/Models/Request/CipherRequestModel.cs sends user information outside the application. This ma...
Attack Vector
MEDIUM Privacy_Violation /src/Api/Vault/Models/Request/CipherRequestModel.cs: 202
detailsMethod ToCipherIdentityData at line 202 of /src/Api/Vault/Models/Request/CipherRequestModel.cs sends user information outside the application. This...
Attack Vector
LOW Log_Forging /src/Api/Vault/Controllers/CiphersController.cs: 220
detailsMethod PutAdmin at line 220 of /src/Api/Vault/Controllers/CiphersController.cs gets user input from element model. This element’s value flows throu...
Attack Vector
LOW Log_Forging /src/Api/Auth/Controllers/AuthRequestsController.cs: 87
detailsMethod PostAdminRequest at line 87 of /src/Api/Auth/Controllers/AuthRequestsController.cs gets user input from element model. This element’s value ...
Attack Vector
LOW Log_Forging /src/Api/Auth/Controllers/AuthRequestsController.cs: 75
detailsMethod Post at line 75 of /src/Api/Auth/Controllers/AuthRequestsController.cs gets user input from element model. This element’s value flows throug...
Attack Vector
LOW Missing_CSP_Header /src/Core/MailTemplates/Handlebars/AdminConsole/DomainClaimedByOrganization.html.hbs: 7
detailsA Content Security Policy is not explicitly defined within the web-application.
Attack Vector
Fixed Issues (10)

Great job! The following issues were fixed in this Pull Request

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Tools/Controllers/OrganizationExportController.cs: 53
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 470
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/PoliciesController.cs: 65
MEDIUM CSRF /src/Api/AdminConsole/Public/Controllers/PoliciesController.cs: 46
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 121
MEDIUM CSRF /src/Api/AdminConsole/Controllers/GroupsController.cs: 80
MEDIUM CSRF /src/Admin/AdminConsole/Controllers/OrganizationsController.cs: 371
MEDIUM Privacy_Violation /src/Api/Auth/Models/Request/Accounts/SetPasswordRequestModel.cs: 28
LOW Log_Forging /src/Api/Auth/Controllers/AccountsController.cs: 927
LOW Log_Forging /src/Api/Auth/Controllers/AccountsController.cs: 261

@r-tome r-tome marked this pull request as ready for review January 13, 2025 13:55
@r-tome r-tome requested a review from a team as a code owner January 13, 2025 13:55
@r-tome r-tome requested a review from BTreston January 13, 2025 13:55
@r-tome r-tome removed the needs-qa label Jan 20, 2025
@r-tome r-tome merged commit 04e5626 into main Jan 20, 2025
53 of 54 checks passed
@r-tome r-tome deleted the ac/pm-16777/fix-bulk-restoring-invited-revoked-users branch January 20, 2025 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants