8000 PM-13367: Fix TDE logout could bypass MP approval by matt-livefront · Pull Request #1140 · bitwarden/ios · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

PM-13367: Fix TDE logout could bypass MP approval #1140

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

Merged
merged 5 commits into from
Nov 20, 2024

Conversation

matt-livefront
Copy link
Collaborator
@matt-livefront matt-livefront commented Nov 14, 2024

🎟️ Tracking

PM-13367

📔 Objective

This fixes a bug where after logging out and then back into an account with TDE and a master password, if you switch accounts on the vault unlock screen you can get into the newly added TDE account without having to confirm your master password.

The root cause of this was that VaultTimeoutService was using StateService.getAccountIdOrActiveId(_:) to get the active user ID, but this does some validation on the user ID and the user ID was already deleted prior to this. I ended up reversing the order of this so the account is ultimately deleted last. However, this caused an issue with the database publishers getting updates as the user's data is deleted from the database. At that point the vault is locked so if any decryption operations are attempted, it would log an error. Instead of deleting data table-by-table, I updated the batch delete to delete everything before merging the changes back into the context.

⏰ 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

Copy link
Contributor
github-actions bot commented Nov 14, 2024

Logo
Checkmarx One – Scan Summary & Details27e8e271-313e-4508-9a01-5b4d8fec4f02

No New Or Fixed Issues Found

Copy link
codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.38%. Comparing base (d6ee174) to head (74c6ed1).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1140      +/-   ##
==========================================
+ Coverage   89.36%   89.38%   +0.01%     
==========================================
  Files         688      688              
  Lines       43702    43734      +32     
==========================================
+ Hits        39056    39091      +35     
+ Misses       4646     4643       -3     

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


🚨 Try these New Features:

fedemkr
fedemkr previously approved these changes Nov 18, 2024
Copy link
Member
@fedemkr fedemkr left a comment

Choose a reason for hiding this comment

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

Approving with some questions that I believe it's fine but raising just in case

@matt-livefront matt-livefront merged commit 0929d47 into main Nov 20, 2024
9 checks passed
@matt-livefront matt-livefront deleted the matt/PM-13367-tde-logout branch November 20, 2024 16:09
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
0