Skip to content

PM-34840: bug: Allow related-origin passkey creation#6777

Merged
david-livefront merged 1 commit intomainfrom
PM-34840-related-origin-passkey-creation
Apr 14, 2026
Merged

PM-34840: bug: Allow related-origin passkey creation#6777
david-livefront merged 1 commit intomainfrom
PM-34840-related-origin-passkey-creation

Conversation

@david-livefront
Copy link
Copy Markdown
Collaborator

@david-livefront david-livefront commented Apr 9, 2026

🎟️ Tracking

PM-34840

📔 Objective

This PR pulls the requested origin for privileged apps (browsers) since they have already had their origin validated. This allows us to create passkeys from websites that use related-origins.

@david-livefront david-livefront requested a review from a team as a code owner April 9, 2026 14:59
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug labels Apr 9, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.61%. Comparing base (287d8a9) to head (4b4625f).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...dentials/manager/BitwardenCredentialManagerImpl.kt 66.66% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6777      +/-   ##
==========================================
+ Coverage   85.00%   85.61%   +0.60%     
==========================================
  Files         971      871     -100     
  Lines       61312    60044    -1268     
  Branches     8647     8613      -34     
==========================================
- Hits        52121    51409     -712     
+ Misses       6190     5652     -538     
+ Partials     3001     2983      -18     
Flag Coverage Δ
app-data 17.32% <66.66%> (-0.41%) ⬇️
app-ui-auth-tools 20.39% <0.00%> (-0.34%) ⬇️
app-ui-platform 15.68% <0.00%> (-0.25%) ⬇️
app-ui-vault 26.68% <0.00%> (+0.07%) ⬆️
authenticator 6.55% <0.00%> (-0.01%) ⬇️
lib-core-network-bridge 4.28% <0.00%> (-0.01%) ⬇️
lib-data-ui 1.03% <0.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Logo
Checkmarx One – Scan Summary & Detailsee42c8eb-af23-43a8-bfd2-48a4ba1c3098

Great job! No new security vulnerabilities introduced in this pull request

SaintPatrck
SaintPatrck previously approved these changes Apr 9, 2026
?.id
?.prefixHttpsIfNecessary()

val sdkOrigin = (requestedOrigin ?: createPublicKeyCredentialRequest.origin)
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I thought about this some more from my previous suggestion: While this "works" to trick the SDK into not doing extra validation, it means that the generated clientDataJSON will look like {"origin":"https://rpId.com", ...} rather than {"origin":"https://relatedorigin.com", ...}, which means that the relying party loses information.

The correct thing to do is to fix this in the SDK. I think it's OK to move forward with this workaround, but maybe we should add a TODO to address that later?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed. Is there a ticket we can reference here?

@david-livefront david-livefront force-pushed the PM-34840-related-origin-passkey-creation branch 2 times, most recently from 4a91210 to 83547fd Compare April 13, 2026 17:51
iinuwa
iinuwa previously approved these changes Apr 13, 2026
Copy link
Copy Markdown

@iinuwa iinuwa left a comment

Choose a reason for hiding this comment

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

LGTM, but this should be reviewed by someone else with more experience with the Android implementation than me to be sure.

?.prefixHttpsIfNecessary()

// We use the requested relying party for the basis of the origin for privileged apps to
// ensure that related-origin requests are process successfully. In the future, the SDK
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⛏️

Suggested change
// ensure that related-origin requests are process successfully. In the future, the SDK
// ensure that related-origin requests are processed successfully. In the future, the SDK

?.id
?.prefixHttpsIfNecessary()

val sdkOrigin = (requestedOrigin ?: createPublicKeyCredentialRequest.origin)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Agreed. Is there a ticket we can reference here?

@david-livefront david-livefront force-pushed the PM-34840-related-origin-passkey-creation branch from 83547fd to 4b4625f Compare April 14, 2026 15:20
@david-livefront
Copy link
Copy Markdown
Collaborator Author

Thanks @SaintPatrck & @iinuwa

@david-livefront david-livefront added this pull request to the merge queue Apr 14, 2026
Merged via the queue into main with commit 7d2bfe1 Apr 14, 2026
26 checks passed
@david-livefront david-livefront deleted the PM-34840-related-origin-passkey-creation branch April 14, 2026 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:password-manager Bitwarden Password Manager app context t:bug Change Type - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants