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-12548] Fido2 scripts should not load when user is logged out #11444

Conversation

cagonzalezcs
Copy link
Contributor

🎟️ Tracking

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

📔 Objective

The content scripts used to override the Webauthn API are being injected when a user is in a logged out state. This problem introduces an issue where we break the default Webauthn API since an un-authed user cannot respond to the overriden Webauthn API call in any manner.

The changes in this PR address that problem by reworking how we handle injecting the fido2 content scripts on load of the extension. Effectively, we should only be injecting those scripts if the user is logged in or shortly after the user logs into the browser extension.

Resolves #11199 (comment)

⏰ 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

@cagonzalezcs cagonzalezcs requested a review from a team as a code owner October 7, 2024 18:28
Copy link
Contributor

github-actions bot commented Oct 7, 2024

Logo
Checkmarx One – Scan Summary & Details6d13053d-d363-4590-a037-33823b08e3f7

No New Or Fixed Issues Found

Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 84.21053% with 3 lines in your changes missing coverage. Please review.

Project coverage is 33.28%. Comparing base (b6ea607) to head (7724f1d).

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...er/src/autofill/fido2/content/fido2-page-script.ts 0.00% 2 Missing ⚠️
...ido2/content/fido2-page-script-delay-append.mv2.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #11444   +/-   ##
=======================================
  Coverage   33.28%   33.28%           
=======================================
  Files        2741     2741           
  Lines       85810    85824   +14     
  Branches    16367    16370    +3     
=======================================
+ Hits        28559    28564    +5     
- Misses      54987    54997   +10     
+ Partials     2264     2263    -1     

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

@cagonzalezcs cagonzalezcs merged commit a5c1a5a into main Oct 8, 2024
25 of 26 checks passed
@cagonzalezcs cagonzalezcs deleted the autofill/pm-12548-fido2-script-should-not-load-when-user-is-not-logged-in branch October 8, 2024 21:02
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.

Installing the extension breaks WebAuthn
2 participants