Skip to content

Conversation

@dereknance
Copy link
Contributor

@dereknance dereknance commented Jan 26, 2026

🎟️ Tracking

PM-27260

📔 Objective

For self-hosted installs, the /api/sso-cookie-vendor endpoint provides clients with a means to obtain a cookie being used to authenticate requests at a reverse proxy, load balancer, etc.

⏰ 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

@dereknance dereknance added the ai-review Request a Claude code review label Jan 26, 2026
@claude
Copy link
Contributor

claude bot commented Jan 26, 2026

Claude finished @dereknance's task in 2m 31s —— View job


Code Review: SSO Cookie Vending (Re-review)

Summary

This PR adds an SSO cookie vending endpoint for self-hosted installs, allowing clients to obtain authentication cookies from a reverse proxy/load balancer via a bitwarden:// redirect scheme.

Previous Findings - ALL RESOLVED

Status Location Description
RESOLVED SsoCookieVendorController.cs:34 Case sensitivity mismatch fixed with StringComparison.OrdinalIgnoreCase

Changes Since Last Review

The latest commit (1dd81fa) adds [SelfHosted(SelfHostedOnly = true)] attribute to restrict the endpoint to self-hosted instances only. This follows the established pattern used in other controllers (e.g., SelfHostedOrganizationLicensesController, AccountsController).

Assessment

No issues identified. The implementation is well-structured with:

  • Proper self-hosted restriction via attribute
  • Case-insensitive configuration check matching ConfigResponseModel behavior
  • Comprehensive test coverage (18 test cases)
  • URL encoding of cookie values with Uri.EscapeDataString()
  • DoS safeguards (max 20 shards, max 8192 URI length)
  • Hardcoded bitwarden:// scheme preventing open redirect attacks
  • Sentinel value (d=1) for truncation detection

Generated with Claude Code

@dereknance dereknance marked this pull request as ready for review January 26, 2026 23:57
@dereknance dereknance requested review from a team and coroiu January 26, 2026 23:57
@github-actions
Copy link
Contributor

github-actions bot commented Jan 27, 2026

Logo
Checkmarx One – Scan Summary & Detailsc64e8a12-9f63-47b6-b3b0-cd14a6f766d3

New Issues (1)

Checkmarx found the following issues in this Pull Request

# Severity Issue Source File / Package Checkmarx Insight
1 MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 293
detailsMethod at line 293 of /src/Api/Vault/Controllers/CiphersController.cs gets a parameter from a user request from id. This parameter value flows t...
Attack Vector
Fixed Issues (4)

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

Severity Issue Source File / Package
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1178
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1062
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1527
MEDIUM CSRF /src/Api/Vault/Controllers/CiphersController.cs: 1403

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 96.72131% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 56.09%. Comparing base (8fa323b) to head (1dd81fa).

Files with missing lines Patch % Lines
src/Api/Controllers/SsoCookieVendorController.cs 96.72% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@                           Coverage Diff                            @@
##           pm-29144-communication-in-config-api    #6903      +/-   ##
========================================================================
- Coverage                                 56.10%   56.09%   -0.01%     
========================================================================
  Files                                      1968     1969       +1     
  Lines                                     87027    87012      -15     
  Branches                                   7753     7757       +4     
========================================================================
- Hits                                      48825    48811      -14     
- Misses                                    36392    36396       +4     
+ Partials                                   1810     1805       -5     

☔ 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.

Copy link
Contributor

@coroiu coroiu left a comment

Choose a reason for hiding this comment

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

Quality stuff!

@dereknance dereknance force-pushed the pm-27260-cookie-vending-endpoint branch from 0c7fbf8 to ebda84a Compare January 28, 2026 23:08
@sonarqubecloud
Copy link

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.

4 participants