Skip to content

Conversation

@ike-kottlowski
Copy link
Contributor

@ike-kottlowski ike-kottlowski commented Jan 28, 2026

🎟️ Tracking

PM-30563

SDK PR: #717
Client PR: #18620

📔 Objective

To ensure that we return the same response for a valid and invalid email, while still sending the OTP to when the email is correct.

⏰ 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

…required to protect against enumeration attacks.
test: updating tests to match new approach.
@github-actions
Copy link
Contributor

github-actions bot commented Jan 28, 2026

Logo
Checkmarx One – Scan Summary & Details7872a5a8-da53-469a-99c6-392f3829896b

New Issues (2)

Checkmarx found the following issues in this Pull Request

# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 291
detailsMethod at line 291 of /src/Api/Auth/Controllers/AccountsController.cs gets a parameter from a user request from model. This parameter value flow...
Attack Vector
2 MEDIUM CSRF /src/Api/Auth/Controllers/AccountsController.cs: 452
detailsMethod at line 452 of /src/Api/Auth/Controllers/AccountsController.cs gets a parameter from a user request from model. This parameter value flow...
Attack Vector
Fixed Issues (29)

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

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Tools/Controllers/SendsController.cs: 68
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1428
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1428
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1428
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1403
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1527
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1457
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1311
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 847
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 847
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1457
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 775
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 807
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 807
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 775
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1403
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 293
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1088
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1508
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 245
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 161
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 191
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 216
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1457
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1017
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 732
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1050
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1160
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 293

@ike-kottlowski ike-kottlowski changed the title [PM-30563] Change error response to protect against enumeration [PM-30563] Change error response on Send Access token request Jan 28, 2026
@ike-kottlowski ike-kottlowski added the ai-review Request a Claude code review label Jan 28, 2026
@claude
Copy link
Contributor

claude bot commented Jan 28, 2026

Claude finished @ike-kottlowski's task in 1m 54s —— View job


Code Review: PM-30563 - Change error response on Send Access token request

Status: Approved

Summary

This PR improves enumeration protection for the Send access email OTP flow by returning identical responses for valid and invalid emails, preventing attackers from determining which emails are associated with Sends.


Previous Issue - RESOLVED

The merge conflict issue identified in my previous review has been correctly fixed in commit cf09bdf27. Line 79 in SendEmailOtpRequestValidator.cs now correctly uses EmailAndOtpRequired instead of the removed EmailOtpSent constant.


Changes Reviewed

Area Assessment
Security Sound enumeration protection - identical responses for valid/invalid emails
Correctness Constants renamed consistently across all files
Tests Comprehensive coverage - 5 test files updated with correct expectations
Breaking Changes Coordinated with SDK PR #717 and Client PR #18620

Key Changes

  1. Constants consolidated:

    • Removed EmailInvalid (no longer needed)
    • Renamed EmailOtpSent to EmailAndOtpRequired
  2. Error responses unified:

    • Invalid email: InvalidRequest + email_and_otp_required
    • Valid email needing OTP: InvalidRequest + email_and_otp_required
    • This prevents email enumeration attacks
  3. Documentation: Good inline comment (lines 45-51) explaining the intentional deviation from standard error patterns for security purposes.


Reviewed by Claude Code

@codecov
Copy link

codecov bot commented Jan 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.06%. Comparing base (a27eda7) to head (cf09bdf).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6911      +/-   ##
==========================================
+ Coverage   56.05%   56.06%   +0.01%     
==========================================
  Files        1971     1971              
  Lines       87061    87060       -1     
  Branches     7758     7760       +2     
==========================================
+ Hits        48801    48810       +9     
+ Misses      36453    36442      -11     
- Partials     1807     1808       +1     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ike-kottlowski ike-kottlowski marked this pull request as ready for review January 28, 2026 16:26
@ike-kottlowski ike-kottlowski requested a review from a team as a code owner January 28, 2026 16:26
Copy link
Contributor

Choose a reason for hiding this comment

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

👍 Changes look good.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai-review Request a Claude code review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants