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-12512] Add Endpoint to allow users to request a new device otp #5146

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ike-kottlowski
Copy link
Contributor

@ike-kottlowski ike-kottlowski commented Dec 12, 2024

🎟️ Tracking

PM-12512

📔 Objective

When a user tries to log into a new device they are sent and OTP. If for any reason the OTP is invalid, or the user needs another OTP.

This PR adds an endpoint that allows the user to request another OTP in an unauthenticated state. Regardless of secret verification the endpoint will always return 200 to protect against account enumeration.

📸 Screenshots

⏰ 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

@ike-kottlowski ike-kottlowski requested a review from a team as a code owner December 12, 2024 06:26
@ike-kottlowski ike-kottlowski requested a review from rr-bw December 12, 2024 06:26
Copy link

codecov bot commented Dec 12, 2024

Codecov Report

Attention: Patch coverage is 73.33333% with 4 lines in your changes missing coverage. Please review.

Project coverage is 43.01%. Comparing base (c0a9c55) to head (d99e6f6).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/Api/Auth/Controllers/AccountsController.cs 0.00% 3 Missing ⚠️
...ts/UnauthenticatedSecretVerificatioRequestModel.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5146      +/-   ##
==========================================
+ Coverage   42.96%   43.01%   +0.05%     
==========================================
  Files        1444     1447       +3     
  Lines       66101    66157      +56     
  Branches     6057     6061       +4     
==========================================
+ Hits        28397    28455      +58     
+ Misses      36422    36420       -2     
  Partials     1282     1282              

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

Copy link
Contributor

github-actions bot commented Dec 12, 2024

Logo
Checkmarx One – Scan Summary & Details6f813f69-af17-490a-b70c-a1154267440f

New Issues

Severity Issue Source File / Package Checkmarx Insight
MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 966 Attack Vector
MEDIUM CSRF /src/Billing/Controllers/PayPalController.cs: 66 Attack Vector
LOW Log_Forging /src/Api/Auth/Controllers/AccountsController.cs: 966 Attack Vector
LOW Missing_CSP_Header /src/Core/MailTemplates/Handlebars/AdminConsole/DomainClaimedByOrganization.html.hbs: 5 Attack Vector

Fixed Issues

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 70
MEDIUM CSRF /src/Api/Controllers/LicensesController.cs: 44
MEDIUM CSRF /src/Billing/Controllers/RecoveryController.cs: 38
MEDIUM CSRF /src/Api/Billing/Controllers/OrganizationsController.cs: 52
MEDIUM CSRF /src/Billing/Controllers/StripeController.cs: 164
MEDIUM CSRF /src/Api/AdminConsole/Controllers/PoliciesController.cs: 91
MEDIUM CSRF /src/Admin/AdminConsole/Controllers/OrganizationsController.cs: 372
LOW Log_Forging /src/Api/AdminConsole/Controllers/ProvidersController.cs: 72
LOW Log_Forging /src/Api/AdminConsole/Controllers/ProvidersController.cs: 72
LOW Log_Forging /src/Api/AdminConsole/Controllers/ProvidersController.cs: 72

@rr-bw rr-bw requested review from JaredSnider-Bitwarden and removed request for rr-bw December 12, 2024 08:43
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we get complete test coverage for this new method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, added more explicit testing and some extra ones for SendOTPAsync in d99e6f6

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